@@ -207,6 +207,9 @@ discard block |
||
| 207 | 207 | // MD5 Encryption. |
| 208 | 208 | if (!function_exists('md5_hmac')) |
| 209 | 209 | { |
| 210 | + /** |
|
| 211 | + * @param string $key |
|
| 212 | + */ |
|
| 210 | 213 | function md5_hmac($data, $key) |
| 211 | 214 | { |
| 212 | 215 | if (strlen($key) > 64) |
@@ -441,6 +444,9 @@ discard block |
||
| 441 | 444 | } |
| 442 | 445 | |
| 443 | 446 | // Used to direct the user to another location. |
| 447 | +/** |
|
| 448 | + * @param string $location |
|
| 449 | + */ |
|
| 444 | 450 | function redirectLocation($location, $addForm = true) |
| 445 | 451 | { |
| 446 | 452 | global $upgradeurl, $upcontext, $command_line; |
@@ -2127,6 +2133,9 @@ discard block |
||
| 2127 | 2133 | return addslashes(preg_replace(array('~^\.([/\\\]|$)~', '~[/]+~', '~[\\\]+~', '~[/\\\]$~'), array($install_path . '$1', '/', '\\', ''), $path)); |
| 2128 | 2134 | } |
| 2129 | 2135 | |
| 2136 | +/** |
|
| 2137 | + * @param string $filename |
|
| 2138 | + */ |
|
| 2130 | 2139 | function parse_sql($filename) |
| 2131 | 2140 | { |
| 2132 | 2141 | global $db_prefix, $db_collation, $boarddir, $boardurl, $command_line, $file_steps, $step_progress, $custom_warning; |
@@ -2413,6 +2422,9 @@ discard block |
||
| 2413 | 2422 | return true; |
| 2414 | 2423 | } |
| 2415 | 2424 | |
| 2425 | +/** |
|
| 2426 | + * @param string $string |
|
| 2427 | + */ |
|
| 2416 | 2428 | function upgrade_query($string, $unbuffered = false) |
| 2417 | 2429 | { |
| 2418 | 2430 | global $db_connection, $db_server, $db_user, $db_passwd, $db_type, $command_line, $upcontext, $upgradeurl, $modSettings; |
@@ -3042,6 +3054,9 @@ discard block |
||
| 3042 | 3054 | $upcontext['current_step'] = 1; |
| 3043 | 3055 | } |
| 3044 | 3056 | |
| 3057 | +/** |
|
| 3058 | + * @param string $message |
|
| 3059 | + */ |
|
| 3045 | 3060 | function print_error($message, $fatal = false) |
| 3046 | 3061 | { |
| 3047 | 3062 | static $fp = null; |
@@ -3055,6 +3070,9 @@ discard block |
||
| 3055 | 3070 | exit; |
| 3056 | 3071 | } |
| 3057 | 3072 | |
| 3073 | +/** |
|
| 3074 | + * @param string $message |
|
| 3075 | + */ |
|
| 3058 | 3076 | function throw_error($message) |
| 3059 | 3077 | { |
| 3060 | 3078 | global $upcontext; |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | * of elements, an array of xmlArray's is returned for use with foreach. |
| 258 | 258 | * Example use: |
| 259 | 259 | * foreach ($xml->set('html/body/p') as $p) |
| 260 | - * @param $path string The path to search for. |
|
| 260 | + * @param string $path string The path to search for. |
|
| 261 | 261 | * @return array An array of xmlArray objects |
| 262 | 262 | */ |
| 263 | 263 | public function set($path) |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | * Changes a files atrributes (chmod) |
| 856 | 856 | * |
| 857 | 857 | * @param string $ftp_file The file to CHMOD |
| 858 | - * @param int|string $chmod The value for the CHMOD operation |
|
| 858 | + * @param integer $chmod The value for the CHMOD operation |
|
| 859 | 859 | * @return boolean Whether or not the operation was successful |
| 860 | 860 | */ |
| 861 | 861 | public function chmod($ftp_file, $chmod) |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | * |
| 1026 | 1026 | * @param string $ftp_path The path to the directory |
| 1027 | 1027 | * @param bool $search Whether or not to get a recursive directory listing |
| 1028 | - * @return string|boolean The results of the command or false if unsuccessful |
|
| 1028 | + * @return false|string The results of the command or false if unsuccessful |
|
| 1029 | 1029 | */ |
| 1030 | 1030 | public function list_dir($ftp_path = '', $search = false) |
| 1031 | 1031 | { |
@@ -1070,7 +1070,7 @@ discard block |
||
| 1070 | 1070 | * |
| 1071 | 1071 | * @param string $file The name of a file |
| 1072 | 1072 | * @param string $listing A directory listing or null to generate one |
| 1073 | - * @return string|boolean The name of the file or false if it wasn't found |
|
| 1073 | + * @return string|false The name of the file or false if it wasn't found |
|
| 1074 | 1074 | */ |
| 1075 | 1075 | public function locate($file, $listing = null) |
| 1076 | 1076 | { |
@@ -793,7 +793,7 @@ discard block |
||
| 793 | 793 | if (!$this->connection) |
| 794 | 794 | { |
| 795 | 795 | $this->error = 'bad_server'; |
| 796 | - $this->last_message = 'Invalid Server'; |
|
| 796 | + $this->last_message = 'Invalid Server'; |
|
| 797 | 797 | return; |
| 798 | 798 | } |
| 799 | 799 | |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | if (!$this->check_response(220)) |
| 802 | 802 | { |
| 803 | 803 | $this->error = 'bad_response'; |
| 804 | - $this->last_message = 'Bad Response'; |
|
| 804 | + $this->last_message = 'Bad Response'; |
|
| 805 | 805 | return; |
| 806 | 806 | } |
| 807 | 807 | |
@@ -2225,9 +2225,9 @@ discard block |
||
| 2225 | 2225 | * |
| 2226 | 2226 | * @uses the template_include() function to include the file. |
| 2227 | 2227 | * @param string $template_name The name of the template to load |
| 2228 | - * @param array|string $style_sheets The name of a single stylesheet or an array of names of stylesheets to load |
|
| 2228 | + * @param string $style_sheets The name of a single stylesheet or an array of names of stylesheets to load |
|
| 2229 | 2229 | * @param bool $fatal If true, dies with an error message if the template cannot be found |
| 2230 | - * @return boolean Whether or not the template was loaded |
|
| 2230 | + * @return boolean|null Whether or not the template was loaded |
|
| 2231 | 2231 | */ |
| 2232 | 2232 | function loadTemplate($template_name, $style_sheets = array(), $fatal = true) |
| 2233 | 2233 | { |
@@ -2411,7 +2411,7 @@ discard block |
||
| 2411 | 2411 | * - all code added with this function is added to the same <style> tag so do make sure your css is valid! |
| 2412 | 2412 | * |
| 2413 | 2413 | * @param string $css Some css code |
| 2414 | - * @return void|bool Adds the CSS to the $context['css_header'] array or returns if no CSS is specified |
|
| 2414 | + * @return false|null Adds the CSS to the $context['css_header'] array or returns if no CSS is specified |
|
| 2415 | 2415 | */ |
| 2416 | 2416 | function addInlineCss($css) |
| 2417 | 2417 | { |
@@ -2427,7 +2427,7 @@ discard block |
||
| 2427 | 2427 | /** |
| 2428 | 2428 | * Add a Javascript file for output later |
| 2429 | 2429 | |
| 2430 | - * @param string $filename The name of the file to load |
|
| 2430 | + * @param string $fileName The name of the file to load |
|
| 2431 | 2431 | * @param array $params An array of parameter info |
| 2432 | 2432 | * Keys are the following: |
| 2433 | 2433 | * - ['external'] (true/false): define if the file is a externally located file. Needs to be set to true if you are loading an external file |
@@ -2525,7 +2525,7 @@ discard block |
||
| 2525 | 2525 | * |
| 2526 | 2526 | * @param string $javascript Some JS code |
| 2527 | 2527 | * @param bool $defer Whether the script should load in <head> or before the closing <html> tag |
| 2528 | - * @return void|bool Adds the code to one of the $context['javascript_inline'] arrays or returns if no JS was specified |
|
| 2528 | + * @return false|null Adds the code to one of the $context['javascript_inline'] arrays or returns if no JS was specified |
|
| 2529 | 2529 | */ |
| 2530 | 2530 | function addInlineJavaScript($javascript, $defer = false) |
| 2531 | 2531 | { |
@@ -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) |
@@ -5015,7 +5015,7 @@ discard block |
||
| 5015 | 5015 | |
| 5016 | 5016 | /** |
| 5017 | 5017 | * @param string $ip_address An IP address in IPv4, IPv6 or decimal notation |
| 5018 | - * @return binary The IP address in binary or false |
|
| 5018 | + * @return string The IP address in binary or false |
|
| 5019 | 5019 | */ |
| 5020 | 5020 | function inet_ptod($ip_address) |
| 5021 | 5021 | { |
@@ -5413,7 +5413,7 @@ discard block |
||
| 5413 | 5413 | * It assumes the data is already a string. |
| 5414 | 5414 | * @param string $data The data to print |
| 5415 | 5415 | * @param string $type The content type. Defaults to Json. |
| 5416 | - * @return void |
|
| 5416 | + * @return false|null |
|
| 5417 | 5417 | */ |
| 5418 | 5418 | function smf_serverResponse($data = '', $type = 'Content-Type: application/json') |
| 5419 | 5419 | { |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | - * Determine if the browser is Opera or not |
|
| 105 | - * @return boolean Whether or not this is Opera |
|
| 106 | - */ |
|
| 104 | + * Determine if the browser is Opera or not |
|
| 105 | + * @return boolean Whether or not this is Opera |
|
| 106 | + */ |
|
| 107 | 107 | function isOpera() |
| 108 | 108 | { |
| 109 | 109 | if (!isset($this->_browsers['is_opera'])) |
@@ -112,9 +112,9 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | - * Determine if the browser is IE or not |
|
| 116 | - * @return boolean true Whether or not the browser is IE |
|
| 117 | - */ |
|
| 115 | + * Determine if the browser is IE or not |
|
| 116 | + * @return boolean true Whether or not the browser is IE |
|
| 117 | + */ |
|
| 118 | 118 | function isIe() |
| 119 | 119 | { |
| 120 | 120 | // I'm IE, Yes I'm the real IE; All you other IEs are just imitating. |
@@ -124,9 +124,9 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
| 127 | - * Determine if the browser is IE11 or not |
|
| 128 | - * @return boolean Whether or not the browser is IE11 |
|
| 129 | - */ |
|
| 127 | + * Determine if the browser is IE11 or not |
|
| 128 | + * @return boolean Whether or not the browser is IE11 |
|
| 129 | + */ |
|
| 130 | 130 | function isIe11() |
| 131 | 131 | { |
| 132 | 132 | // IE11 is a bit different than earlier versions |
@@ -137,9 +137,9 @@ discard block |
||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
| 140 | - * Determine if the browser is Edge or not |
|
| 141 | - * @return boolean Whether or not the browser is Edge |
|
| 142 | - */ |
|
| 140 | + * Determine if the browser is Edge or not |
|
| 141 | + * @return boolean Whether or not the browser is Edge |
|
| 142 | + */ |
|
| 143 | 143 | function isEdge() |
| 144 | 144 | { |
| 145 | 145 | if (!isset($this->_browsers['is_edge'])) |
@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
| 151 | - * Determine if the browser is a Webkit based one or not |
|
| 152 | - * @return boolean Whether or not this is a Webkit-based browser |
|
| 153 | - */ |
|
| 151 | + * Determine if the browser is a Webkit based one or not |
|
| 152 | + * @return boolean Whether or not this is a Webkit-based browser |
|
| 153 | + */ |
|
| 154 | 154 | function isWebkit() |
| 155 | 155 | { |
| 156 | 156 | if (!isset($this->_browsers['is_webkit'])) |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | - * Determine if the browser is Firefox or one of its variants |
|
| 163 | - * @return boolean Whether or not this is Firefox (or one of its variants) |
|
| 164 | - */ |
|
| 162 | + * Determine if the browser is Firefox or one of its variants |
|
| 163 | + * @return boolean Whether or not this is Firefox (or one of its variants) |
|
| 164 | + */ |
|
| 165 | 165 | function isFirefox() |
| 166 | 166 | { |
| 167 | 167 | if (!isset($this->_browsers['is_firefox'])) |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
| 173 | - * Determine if the browser is WebTv or not |
|
| 174 | - * @return boolean Whether or not this is WebTV |
|
| 175 | - */ |
|
| 173 | + * Determine if the browser is WebTv or not |
|
| 174 | + * @return boolean Whether or not this is WebTV |
|
| 175 | + */ |
|
| 176 | 176 | function isWebTv() |
| 177 | 177 | { |
| 178 | 178 | if (!isset($this->_browsers['is_web_tv'])) |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
| 184 | - * Determine if the browser is konqueror or not |
|
| 185 | - * @return boolean Whether or not this is Konqueror |
|
| 186 | - */ |
|
| 184 | + * Determine if the browser is konqueror or not |
|
| 185 | + * @return boolean Whether or not this is Konqueror |
|
| 186 | + */ |
|
| 187 | 187 | function isKonqueror() |
| 188 | 188 | { |
| 189 | 189 | if (!isset($this->_browsers['is_konqueror'])) |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
| 195 | - * Determine if the browser is Gecko or not |
|
| 196 | - * @return boolean Whether or not this is a Gecko-based browser |
|
| 197 | - */ |
|
| 195 | + * Determine if the browser is Gecko or not |
|
| 196 | + * @return boolean Whether or not this is a Gecko-based browser |
|
| 197 | + */ |
|
| 198 | 198 | function isGecko() |
| 199 | 199 | { |
| 200 | 200 | if (!isset($this->_browsers['is_gecko'])) |
@@ -203,9 +203,9 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /** |
| 206 | - * Determine if the browser is Opera Mini or not |
|
| 207 | - * @return boolean Whether or not this is Opera Mini |
|
| 208 | - */ |
|
| 206 | + * Determine if the browser is Opera Mini or not |
|
| 207 | + * @return boolean Whether or not this is Opera Mini |
|
| 208 | + */ |
|
| 209 | 209 | function isOperaMini() |
| 210 | 210 | { |
| 211 | 211 | if (!isset($this->_browsers['is_opera_mini'])) |
@@ -216,9 +216,9 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
| 219 | - * Determine if the browser is Opera Mobile or not |
|
| 220 | - * @return boolean Whether or not this is Opera Mobile |
|
| 221 | - */ |
|
| 219 | + * Determine if the browser is Opera Mobile or not |
|
| 220 | + * @return boolean Whether or not this is Opera Mobile |
|
| 221 | + */ |
|
| 222 | 222 | function isOperaMobi() |
| 223 | 223 | { |
| 224 | 224 | if (!isset($this->_browsers['is_opera_mobi'])) |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | ) |
| 785 | 785 | ); |
| 786 | 786 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 787 | - $error_ips[] = inet_dtop($row['ip']); |
|
| 787 | + $error_ips[] = inet_dtop($row['ip']); |
|
| 788 | 788 | $smcFunc['db_free_result']($request); |
| 789 | 789 | |
| 790 | 790 | return $error_ips; |
@@ -2168,9 +2168,9 @@ discard block |
||
| 2168 | 2168 | |
| 2169 | 2169 | if ($low == '255.255.255.255') return 'unknown'; |
| 2170 | 2170 | if ($low == $high) |
| 2171 | - return $low; |
|
| 2171 | + return $low; |
|
| 2172 | 2172 | else |
| 2173 | - return $low . '-'.$high; |
|
| 2173 | + return $low . '-'.$high; |
|
| 2174 | 2174 | } |
| 2175 | 2175 | |
| 2176 | 2176 | /** |