Skip to content

Commit

Permalink
update phpThumb to v1.7.14-201608101311
Browse files Browse the repository at this point in the history
  • Loading branch information
dleffler committed Aug 27, 2016
1 parent 8eb1ce4 commit 622bf0e
Show file tree
Hide file tree
Showing 14 changed files with 3,868 additions and 839 deletions.
1,500 changes: 1,500 additions & 0 deletions external/phpThumb/docs/phpthumb.changelog.txt

Large diffs are not rendered by default.

372 changes: 372 additions & 0 deletions external/phpThumb/docs/phpthumb.faq.txt

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions external/phpThumb/docs/phpthumb.license.commercial.txt
@@ -0,0 +1,27 @@
phpThumb() Commercial License
=============================

phpThumb() is licensed under the "GNU Public License" (GPL) and/or the
"phpThumb() Commercial License" (pTCL). This document describes the pTCL.

---------------------------------------------------------------------

The license is non-exclusively granted to a single person or company,
per payment of the license fee, for the lifetime of that person or
company. The license is non-transferrable.

The pTCL grants the licensee the right to use phpThumb() in commercial
closed-source projects. Modifications may be made to phpThumb() with no
obligation to release the modified source code. phpThumb() (or pieces
thereof) may be included in any number of projects authored (in whole
or in part) by the licensee.

The licensee may use any version of phpThumb(), past, present or future,
as is most convenient. This license does not entitle the licensee to
receive any technical support, updates or bugfixes, except as such are
made publicly available to all phpThumb() users.

The licensee may not sub-license phpThumb() itself, meaning that any
commercially released product containing all or parts of phpThumb() must
have added functionality beyond what is available in phpThumb();
phpThumb() itself may not be re-licensed by the licensee.
340 changes: 340 additions & 0 deletions external/phpThumb/docs/phpthumb.license.txt

Large diffs are not rendered by default.

673 changes: 673 additions & 0 deletions external/phpThumb/docs/phpthumb.readme.txt

Large diffs are not rendered by default.

37 changes: 25 additions & 12 deletions external/phpThumb/phpThumb.config.php
Expand Up @@ -36,10 +36,11 @@


// * Security configuration
$PHPTHUMB_CONFIG['high_security_enabled'] = false; // DO NOT DISABLE THIS ON ANY PUBLIC-ACCESSIBLE SERVER. If disabled, your server is 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.php). You can use a password generator like http://silisoftware.com/tools/password-random.php to generate a strong password
$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'] = false; // 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_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['disable_debug'] = true; // DO NOT ENABLE THIS ON ANY PUBLIC-ACCESSIBLE SERVER. Prevent 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['allow_src_above_docroot'] = false; // if false (default) only allow src within document_root; if true, allow src to be anywhere in filesystem
$PHPTHUMB_CONFIG['allow_src_above_phpthumb'] = true; // if true (default), allow src to be anywhere in filesystem; if false only allow src within sub-directory of phpThumb installation
$PHPTHUMB_CONFIG['auto_allow_symlinks'] = true; // if true (default), allow symlink target directories without explicitly whitelisting them
Expand Down Expand Up @@ -182,18 +183,18 @@
$PHPTHUMB_CONFIG['background_hexcolor'] = 'FFFFFF'; // Default background color when thumbnail aspect ratio does not match fixed-dimension box - usual HTML-style hex color notation (overridden with 'bg' parameter)

// * Watermark configuration
$PHPTHUMB_CONFIG['ttf_directory'] = dirname(__FILE__).'../mpdf60/ttfonts'; // Base directory for TTF font files
$PHPTHUMB_CONFIG['ttf_directory'] = dirname(__FILE__).'/fonts'; // Base directory for TTF font files
//$PHPTHUMB_CONFIG['ttf_directory'] = 'c:/windows/fonts';


// * MySQL configuration
// You may want to pull data from a database rather than a physical file
// If so, modify the $PHPTHUMB_CONFIG['mysql_query'] line to suit your database structure
// Note: the data retrieved must be the actual binary data of the image, not a URL or filename

$PHPTHUMB_CONFIG['mysql_extension'] = 'mysqli'; // either "mysqli" or "mysql"

$PHPTHUMB_CONFIG['mysql_query'] = '';
//$PHPTHUMB_CONFIG['mysql_query'] = 'SELECT `picture` FROM `products` WHERE (`id` = \''.mysql_escape_string(@$_GET['id']).'\')';
//$PHPTHUMB_CONFIG['mysql_query'] = 'SELECT `picture` FROM `products` WHERE (`id` = \''.mysqli_real_escape_string(@$_GET['id']).'\')';

// These 4 values must be modified if $PHPTHUMB_CONFIG['mysql_query'] is not empty, but may be ignored if $PHPTHUMB_CONFIG['mysql_query'] is blank.
$PHPTHUMB_CONFIG['mysql_hostname'] = 'localhost';
Expand All @@ -210,9 +211,10 @@


// * Compatability settings
$PHPTHUMB_CONFIG['disable_pathinfo_parsing'] = true; // if true, $_SERVER[PATH_INFO] is not parsed. May be needed on some server configurations to allow normal behavior.
$PHPTHUMB_CONFIG['disable_imagecopyresampled'] = false; // if true, ImageCopyResampled is replaced with ImageCopyResampleBicubic. May be needed for buggy versions of PHP-GD.
$PHPTHUMB_CONFIG['disable_onlycreateable_passthru'] = true; // if true, any image that can be parsed by GetImageSize() can be passed through; if false, only images that can be converted to GD by ImageCreateFrom(JPEG|GIF|PNG) functions are allowed
$PHPTHUMB_CONFIG['disable_pathinfo_parsing'] = true; // if true, $_SERVER[PATH_INFO] is not parsed. May be needed on some server configurations to allow normal behavior.
$PHPTHUMB_CONFIG['disable_imagecopyresampled'] = false; // if true, imagecopyresampled is replaced with ImageCopyResampleBicubic. May be needed for buggy versions of PHP-GD.
$PHPTHUMB_CONFIG['disable_onlycreateable_passthru'] = true; // if true, any image that can be parsed by getimagesize() can be passed through; if false, only images that can be converted to GD by ImageCreateFrom(JPEG|GIF|PNG) functions are allowed
$PHPTHUMB_CONFIG['disable_realpath'] = false; // PHP realpath() function requires that "the running script must have executable permissions on all directories in the hierarchy, otherwise realpath() will return FALSE". Set config_disable_realpath=false to enable alternate filename-parsing that does not use realpath() function (but also does not resolve symbolic links)


// * HTTP remote file opening settings
Expand Down Expand Up @@ -252,10 +254,21 @@

function phpThumbURL($ParameterString, $path_to_phpThumb='phpThumb.php') {
global $PHPTHUMB_CONFIG;
if (is_array($ParameterString)) {
$ParameterStringArray = $ParameterString;
} else {
parse_str($ParameterString, $ParameterStringArray);
}
$ParamterStringEncodedArray = array();
foreach (explode($PHPTHUMB_CONFIG['high_security_url_separator'], $ParameterString) as $key_value_pair) {
@list($key, $value) = explode('=', $key_value_pair);
$ParamterStringEncodedArray[] = $key.'='.rawurlencode($value);
foreach ($ParameterStringArray as $key => $value) {
if (is_array($value)) {
// e.g. fltr[] is passed as an array
foreach ($value as $subvalue) {
$ParamterStringEncodedArray[] = $key.'[]='.rawurlencode($subvalue);
}
} else {
$ParamterStringEncodedArray[] = $key.'='.rawurlencode($value);
}
}
$ParameterString = implode($PHPTHUMB_CONFIG['high_security_url_separator'], $ParamterStringEncodedArray);
return $path_to_phpThumb.'?'.$ParameterString.$PHPTHUMB_CONFIG['high_security_url_separator'].'hash='.md5($ParameterString.$PHPTHUMB_CONFIG['high_security_password']);
Expand Down

0 comments on commit 622bf0e

Please sign in to comment.