@@ -1120,6 +1120,10 @@ discard block |
||
| 1120 | 1120 | |
| 1121 | 1121 | /* True if the provided path points inside one of open_basedirs (or if open_basedirs are disabled) */ |
| 1122 | 1122 | // http://support.silisoftware.com/phpBB3/viewtopic.php?t=961 |
| 1123 | + |
|
| 1124 | + /** |
|
| 1125 | + * @param string $path |
|
| 1126 | + */ |
|
| 1123 | 1127 | function isInOpenBasedir($path) { |
| 1124 | 1128 | static $open_basedirs = null; |
| 1125 | 1129 | if (is_null($open_basedirs)) { |
@@ -1137,6 +1141,10 @@ discard block |
||
| 1137 | 1141 | |
| 1138 | 1142 | /* Resolves all symlinks in $path, checking that each continuous part ends in an allowed zone. Returns null, if any component leads outside of allowed zone. */ |
| 1139 | 1143 | // http://support.silisoftware.com/phpBB3/viewtopic.php?t=961 |
| 1144 | + |
|
| 1145 | + /** |
|
| 1146 | + * @return string |
|
| 1147 | + */ |
|
| 1140 | 1148 | function resolvePath($path, $allowed_dirs) { |
| 1141 | 1149 | $this->DebugMessage('resolvePath: '.$path.' (allowed_dirs: '.print_r($allowed_dirs, true).')', __FILE__, __LINE__); |
| 1142 | 1150 | |
@@ -4116,6 +4124,9 @@ discard block |
||
| 4116 | 4124 | return $this->ErrorImage(implode("\n", $DebugOutput), 700, 500, true); |
| 4117 | 4125 | } |
| 4118 | 4126 | |
| 4127 | + /** |
|
| 4128 | + * @param string $text |
|
| 4129 | + */ |
|
| 4119 | 4130 | function FatalError($text) { |
| 4120 | 4131 | if (is_null($this->fatalerror)) { |
| 4121 | 4132 | $this->fatalerror = $text; |
@@ -4123,6 +4134,9 @@ discard block |
||
| 4123 | 4134 | return true; |
| 4124 | 4135 | } |
| 4125 | 4136 | |
| 4137 | + /** |
|
| 4138 | + * @param string $text |
|
| 4139 | + */ |
|
| 4126 | 4140 | function ErrorImage($text, $width=0, $height=0, $forcedisplay=false) { |
| 4127 | 4141 | $width = ($width ? $width : $this->config_error_image_width); |
| 4128 | 4142 | $height = ($height ? $height : $this->config_error_image_height); |
@@ -4368,6 +4382,9 @@ discard block |
||
| 4368 | 4382 | return true; |
| 4369 | 4383 | } |
| 4370 | 4384 | |
| 4385 | + /** |
|
| 4386 | + * @param string $message |
|
| 4387 | + */ |
|
| 4371 | 4388 | function DebugTimingMessage($message, $file='', $line='', $timestamp=0) { |
| 4372 | 4389 | if (!$timestamp) { |
| 4373 | 4390 | $timestamp = array_sum(explode(' ', microtime())); |
@@ -17,6 +17,9 @@ discard block |
||
| 17 | 17 | return true; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | + /** |
|
| 21 | + * @param string $message |
|
| 22 | + */ |
|
| 20 | 23 | function DebugMessage($message, $file='', $line='') { |
| 21 | 24 | if (is_object($this->phpThumbObject)) { |
| 22 | 25 | return $this->phpThumbObject->DebugMessage($message, $file, $line); |
@@ -753,6 +756,9 @@ discard block |
||
| 753 | 756 | } |
| 754 | 757 | |
| 755 | 758 | |
| 759 | + /** |
|
| 760 | + * @param phpthumb $phpThumbObject |
|
| 761 | + */ |
|
| 756 | 762 | public static function ImprovedImageRotate(&$gdimg_source, $rotate_angle=0, $config_background_hexcolor='FFFFFF', $bg=null, &$phpThumbObject) { |
| 757 | 763 | while ($rotate_angle < 0) { |
| 758 | 764 | $rotate_angle += 360; |
@@ -1048,6 +1054,10 @@ discard block |
||
| 1048 | 1054 | } |
| 1049 | 1055 | |
| 1050 | 1056 | |
| 1057 | + /** |
|
| 1058 | + * @param boolean $dither |
|
| 1059 | + * @param integer $ncolors |
|
| 1060 | + */ |
|
| 1051 | 1061 | public function ImageTrueColorToPalette2(&$image, $dither, $ncolors) { |
| 1052 | 1062 | // http://www.php.net/manual/en/function.imagetruecolortopalette.php |
| 1053 | 1063 | // zmorris at zsculpt dot com (17-Aug-2004 06:58) |
@@ -23,6 +23,9 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | + /** |
|
| 27 | + * @param string $functionname |
|
| 28 | + */ |
|
| 26 | 29 | static function builtin_function_exists($functionname) { |
| 27 | 30 | if (function_exists('get_defined_functions')) { |
| 28 | 31 | static $get_defined_functions = array(); |
@@ -35,6 +38,10 @@ discard block |
||
| 35 | 38 | } |
| 36 | 39 | |
| 37 | 40 | |
| 41 | + /** |
|
| 42 | + * @param string $version1 |
|
| 43 | + * @param string $version2 |
|
| 44 | + */ |
|
| 38 | 45 | static function version_compare_replacement_sub($version1, $version2, $operator='') { |
| 39 | 46 | // If you specify the third optional operator argument, you can test for a particular relationship. |
| 40 | 47 | // The possible operators are: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne respectively. |
@@ -95,6 +102,9 @@ discard block |
||
| 95 | 102 | } |
| 96 | 103 | |
| 97 | 104 | |
| 105 | + /** |
|
| 106 | + * @param string $version2 |
|
| 107 | + */ |
|
| 98 | 108 | static function version_compare_replacement($version1, $version2, $operator='') { |
| 99 | 109 | if (function_exists('version_compare')) { |
| 100 | 110 | // built into PHP v4.1.0+ |
@@ -212,6 +222,9 @@ discard block |
||
| 212 | 222 | return array($newwidth, $newheight); |
| 213 | 223 | } |
| 214 | 224 | |
| 225 | + /** |
|
| 226 | + * @param string $string |
|
| 227 | + */ |
|
| 215 | 228 | static function HexCharDisplay($string) { |
| 216 | 229 | $len = strlen($string); |
| 217 | 230 | $output = ''; |
@@ -292,6 +305,10 @@ discard block |
||
| 292 | 305 | } |
| 293 | 306 | |
| 294 | 307 | |
| 308 | + /** |
|
| 309 | + * @param integer $width |
|
| 310 | + * @param integer $height |
|
| 311 | + */ |
|
| 295 | 312 | static function ScaleToFitInBox($width, $height, $maxwidth=null, $maxheight=null, $allow_enlarge=true, $allow_reduce=true) { |
| 296 | 313 | $maxwidth = (is_null($maxwidth) ? $width : $maxwidth); |
| 297 | 314 | $maxheight = (is_null($maxheight) ? $height : $maxheight); |
@@ -380,6 +397,12 @@ discard block |
||
| 380 | 397 | } |
| 381 | 398 | |
| 382 | 399 | |
| 400 | + /** |
|
| 401 | + * @param integer $src_x |
|
| 402 | + * @param integer $src_y |
|
| 403 | + * @param integer $src_w |
|
| 404 | + * @param integer $src_h |
|
| 405 | + */ |
|
| 383 | 406 | static function ImageCopyRespectAlpha(&$dst_im, &$src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $opacity_pct=100) { |
| 384 | 407 | $opacipct = $opacity_pct / 100; |
| 385 | 408 | for ($x = $src_x; $x < $src_w; $x++) { |
@@ -404,6 +427,10 @@ discard block |
||
| 404 | 427 | } |
| 405 | 428 | |
| 406 | 429 | |
| 430 | + /** |
|
| 431 | + * @param integer $old_width |
|
| 432 | + * @param integer $old_height |
|
| 433 | + */ |
|
| 407 | 434 | static function ProportionalResize($old_width, $old_height, $new_width=false, $new_height=false) { |
| 408 | 435 | $old_aspect_ratio = $old_width / $old_height; |
| 409 | 436 | if (($new_width === false) && ($new_height === false)) { |
@@ -427,6 +454,9 @@ discard block |
||
| 427 | 454 | } |
| 428 | 455 | |
| 429 | 456 | |
| 457 | + /** |
|
| 458 | + * @param string $function |
|
| 459 | + */ |
|
| 430 | 460 | static function FunctionIsDisabled($function) { |
| 431 | 461 | static $DisabledFunctions = null; |
| 432 | 462 | if (is_null($DisabledFunctions)) { |
@@ -447,6 +477,11 @@ discard block |
||
| 447 | 477 | } |
| 448 | 478 | |
| 449 | 479 | |
| 480 | + /** |
|
| 481 | + * @param string $command |
|
| 482 | + * |
|
| 483 | + * @return string |
|
| 484 | + */ |
|
| 450 | 485 | static function SafeExec($command) { |
| 451 | 486 | static $AllowedExecFunctions = array(); |
| 452 | 487 | if (empty($AllowedExecFunctions)) { |
@@ -603,6 +638,9 @@ discard block |
||
| 603 | 638 | } |
| 604 | 639 | |
| 605 | 640 | |
| 641 | + /** |
|
| 642 | + * @param integer $number |
|
| 643 | + */ |
|
| 606 | 644 | static function LittleEndian2String($number, $minbytes=1) { |
| 607 | 645 | $intstring = ''; |
| 608 | 646 | while ($number > 0) { |
@@ -623,6 +661,10 @@ discard block |
||
| 623 | 661 | return false; |
| 624 | 662 | } |
| 625 | 663 | |
| 664 | + /** |
|
| 665 | + * @param string $needle |
|
| 666 | + * @param string[] $haystack |
|
| 667 | + */ |
|
| 626 | 668 | static function CaseInsensitiveInArray($needle, $haystack) { |
| 627 | 669 | $needle = strtolower($needle); |
| 628 | 670 | foreach ($haystack as $key => $value) { |
@@ -635,6 +677,9 @@ discard block |
||
| 635 | 677 | return false; |
| 636 | 678 | } |
| 637 | 679 | |
| 680 | + /** |
|
| 681 | + * @param string $file |
|
| 682 | + */ |
|
| 638 | 683 | static function URLreadFsock($host, $file, &$errstr, $successonly=true, $port=80, $timeout=10) { |
| 639 | 684 | if (!function_exists('fsockopen') || phpthumb_functions::FunctionIsDisabled('fsockopen')) { |
| 640 | 685 | $errstr = 'fsockopen() unavailable'; |
@@ -64,6 +64,9 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
| 66 | 66 | |
| 67 | +/** |
|
| 68 | + * @param string $lpszFileName |
|
| 69 | + */ |
|
| 67 | 70 | function gif_outputAsBmp($gif, $lpszFileName, $bgColor = -1) |
| 68 | 71 | { |
| 69 | 72 | if (!isSet($gif) || (@get_class($gif) <> 'cgif') || !$gif->loaded() || ($lpszFileName == '')) { |
@@ -186,6 +189,10 @@ discard block |
||
| 186 | 189 | |
| 187 | 190 | /////////////////////////////////////////////////////////////////////////// |
| 188 | 191 | |
| 192 | + /** |
|
| 193 | + * @param string $data |
|
| 194 | + * @param integer $datLen |
|
| 195 | + */ |
|
| 189 | 196 | function deCompress($data, &$datLen) |
| 190 | 197 | { |
| 191 | 198 | $stLen = strlen($data); |
@@ -210,6 +217,11 @@ discard block |
||
| 210 | 217 | |
| 211 | 218 | /////////////////////////////////////////////////////////////////////////// |
| 212 | 219 | |
| 220 | + /** |
|
| 221 | + * @param boolean $bInit |
|
| 222 | + * |
|
| 223 | + * @return integer |
|
| 224 | + */ |
|
| 213 | 225 | function LZWCommand(&$data, $bInit) |
| 214 | 226 | { |
| 215 | 227 | if ($bInit) { |
@@ -392,6 +404,10 @@ discard block |
||
| 392 | 404 | |
| 393 | 405 | /////////////////////////////////////////////////////////////////////////// |
| 394 | 406 | |
| 407 | + /** |
|
| 408 | + * @param string $lpData |
|
| 409 | + * @param integer $num |
|
| 410 | + */ |
|
| 395 | 411 | function load($lpData, $num) |
| 396 | 412 | { |
| 397 | 413 | $this->m_nColors = 0; |
@@ -503,6 +519,9 @@ discard block |
||
| 503 | 519 | |
| 504 | 520 | /////////////////////////////////////////////////////////////////////////// |
| 505 | 521 | |
| 522 | + /** |
|
| 523 | + * @param integer $hdrLen |
|
| 524 | + */ |
|
| 506 | 525 | function load($lpData, &$hdrLen) |
| 507 | 526 | { |
| 508 | 527 | $hdrLen = 0; |
@@ -540,6 +559,9 @@ discard block |
||
| 540 | 559 | |
| 541 | 560 | /////////////////////////////////////////////////////////////////////////// |
| 542 | 561 | |
| 562 | + /** |
|
| 563 | + * @param string $str |
|
| 564 | + */ |
|
| 543 | 565 | function w2i($str) |
| 544 | 566 | { |
| 545 | 567 | return ord(substr($str, 0, 1)) + (ord(substr($str, 1, 1)) << 8); |
@@ -578,6 +600,10 @@ discard block |
||
| 578 | 600 | |
| 579 | 601 | /////////////////////////////////////////////////////////////////////////// |
| 580 | 602 | |
| 603 | + /** |
|
| 604 | + * @param string $lpData |
|
| 605 | + * @param integer $hdrLen |
|
| 606 | + */ |
|
| 581 | 607 | function load($lpData, &$hdrLen) |
| 582 | 608 | { |
| 583 | 609 | $hdrLen = 0; |
@@ -611,6 +637,9 @@ discard block |
||
| 611 | 637 | |
| 612 | 638 | /////////////////////////////////////////////////////////////////////////// |
| 613 | 639 | |
| 640 | + /** |
|
| 641 | + * @param string $str |
|
| 642 | + */ |
|
| 614 | 643 | function w2i($str) |
| 615 | 644 | { |
| 616 | 645 | return ord(substr($str, 0, 1)) + (ord(substr($str, 1, 1)) << 8); |
@@ -648,6 +677,10 @@ discard block |
||
| 648 | 677 | |
| 649 | 678 | /////////////////////////////////////////////////////////////////////////// |
| 650 | 679 | |
| 680 | + /** |
|
| 681 | + * @param string $data |
|
| 682 | + * @param integer $datLen |
|
| 683 | + */ |
|
| 651 | 684 | function load($data, &$datLen) |
| 652 | 685 | { |
| 653 | 686 | $datLen = 0; |
@@ -695,6 +728,10 @@ discard block |
||
| 695 | 728 | |
| 696 | 729 | /////////////////////////////////////////////////////////////////////////// |
| 697 | 730 | |
| 731 | + /** |
|
| 732 | + * @param string $data |
|
| 733 | + * @param integer $extLen |
|
| 734 | + */ |
|
| 698 | 735 | function skipExt(&$data, &$extLen) |
| 699 | 736 | { |
| 700 | 737 | $extLen = 0; |
@@ -740,6 +777,9 @@ discard block |
||
| 740 | 777 | |
| 741 | 778 | /////////////////////////////////////////////////////////////////////////// |
| 742 | 779 | |
| 780 | + /** |
|
| 781 | + * @param string $str |
|
| 782 | + */ |
|
| 743 | 783 | function w2i($str) |
| 744 | 784 | { |
| 745 | 785 | return ord(substr($str, 0, 1)) + (ord(substr($str, 1, 1)) << 8); |
@@ -811,6 +851,9 @@ discard block |
||
| 811 | 851 | |
| 812 | 852 | /////////////////////////////////////////////////////////////////////////// |
| 813 | 853 | |
| 854 | + /** |
|
| 855 | + * @param integer $iIndex |
|
| 856 | + */ |
|
| 814 | 857 | function loadFile($lpszFileName, $iIndex) |
| 815 | 858 | { |
| 816 | 859 | if ($iIndex < 0) { |
@@ -963,6 +1006,9 @@ discard block |
||
| 963 | 1006 | |
| 964 | 1007 | /////////////////////////////////////////////////////////////////////////// |
| 965 | 1008 | |
| 1009 | + /** |
|
| 1010 | + * @param integer $bgColor |
|
| 1011 | + */ |
|
| 966 | 1012 | function getPng($bgColor) |
| 967 | 1013 | { |
| 968 | 1014 | $out = ''; |
@@ -115,7 +115,7 @@ |
||
| 115 | 115 | class systemuserrankHandler extends XoopsPersistableObjectHandler |
| 116 | 116 | { |
| 117 | 117 | /** |
| 118 | - * @param null|XoopsDatabase $db |
|
| 118 | + * @param XoopsDatabase $db |
|
| 119 | 119 | */ |
| 120 | 120 | public function __construct(XoopsDatabase $db) |
| 121 | 121 | { |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * |
| 20 | 20 | * Comment by Taiwen Jiang (a.k.a. phppp): THE METHOD IS NOT COMPLETE AND NOT SAFE. YOU ARE ENCOURAGED TO USE PHP'S NATIVE FILTER_VAR OR FILTER_INPUT FUNCTIONS DIRECTLY BEFORE WE MIGRATE TO XOOPS 3. |
| 21 | 21 | * @param $global |
| 22 | - * @param $key |
|
| 22 | + * @param string $key |
|
| 23 | 23 | * @param string $default |
| 24 | 24 | * @param string $type |
| 25 | 25 | * @return int|mixed|string |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | - * @param $img |
|
| 107 | + * @param string $img |
|
| 108 | 108 | * |
| 109 | 109 | * @return mixed |
| 110 | 110 | */ |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | // irmtfan bug fix: solve templates duplicate issue |
| 57 | 57 | /** |
| 58 | - * @param $module |
|
| 58 | + * @param XoopsModule $module |
|
| 59 | 59 | * |
| 60 | 60 | * @return bool |
| 61 | 61 | */ |
@@ -147,7 +147,7 @@ |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
| 150 | - * @param $content |
|
| 150 | + * @param string $content |
|
| 151 | 151 | * |
| 152 | 152 | * @return bool |
| 153 | 153 | */ |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | * @param $pass |
| 45 | 45 | * @param $vpass |
| 46 | 46 | * |
| 47 | - * @return bool|string |
|
| 47 | + * @return false|string |
|
| 48 | 48 | */ |
| 49 | 49 | function userCheck($uname, $email, $pass, $vpass) |
| 50 | 50 | { |