@@ -325,7 +325,7 @@ |
||
| 325 | 325 | * Validates a IPv6 address. returns true if it is ipv6. |
| 326 | 326 | * |
| 327 | 327 | * @param string $ip The ip address to be validated |
| 328 | - * @return boolean Whether the specified IP is a valid IPv6 address |
|
| 328 | + * @return false|string Whether the specified IP is a valid IPv6 address |
|
| 329 | 329 | */ |
| 330 | 330 | function isValidIPv6($ip) |
| 331 | 331 | { |
@@ -426,8 +426,8 @@ |
||
| 426 | 426 | */ |
| 427 | 427 | function matchIPtoCIDR($ip_address, $cidr_address) |
| 428 | 428 | { |
| 429 | - list ($cidr_network, $cidr_subnetmask) = preg_split('/', $cidr_address); |
|
| 430 | - return (ip2long($ip_address) & (~((1 << (32 - $cidr_subnetmask)) - 1))) == ip2long($cidr_network); |
|
| 429 | + list ($cidr_network, $cidr_subnetmask) = preg_split('/', $cidr_address); |
|
| 430 | + return (ip2long($ip_address) & (~((1 << (32 - $cidr_subnetmask)) - 1))) == ip2long($cidr_network); |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | /** |
@@ -807,7 +807,7 @@ |
||
| 807 | 807 | /** |
| 808 | 808 | * Send a group of emails from the mail queue. |
| 809 | 809 | * |
| 810 | - * @param bool|int $number The number to send each loop through or false to use the standard limits |
|
| 810 | + * @param integer $number The number to send each loop through or false to use the standard limits |
|
| 811 | 811 | * @param bool $override_limit Whether to bypass the limit |
| 812 | 812 | * @param bool $force_send Whether to forcibly send the messages now (useful when using cron jobs) |
| 813 | 813 | * @return bool Whether things were sent |
@@ -457,7 +457,6 @@ discard block |
||
| 457 | 457 | |
| 458 | 458 | /** |
| 459 | 459 | * affected_rows |
| 460 | - * @param resource $connection |
|
| 461 | 460 | */ |
| 462 | 461 | function smf_db_affected_rows($result = null) |
| 463 | 462 | { |
@@ -800,7 +799,7 @@ discard block |
||
| 800 | 799 | * |
| 801 | 800 | * @param string $db_name The database name |
| 802 | 801 | * @param resource $db_connection The database connection |
| 803 | - * @return true Always returns true |
|
| 802 | + * @return boolean Always returns true |
|
| 804 | 803 | */ |
| 805 | 804 | function smf_db_select_db($db_name, $db_connection) |
| 806 | 805 | { |
@@ -5370,7 +5370,6 @@ discard block |
||
| 5370 | 5370 | |
| 5371 | 5371 | /** |
| 5372 | 5372 | * Tries different modes to make file/dirs writable. Wrapper function for chmod() |
| 5373 | - |
|
| 5374 | 5373 | * @param string $file The file/dir full path. |
| 5375 | 5374 | * @param int $value Not needed, added for legacy reasons. |
| 5376 | 5375 | * @return boolean true if the file/dir is already writable or the function was able to make it writable, false if the function couldn't make the file/dir writable. |
@@ -5410,7 +5409,6 @@ discard block |
||
| 5410 | 5409 | |
| 5411 | 5410 | /** |
| 5412 | 5411 | * Wrapper function for json_decode() with error handling. |
| 5413 | - |
|
| 5414 | 5412 | * @param string $json The string to decode. |
| 5415 | 5413 | * @param bool $returnAsArray To return the decoded string as an array or an object, SMF only uses Arrays but to keep on compatibility with json_decode its set to false as default. |
| 5416 | 5414 | * @param bool $logIt To specify if the error will be logged if theres any. |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | * - caches the formatting data from the setting for optimization. |
| 677 | 677 | * |
| 678 | 678 | * @param float $number A number |
| 679 | - * @param bool|int $override_decimal_count If set, will use the specified number of decimal places. Otherwise it's automatically determined |
|
| 679 | + * @param integer $override_decimal_count If set, will use the specified number of decimal places. Otherwise it's automatically determined |
|
| 680 | 680 | * @return string A formatted number |
| 681 | 681 | */ |
| 682 | 682 | function comma_format($number, $override_decimal_count = false) |
@@ -5527,7 +5527,7 @@ discard block |
||
| 5527 | 5527 | * It assumes the data is already a string. |
| 5528 | 5528 | * @param string $data The data to print |
| 5529 | 5529 | * @param string $type The content type. Defaults to Json. |
| 5530 | - * @return void |
|
| 5530 | + * @return false|null |
|
| 5531 | 5531 | */ |
| 5532 | 5532 | function smf_serverResponse($data = '', $type = 'Content-Type: application/json') |
| 5533 | 5533 | { |
@@ -393,6 +393,9 @@ discard block |
||
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | // Used to direct the user to another location. |
| 396 | +/** |
|
| 397 | + * @param string $location |
|
| 398 | + */ |
|
| 396 | 399 | function redirectLocation($location, $addForm = true) |
| 397 | 400 | { |
| 398 | 401 | global $upgradeurl, $upcontext, $command_line; |
@@ -1573,6 +1576,9 @@ discard block |
||
| 1573 | 1576 | return addslashes(preg_replace(array('~^\.([/\\\]|$)~', '~[/]+~', '~[\\\]+~', '~[/\\\]$~'), array($install_path . '$1', '/', '\\', ''), $path)); |
| 1574 | 1577 | } |
| 1575 | 1578 | |
| 1579 | +/** |
|
| 1580 | + * @param string $filename |
|
| 1581 | + */ |
|
| 1576 | 1582 | function parse_sql($filename) |
| 1577 | 1583 | { |
| 1578 | 1584 | global $db_prefix, $db_collation, $boarddir, $boardurl, $command_line, $file_steps, $step_progress, $custom_warning; |
@@ -1607,6 +1613,10 @@ discard block |
||
| 1607 | 1613 | |
| 1608 | 1614 | // Our custom error handler - does nothing but does stop public errors from XML! |
| 1609 | 1615 | set_error_handler( |
| 1616 | + |
|
| 1617 | + /** |
|
| 1618 | + * @param string $errno |
|
| 1619 | + */ |
|
| 1610 | 1620 | function ($errno, $errstr, $errfile, $errline) use ($support_js) |
| 1611 | 1621 | { |
| 1612 | 1622 | if ($support_js) |
@@ -1853,6 +1863,9 @@ discard block |
||
| 1853 | 1863 | return true; |
| 1854 | 1864 | } |
| 1855 | 1865 | |
| 1866 | +/** |
|
| 1867 | + * @param string $string |
|
| 1868 | + */ |
|
| 1856 | 1869 | function upgrade_query($string, $unbuffered = false) |
| 1857 | 1870 | { |
| 1858 | 1871 | global $db_connection, $db_server, $db_user, $db_passwd, $db_type, $command_line, $upcontext, $upgradeurl, $modSettings; |
@@ -4512,7 +4525,7 @@ discard block |
||
| 4512 | 4525 | * @param int $setSize The amount of entries after which to update the database. |
| 4513 | 4526 | * |
| 4514 | 4527 | * newCol needs to be a varbinary(16) null able field |
| 4515 | - * @return bool |
|
| 4528 | + * @return boolean|null |
|
| 4516 | 4529 | */ |
| 4517 | 4530 | function MySQLConvertOldIp($targetTable, $oldCol, $newCol, $limit = 50000, $setSize = 100) |
| 4518 | 4531 | { |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | |
| 83 | 83 | // The helper is crucial. Include it first thing. |
| 84 | 84 | if (!file_exists($upgrade_path . '/upgrade-helper.php')) |
| 85 | - die('upgrade-helper.php not found where it was expected: ' . $upgrade_path . '/upgrade-helper.php! Make sure you have uploaded ALL files from the upgrade package. The upgrader cannot continue.'); |
|
| 85 | + die('upgrade-helper.php not found where it was expected: ' . $upgrade_path . '/upgrade-helper.php! Make sure you have uploaded ALL files from the upgrade package. The upgrader cannot continue.'); |
|
| 86 | 86 | |
| 87 | 87 | require_once($upgrade_path . '/upgrade-helper.php'); |
| 88 | 88 | |