@@ -104,7 +104,7 @@ |
||
| 104 | 104 | * |
| 105 | 105 | * @param string $class The fully-qualified class name. |
| 106 | 106 | */ |
| 107 | -spl_autoload_register(function ($class) use ($sourcedir) |
|
| 107 | +spl_autoload_register(function($class) use ($sourcedir) |
|
| 108 | 108 | { |
| 109 | 109 | $classMap = array( |
| 110 | 110 | 'ReCaptcha\\' => 'ReCaptcha/', |
@@ -94,12 +94,12 @@ discard block |
||
| 94 | 94 | public $headers; |
| 95 | 95 | |
| 96 | 96 | /** |
| 97 | - * Start the curl object |
|
| 98 | - * - allow for user override values |
|
| 99 | - * |
|
| 100 | - * @param array $options An array of cURL options |
|
| 101 | - * @param int $max_redirect Maximum number of redirects |
|
| 102 | - */ |
|
| 97 | + * Start the curl object |
|
| 98 | + * - allow for user override values |
|
| 99 | + * |
|
| 100 | + * @param array $options An array of cURL options |
|
| 101 | + * @param int $max_redirect Maximum number of redirects |
|
| 102 | + */ |
|
| 103 | 103 | public function __construct($options = array(), $max_redirect = 3) |
| 104 | 104 | { |
| 105 | 105 | // Initialize class variables |
@@ -108,16 +108,16 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | - * Main calling function, |
|
| 112 | - * - will request the page data from a given $url |
|
| 113 | - * - optionally will post data to the page form if post data is supplied |
|
| 114 | - * - passed arrays will be converted to a post string joined with &'s |
|
| 115 | - * - calls set_options to set the curl opts array values based on the defaults and user input |
|
| 116 | - * |
|
| 117 | - * @param string $url the site we are going to fetch |
|
| 118 | - * @param array $post_data any post data as form name => value |
|
| 119 | - * @return object An instance of the curl_fetch_web_data class |
|
| 120 | - */ |
|
| 111 | + * Main calling function, |
|
| 112 | + * - will request the page data from a given $url |
|
| 113 | + * - optionally will post data to the page form if post data is supplied |
|
| 114 | + * - passed arrays will be converted to a post string joined with &'s |
|
| 115 | + * - calls set_options to set the curl opts array values based on the defaults and user input |
|
| 116 | + * |
|
| 117 | + * @param string $url the site we are going to fetch |
|
| 118 | + * @param array $post_data any post data as form name => value |
|
| 119 | + * @return object An instance of the curl_fetch_web_data class |
|
| 120 | + */ |
|
| 121 | 121 | public function get_url_data($url, $post_data = array()) |
| 122 | 122 | { |
| 123 | 123 | // POSTing some data perhaps? |
@@ -134,14 +134,14 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | - * Makes the actual cURL call |
|
| 138 | - * - stores responses (url, code, error, headers, body) in the response array |
|
| 139 | - * - detects 301, 302, 307 codes and will redirect to the given response header location |
|
| 140 | - * |
|
| 141 | - * @param string $url The site to fetch |
|
| 142 | - * @param bool $redirect Whether or not this was a redirect request |
|
| 143 | - * @return void|bool Sets various properties of the class or returns false if the URL isn't specified |
|
| 144 | - */ |
|
| 137 | + * Makes the actual cURL call |
|
| 138 | + * - stores responses (url, code, error, headers, body) in the response array |
|
| 139 | + * - detects 301, 302, 307 codes and will redirect to the given response header location |
|
| 140 | + * |
|
| 141 | + * @param string $url The site to fetch |
|
| 142 | + * @param bool $redirect Whether or not this was a redirect request |
|
| 143 | + * @return void|bool Sets various properties of the class or returns false if the URL isn't specified |
|
| 144 | + */ |
|
| 145 | 145 | private function curl_request($url, $redirect = false) |
| 146 | 146 | { |
| 147 | 147 | // we do have a url I hope |
@@ -193,12 +193,12 @@ discard block |
||
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
| 196 | - * Used if being redirected to ensure we have a fully qualified address |
|
| 197 | - * |
|
| 198 | - * @param string $last_url The URL we went to |
|
| 199 | - * @param string $new_url The URL we were redirected to |
|
| 200 | - * @return string The new URL that was in the HTTP header |
|
| 201 | - */ |
|
| 196 | + * Used if being redirected to ensure we have a fully qualified address |
|
| 197 | + * |
|
| 198 | + * @param string $last_url The URL we went to |
|
| 199 | + * @param string $new_url The URL we were redirected to |
|
| 200 | + * @return string The new URL that was in the HTTP header |
|
| 201 | + */ |
|
| 202 | 202 | private function get_redirect_url($last_url = '', $new_url = '') |
| 203 | 203 | { |
| 204 | 204 | // Get the elements for these urls |
@@ -216,13 +216,13 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
| 219 | - * Used to return the results to the calling program |
|
| 220 | - * - called as ->result() will return the full final array |
|
| 221 | - * - called as ->result('body') to just return the page source of the result |
|
| 222 | - * |
|
| 223 | - * @param string $area Used to return an area such as body, header, error |
|
| 224 | - * @return string The response |
|
| 225 | - */ |
|
| 219 | + * Used to return the results to the calling program |
|
| 220 | + * - called as ->result() will return the full final array |
|
| 221 | + * - called as ->result('body') to just return the page source of the result |
|
| 222 | + * |
|
| 223 | + * @param string $area Used to return an area such as body, header, error |
|
| 224 | + * @return string The response |
|
| 225 | + */ |
|
| 226 | 226 | public function result($area = '') |
| 227 | 227 | { |
| 228 | 228 | $max_result = count($this->response) - 1; |
@@ -235,13 +235,13 @@ discard block |
||
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |
| 238 | - * Will return all results from all loops (redirects) |
|
| 239 | - * - Can be called as ->result_raw(x) where x is a specific loop results. |
|
| 240 | - * - Call as ->result_raw() for everything. |
|
| 241 | - * |
|
| 242 | - * @param string $response_number Which response we want to get |
|
| 243 | - * @return array|string The entire response array or just the specified response |
|
| 244 | - */ |
|
| 238 | + * Will return all results from all loops (redirects) |
|
| 239 | + * - Can be called as ->result_raw(x) where x is a specific loop results. |
|
| 240 | + * - Call as ->result_raw() for everything. |
|
| 241 | + * |
|
| 242 | + * @param string $response_number Which response we want to get |
|
| 243 | + * @return array|string The entire response array or just the specified response |
|
| 244 | + */ |
|
| 245 | 245 | public function result_raw($response_number = '') |
| 246 | 246 | { |
| 247 | 247 | if (!is_numeric($response_number)) |
@@ -254,13 +254,13 @@ discard block |
||
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | /** |
| 257 | - * Takes supplied POST data and url encodes it |
|
| 258 | - * - forms the date (for post) in to a string var=xyz&var2=abc&var3=123 |
|
| 259 | - * - drops vars with @ since we don't support sending files (uploading) |
|
| 260 | - * |
|
| 261 | - * @param array|string $post_data The raw POST data |
|
| 262 | - * @return string A string of post data |
|
| 263 | - */ |
|
| 257 | + * Takes supplied POST data and url encodes it |
|
| 258 | + * - forms the date (for post) in to a string var=xyz&var2=abc&var3=123 |
|
| 259 | + * - drops vars with @ since we don't support sending files (uploading) |
|
| 260 | + * |
|
| 261 | + * @param array|string $post_data The raw POST data |
|
| 262 | + * @return string A string of post data |
|
| 263 | + */ |
|
| 264 | 264 | private function build_post_data($post_data) |
| 265 | 265 | { |
| 266 | 266 | if (is_array($post_data)) |
@@ -279,11 +279,11 @@ discard block |
||
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | /** |
| 282 | - * Sets the final cURL options for the current call |
|
| 283 | - * - overwrites our default values with user supplied ones or appends new user ones to what we have |
|
| 284 | - * - sets the callback function now that $this is existing |
|
| 285 | - * @return void |
|
| 286 | - */ |
|
| 282 | + * Sets the final cURL options for the current call |
|
| 283 | + * - overwrites our default values with user supplied ones or appends new user ones to what we have |
|
| 284 | + * - sets the callback function now that $this is existing |
|
| 285 | + * @return void |
|
| 286 | + */ |
|
| 287 | 287 | private function set_options() |
| 288 | 288 | { |
| 289 | 289 | // Callback to parse the returned headers, if any |
@@ -308,12 +308,12 @@ discard block |
||
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | /** |
| 311 | - * Called to initiate a redirect from a 301, 302 or 307 header |
|
| 312 | - * - resets the cURL options for the loop, sets the referrer flag |
|
| 313 | - * |
|
| 314 | - * @param string $target_url The URL we want to redirect to |
|
| 315 | - * @param string $referer_url The URL that we're redirecting from |
|
| 316 | - */ |
|
| 311 | + * Called to initiate a redirect from a 301, 302 or 307 header |
|
| 312 | + * - resets the cURL options for the loop, sets the referrer flag |
|
| 313 | + * |
|
| 314 | + * @param string $target_url The URL we want to redirect to |
|
| 315 | + * @param string $referer_url The URL that we're redirecting from |
|
| 316 | + */ |
|
| 317 | 317 | private function redirect($target_url, $referer_url) |
| 318 | 318 | { |
| 319 | 319 | // no no I last saw that over there ... really, 301, 302, 307 |
@@ -323,13 +323,13 @@ discard block |
||
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | /** |
| 326 | - * Callback function to parse returned headers |
|
| 327 | - * - lowercases everything to make it consistent |
|
| 328 | - * |
|
| 329 | - * @param type $cr Not sure what this is used for? |
|
| 330 | - * @param string $header The header |
|
| 331 | - * @return int The length of the header |
|
| 332 | - */ |
|
| 326 | + * Callback function to parse returned headers |
|
| 327 | + * - lowercases everything to make it consistent |
|
| 328 | + * |
|
| 329 | + * @param type $cr Not sure what this is used for? |
|
| 330 | + * @param string $header The header |
|
| 331 | + * @return int The length of the header |
|
| 332 | + */ |
|
| 333 | 333 | private function header_callback($cr, $header) |
| 334 | 334 | { |
| 335 | 335 | $_header = trim($header); |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | { |
| 838 | 838 | uasort($loaded_attachments, function($a, $b) { |
| 839 | 839 | if ($a['filesize'] == $b['filesize']) |
| 840 | - return 0; |
|
| 840 | + return 0; |
|
| 841 | 841 | return ($a['filesize'] < $b['filesize']) ? -1 : 1; |
| 842 | 842 | }); |
| 843 | 843 | } |
@@ -1242,7 +1242,7 @@ discard block |
||
| 1242 | 1242 | { |
| 1243 | 1243 | uasort($loaded_attachments, function($a, $b) { |
| 1244 | 1244 | if ($a['filesize'] == $b['filesize']) |
| 1245 | - return 0; |
|
| 1245 | + return 0; |
|
| 1246 | 1246 | return ($a['filesize'] < $b['filesize']) ? -1 : 1; |
| 1247 | 1247 | }); |
| 1248 | 1248 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $smcFunc['db_free_result']($request); |
| 166 | 166 | |
| 167 | 167 | $feed_meta['title'] = ' - ' . strip_tags($board_info['name']); |
| 168 | - $feed_meta['source'] .= '?board=' . $board . '.0' ; |
|
| 168 | + $feed_meta['source'] .= '?board=' . $board . '.0'; |
|
| 169 | 169 | |
| 170 | 170 | $query_this_board = 'b.id_board = ' . $board; |
| 171 | 171 | |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | |
| 390 | 390 | foreach ($xml_data as $item) |
| 391 | 391 | { |
| 392 | - $link = array_filter($item['content'], function ($e) { return ($e['tag'] == 'link'); }); |
|
| 392 | + $link = array_filter($item['content'], function($e) { return ($e['tag'] == 'link'); }); |
|
| 393 | 393 | $link = array_pop($link); |
| 394 | 394 | |
| 395 | 395 | echo ' |
@@ -389,7 +389,9 @@ discard block |
||
| 389 | 389 | |
| 390 | 390 | foreach ($xml_data as $item) |
| 391 | 391 | { |
| 392 | - $link = array_filter($item['content'], function ($e) { return ($e['tag'] == 'link'); }); |
|
| 392 | + $link = array_filter($item['content'], function ($e) |
|
| 393 | + { |
|
| 394 | +return ($e['tag'] == 'link'); }); |
|
| 393 | 395 | $link = array_pop($link); |
| 394 | 396 | |
| 395 | 397 | echo ' |
@@ -446,7 +448,7 @@ discard block |
||
| 446 | 448 | return $val; |
| 447 | 449 | |
| 448 | 450 | $val = preg_replace_callback('~\b' . preg_quote($scripturl, '~') . '\?((?:board|topic)=[^#"]+)(#[^"]*)?$~', function($m) use ($scripturl) |
| 449 | - { |
|
| 451 | + { |
|
| 450 | 452 | return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? $m[2] : ""); |
| 451 | 453 | }, $val); |
| 452 | 454 | return $val; |
@@ -867,7 +869,8 @@ discard block |
||
| 867 | 869 | // Sort the attachments by size to make things easier below |
| 868 | 870 | if (!empty($loaded_attachments)) |
| 869 | 871 | { |
| 870 | - uasort($loaded_attachments, function($a, $b) { |
|
| 872 | + uasort($loaded_attachments, function($a, $b) |
|
| 873 | + { |
|
| 871 | 874 | if ($a['filesize'] == $b['filesize']) |
| 872 | 875 | return 0; |
| 873 | 876 | return ($a['filesize'] < $b['filesize']) ? -1 : 1; |
@@ -1283,7 +1286,8 @@ discard block |
||
| 1283 | 1286 | // Sort the attachments by size to make things easier below |
| 1284 | 1287 | if (!empty($loaded_attachments)) |
| 1285 | 1288 | { |
| 1286 | - uasort($loaded_attachments, function($a, $b) { |
|
| 1289 | + uasort($loaded_attachments, function($a, $b) |
|
| 1290 | + { |
|
| 1287 | 1291 | if ($a['filesize'] == $b['filesize']) |
| 1288 | 1292 | return 0; |
| 1289 | 1293 | return ($a['filesize'] < $b['filesize']) ? -1 : 1; |
@@ -1542,7 +1542,7 @@ discard block |
||
| 1542 | 1542 | 'no_msg' => 0, |
| 1543 | 1543 | 'substep' => $_GET['substep'], |
| 1544 | 1544 | 'ignore_ids' => $ignore_ids, |
| 1545 | - 'attach_thumb' => array(0,3), |
|
| 1545 | + 'attach_thumb' => array(0, 3), |
|
| 1546 | 1546 | ) |
| 1547 | 1547 | ); |
| 1548 | 1548 | |
@@ -1572,7 +1572,7 @@ discard block |
||
| 1572 | 1572 | array( |
| 1573 | 1573 | 'to_remove' => $to_remove, |
| 1574 | 1574 | 'no_member' => 0, |
| 1575 | - 'attach_thumb' => array(0,3), |
|
| 1575 | + 'attach_thumb' => array(0, 3), |
|
| 1576 | 1576 | ) |
| 1577 | 1577 | ); |
| 1578 | 1578 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | cache_put_data('wave_file/' . $user_info['ip2'], $ip2 ? $ip2 + 1 : 1, 20); |
| 39 | 39 | |
| 40 | 40 | // Fixate randomization for this word. |
| 41 | - $tmp = unpack('n', md5($word . session_id())); |
|
| 41 | + $tmp = unpack('n', md5($word . session_id())); |
|
| 42 | 42 | mt_srand(end($tmp)); |
| 43 | 43 | |
| 44 | 44 | // Try to see if there's a sound font in the user's language. |
@@ -670,7 +670,7 @@ |
||
| 670 | 670 | // Show "<< Last Edit: Time by Person >>" if this post was edited. But we need the div even if it wasn't modified! |
| 671 | 671 | // Because we insert into it through AJAX and we don't want to stop themers moving it around if they so wish so they can put it where they want it. |
| 672 | 672 | echo ' |
| 673 | - <span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '','" id="modified_', $message['id'], '">'; |
|
| 673 | + <span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '', '" id="modified_', $message['id'], '">'; |
|
| 674 | 674 | |
| 675 | 675 | if (!empty($modSettings['show_modify']) && !empty($message['modified']['name'])) |
| 676 | 676 | echo |
@@ -239,7 +239,7 @@ |
||
| 239 | 239 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 240 | 240 | $fts_language[$row['cfgname']] = $row['cfgname']; |
| 241 | 241 | |
| 242 | - $config_vars = array_merge ($config_vars, array( |
|
| 242 | + $config_vars = array_merge($config_vars, array( |
|
| 243 | 243 | '', |
| 244 | 244 | array('search_language', $txt['search_language'], 'db', 'select', $fts_language, 'pgFulltextSearch') |
| 245 | 245 | ) |
@@ -38,12 +38,12 @@ discard block |
||
| 38 | 38 | $version = $smcFunc['db_get_version'](); |
| 39 | 39 | // if we got a Beta Version |
| 40 | 40 | if (stripos($version, 'beta') !== false) |
| 41 | - $version = substr($version, 0, stripos($version, 'beta')).'.0'; |
|
| 41 | + $version = substr($version, 0, stripos($version, 'beta')) . '.0'; |
|
| 42 | 42 | // or RC |
| 43 | 43 | if (stripos($version, 'rc') !== false) |
| 44 | - $version = substr($version, 0, stripos($version, 'rc')).'.0'; |
|
| 44 | + $version = substr($version, 0, stripos($version, 'rc')) . '.0'; |
|
| 45 | 45 | |
| 46 | - if (version_compare($version,'9.5.0','>=')) |
|
| 46 | + if (version_compare($version, '9.5.0', '>=')) |
|
| 47 | 47 | $smcFunc['db_support_ignore'] = true; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | function smf_db_search_support($search_type) |
| 57 | 57 | { |
| 58 | - $supported_types = array('custom','fulltext'); |
|
| 58 | + $supported_types = array('custom', 'fulltext'); |
|
| 59 | 59 | |
| 60 | 60 | return in_array($search_type, $supported_types); |
| 61 | 61 | } |
@@ -109,9 +109,9 @@ discard block |
||
| 109 | 109 | if (preg_match('~^\s*INSERT\sIGNORE~i', $db_string) != 0) |
| 110 | 110 | { |
| 111 | 111 | $db_string = preg_replace('~^\s*INSERT\sIGNORE~i', 'INSERT', $db_string); |
| 112 | - if ($smcFunc['db_support_ignore']){ |
|
| 112 | + if ($smcFunc['db_support_ignore']) { |
|
| 113 | 113 | //pg style "INSERT INTO.... ON CONFLICT DO NOTHING" |
| 114 | - $db_string = $db_string.' ON CONFLICT DO NOTHING'; |
|
| 114 | + $db_string = $db_string . ' ON CONFLICT DO NOTHING'; |
|
| 115 | 115 | } |
| 116 | 116 | else |
| 117 | 117 | { |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $language_ftx = $modSettings['search_language']; |
| 169 | 169 | else |
| 170 | 170 | { |
| 171 | - $request = $smcFunc['db_query']('',' |
|
| 171 | + $request = $smcFunc['db_query']('', ' |
|
| 172 | 172 | SELECT cfgname FROM pg_ts_config WHERE oid = current_setting({string:default_language})::regconfig', |
| 173 | 173 | array( |
| 174 | 174 | 'default_language' => 'default_text_search_config' |
@@ -99,7 +99,8 @@ |
||
| 99 | 99 | if (preg_match('~^\s*INSERT\sIGNORE~i', $db_string) != 0) |
| 100 | 100 | { |
| 101 | 101 | $db_string = preg_replace('~^\s*INSERT\sIGNORE~i', 'INSERT', $db_string); |
| 102 | - if ($smcFunc['db_support_ignore']){ |
|
| 102 | + if ($smcFunc['db_support_ignore']) |
|
| 103 | + { |
|
| 103 | 104 | //pg style "INSERT INTO.... ON CONFLICT DO NOTHING" |
| 104 | 105 | $db_string = $db_string.' ON CONFLICT DO NOTHING'; |
| 105 | 106 | } |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class Birthday_Notify_Background extends SMF_BackgroundTask |
| 20 | 20 | { |
| 21 | - /** |
|
| 22 | - * This executes the task. It loads up the birthdays, figures out the greeting, etc. |
|
| 23 | - * @return bool Always returns true |
|
| 24 | - */ |
|
| 21 | + /** |
|
| 22 | + * This executes the task. It loads up the birthdays, figures out the greeting, etc. |
|
| 23 | + * @return bool Always returns true |
|
| 24 | + */ |
|
| 25 | 25 | public function execute() |
| 26 | 26 | { |
| 27 | 27 | global $txt, $smcFunc, $txtBirthdayEmails, $modSettings, $sourcedir; |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * @return bool Always returns true |
| 24 | 24 | */ |
| 25 | 25 | public function execute() |
| 26 | - { |
|
| 26 | + { |
|
| 27 | 27 | global $txt, $smcFunc, $txtBirthdayEmails, $modSettings, $sourcedir; |
| 28 | 28 | |
| 29 | 29 | $greeting = isset($modSettings['birthday_email']) ? $modSettings['birthday_email'] : 'happy_birthday'; |