From: <be...@us...> - 2015-06-16 21:08:37
|
Revision: 13091 http://sourceforge.net/p/xoops/svn/13091 Author: beckmi Date: 2015-06-16 21:08:34 +0000 (Tue, 16 Jun 2015) Log Message: ----------- Replacing floatval() with (float) Modified Paths: -------------- XoopsCore/branches/2.5.x/2.5.8/htdocs/class/model/write.php XoopsCore/branches/2.5.x/2.5.8/htdocs/include/functions.php XoopsCore/branches/2.5.x/2.5.8/htdocs/kernel/object.php XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/class/thumbs/phpthumb.class.php XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/class/thumbs/phpthumb.filters.php Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/class/model/write.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8/htdocs/class/model/write.php 2015-06-16 20:44:29 UTC (rev 13090) +++ XoopsCore/branches/2.5.x/2.5.8/htdocs/class/model/write.php 2015-06-16 21:08:34 UTC (rev 13091) @@ -217,7 +217,7 @@ break; case XOBJ_DTYPE_FLOAT: - $cleanv = floatval($cleanv); + $cleanv = (float)($cleanv); break; case XOBJ_DTYPE_DECIMAL: Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/include/functions.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8/htdocs/include/functions.php 2015-06-16 20:44:29 UTC (rev 13090) +++ XoopsCore/branches/2.5.x/2.5.8/htdocs/include/functions.php 2015-06-16 21:08:34 UTC (rev 13091) @@ -392,7 +392,7 @@ $timeoffset = $xoopsConfig['default_TZ']; } } - $usertimestamp = (int)($time) + (floatval($timeoffset) - $xoopsConfig['server_TZ']) * 3600; + $usertimestamp = (int)($time) + ((float)($timeoffset) - $xoopsConfig['server_TZ']) * 3600; return $usertimestamp; } Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/kernel/object.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8/htdocs/kernel/object.php 2015-06-16 20:44:29 UTC (rev 13090) +++ XoopsCore/branches/2.5.x/2.5.8/htdocs/kernel/object.php 2015-06-16 21:08:34 UTC (rev 13091) @@ -768,7 +768,7 @@ $cleanv = !is_string($cleanv) ? (int)($cleanv) : strtotime($cleanv); break; case XOBJ_DTYPE_FLOAT: - $cleanv = floatval($cleanv); + $cleanv = (float)($cleanv); break; case XOBJ_DTYPE_DECIMAL: $cleanv = doubleval($cleanv); Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/class/thumbs/phpthumb.class.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/class/thumbs/phpthumb.class.php 2015-06-16 20:44:29 UTC (rev 13090) +++ XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/class/thumbs/phpthumb.class.php 2015-06-16 21:08:34 UTC (rev 13091) @@ -1866,7 +1866,7 @@ case 'gam': @list($amount) = explode('|', $parameter); - $amount = min(max(floatval($amount), 0.001), 10); + $amount = min(max((float)($amount), 0.001), 10); if (number_format($amount, 3) != '1.000') { if ($this->ImageMagickSwitchAvailable('gamma')) { $commandline .= ' -gamma '.escapeshellarg($amount); @@ -1938,7 +1938,7 @@ @list($band, $method, $threshold) = explode('|', $parameter); $band = ($band ? preg_replace('#[^RGBA\\*]#', '', strtoupper($band)) : '*'); $method = ((strlen($method) > 0) ? (int)($method) : 2); - $threshold = ((strlen($threshold) > 0) ? min(max(floatval($threshold), 0), 100) : 0.1); + $threshold = ((strlen($threshold) > 0) ? min(max((float)($threshold), 0), 100) : 0.1); $band = preg_replace('#[^RGBA\\*]#', '', strtoupper($band)); @@ -1999,7 +1999,7 @@ case 'wb': if ($this->ImageMagickSwitchAvailable(array('channel', 'contrast-stretch'))) { @list($threshold) = explode('|', $parameter); - $threshold = (!empty($threshold) ? min(max(floatval($threshold), 0), 100) : 0.1); + $threshold = (!empty($threshold) ? min(max((float)($threshold), 0), 100) : 0.1); $threshold = preg_replace('#[^0-9\\.]#', '', $threshold); // should be unneccesary, but just to be double-sure //$commandline .= ' -channel R -contrast-stretch '.escapeshellarg($threshold.'%'); // doesn't work on Windows because most versions of PHP do not properly //$commandline .= ' -channel G -contrast-stretch '.escapeshellarg($threshold.'%'); // escape special characters (such as %) and just replace them with spaces @@ -2226,7 +2226,7 @@ $rotate_angle = 0; if ($this->ra) { - $rotate_angle = floatval($this->ra); + $rotate_angle = (float)($this->ra); } else { @@ -2646,7 +2646,7 @@ @list($band, $method, $threshold) = explode('|', $parameter, 3); $band = ($band ? preg_replace('#[^RGBA\\*]#', '', strtoupper($band)) : '*'); $method = ((strlen($method) > 0) ? (int)($method) : 2); - $threshold = ((strlen($threshold) > 0) ? floatval($threshold) : 0.1); + $threshold = ((strlen($threshold) > 0) ? (float)($threshold) : 0.1); $phpthumbFilters->HistogramStretch($this->gdimg_output, $band, $method, $threshold); break; Modified: XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/class/thumbs/phpthumb.filters.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/class/thumbs/phpthumb.filters.php 2015-06-16 20:44:29 UTC (rev 13090) +++ XoopsCore/branches/2.5.x/2.5.8/htdocs/modules/system/class/thumbs/phpthumb.filters.php 2015-06-16 21:08:34 UTC (rev 13091) @@ -561,7 +561,7 @@ // pixel in the image could throw off the whole system. Instead, count up/down // from the limit and allow <threshold> (default = 0.1%) of brightest/darkest // pixels to be clipped to min/max - $threshold = floatval($threshold) / 100; + $threshold = (float)($threshold) / 100; $clip_threshold = ImageSX($gdimg) * ImageSX($gdimg) * $threshold; //if ($min >= 0) { // $range_min = min($min, 255); |