Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"php": ">=5.3.0"
},
"scripts": {
"copy-config": "php -r \"copy('phpThumb.config.php.default', 'phpThumb.config.php');\""
"copy-config": "php -r \"copy('phpThumb.config.php.default', 'phpThumb.config.php');\"",
"hsp-generate": "php -r \"$cf=file_get_contents('phpThumb.config.php');$cf=str_replace('__HSP_KEY__', base64_encode(bin2hex(random_bytes(22))), $cf);file_put_contents('phpThumb.config.php', $cf);\""
},
"suggest": {
"ext-gd": "PHP GD library",
Expand Down
2 changes: 1 addition & 1 deletion phpThumb.config.php.default
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $PHPTHUMB_CONFIG['document_root'] = realpath((getenv('DOCUMENT_ROOT') && preg_ma
// * Security configuration
$PHPTHUMB_CONFIG['disable_debug'] = true; // DO NOT DISABLE THIS ON ANY PUBLIC-ACCESSIBLE SERVER. Prevents phpThumb from displaying any information about your system. If true, phpThumbDebug and error messages will be disabled. If set to false (debug messages enabled) then debug mode will be FORCED -- ONLY debug output will be presented, no actual thumbnail (to avoid accidentally leaving debug mode enabled on a production server)
$PHPTHUMB_CONFIG['high_security_enabled'] = true; // DO NOT DISABLE THIS ON ANY PUBLIC-ACCESSIBLE SERVER. If disabled, your server is more vulnerable to hacking attempts, both on your server and via your server to other servers. When enabled, requires 'high_security_password' set to be set and requires the use of phpThumbURL() function (at the bottom of phpThumb.config.php) to generate hashed URLs
$PHPTHUMB_CONFIG['high_security_password'] = ''; // required if 'high_security_enabled' is true, and must be at complex (uppercase, lowercase, numbers, punctuation, etc -- punctuation is strongest, lowercase is weakest; see PasswordStrength() in phpthumb.functions.php). You can use a password generator like http://silisoftware.com/tools/password-random.php to generate a strong password
$PHPTHUMB_CONFIG['high_security_password'] = '__HSP_KEY__'; // required if 'high_security_enabled' is true, and must be at complex (uppercase, lowercase, numbers, punctuation, etc -- punctuation is strongest, lowercase is weakest; see PasswordStrength() in phpthumb.functions.php). You can use a password generator like http://silisoftware.com/tools/password-random.php to generate a strong password

$PHPTHUMB_CONFIG['high_security_url_separator'] = '&'; // should almost always be left as '&'. Must be a single character. Do not change to '&' -- htmlspecialchars wrapped around phpThumbURL() takes care of this without breaking the hash
$PHPTHUMB_CONFIG['allow_src_above_docroot'] = false; // if false (default) only allow src within document_root; if true, allow src to be anywhere in filesystem
Expand Down