@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | // Stick our "create a redirection topic" template in here... |
| 64 | 64 | template_redirect_options('move'); |
| 65 | 65 | |
| 66 | - echo ' |
|
| 66 | + echo ' |
|
| 67 | 67 | <input type="submit" value="', $txt['move_topic'], '" onclick="return submitThisOnce(this);" accesskey="s" class="button_submit"> |
| 68 | 68 | </div> |
| 69 | 69 | </div>'; |
@@ -86,9 +86,9 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | function template_redirect_options($type) |
| 88 | 88 | { |
| 89 | - global $txt, $context, $modSettings; |
|
| 89 | + global $txt, $context, $modSettings; |
|
| 90 | 90 | |
| 91 | - echo ' |
|
| 91 | + echo ' |
|
| 92 | 92 | <label for="postRedirect"><input type="checkbox" name="postRedirect" id="postRedirect"', $context['is_approved'] ? ' checked' : '', ' onclick="', $context['is_approved'] ? '' : 'if (this.checked && !confirm(\'' . $txt[$type . '_topic_unapproved_js'] . '\')) return false; ', 'document.getElementById(\'reasonArea\').style.display = this.checked ? \'block\' : \'none\';" class="input_check"> ', $txt['post_redirection'], '.</label> |
| 93 | 93 | <fieldset id="reasonArea" style="margin-top: 1ex;', $context['is_approved'] ? '' : 'display: none;', '"> |
| 94 | 94 | <dl class="settings"> |
@@ -220,7 +220,7 @@ |
||
| 220 | 220 | ), |
| 221 | 221 | ), |
| 222 | 222 | ); |
| 223 | - */ |
|
| 223 | + */ |
|
| 224 | 224 | |
| 225 | 225 | // Are we using right-to-left orientation? |
| 226 | 226 | $first = $context['right_to_left'] ? 'last' : 'first'; |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | </dd>'; |
| 614 | 614 | } |
| 615 | 615 | // A Textarea? |
| 616 | - elseif ($setting['type'] == 'textarea') |
|
| 616 | + elseif ($setting['type'] == 'textarea') |
|
| 617 | 617 | { |
| 618 | 618 | echo ' |
| 619 | 619 | <dt> |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | </dt> |
| 627 | 627 | <dd> |
| 628 | 628 | <textarea rows="4" style="width: 95%;" cols="40" name="', !empty($setting['default']) ? 'default_' : '','options[', $setting['id'], ']" id="', $setting['id'], '">', $setting['value'], '</textarea>'; |
| 629 | - echo ' |
|
| 629 | + echo ' |
|
| 630 | 630 | </dd>'; |
| 631 | 631 | } |
| 632 | 632 | // A regular input box, then? |
@@ -59,13 +59,13 @@ discard block |
||
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * Start the curl object |
|
| 63 | - * - allow for user override values |
|
| 64 | - * |
|
| 65 | - * @param array $options An array of cURL options |
|
| 66 | - * @param int $max_redirect Maximum number of redirects |
|
| 67 | - * @return void |
|
| 68 | - */ |
|
| 62 | + * Start the curl object |
|
| 63 | + * - allow for user override values |
|
| 64 | + * |
|
| 65 | + * @param array $options An array of cURL options |
|
| 66 | + * @param int $max_redirect Maximum number of redirects |
|
| 67 | + * @return void |
|
| 68 | + */ |
|
| 69 | 69 | public function __construct($options = array(), $max_redirect = 3) |
| 70 | 70 | { |
| 71 | 71 | // Initialize class variables |
@@ -74,16 +74,16 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | - * Main calling function, |
|
| 78 | - * - will request the page data from a given $url |
|
| 79 | - * - optionally will post data to the page form if post data is supplied |
|
| 80 | - * - passed arrays will be converted to a post string joined with &'s |
|
| 81 | - * - calls set_options to set the curl opts array values based on the defaults and user input |
|
| 82 | - * |
|
| 83 | - * @param string $url the site we are going to fetch |
|
| 84 | - * @param array $post_data any post data as form name => value |
|
| 85 | - * @return object An instance of the curl_fetch_web_data class |
|
| 86 | - */ |
|
| 77 | + * Main calling function, |
|
| 78 | + * - will request the page data from a given $url |
|
| 79 | + * - optionally will post data to the page form if post data is supplied |
|
| 80 | + * - passed arrays will be converted to a post string joined with &'s |
|
| 81 | + * - calls set_options to set the curl opts array values based on the defaults and user input |
|
| 82 | + * |
|
| 83 | + * @param string $url the site we are going to fetch |
|
| 84 | + * @param array $post_data any post data as form name => value |
|
| 85 | + * @return object An instance of the curl_fetch_web_data class |
|
| 86 | + */ |
|
| 87 | 87 | public function get_url_data($url, $post_data = array()) |
| 88 | 88 | { |
| 89 | 89 | // POSTing some data perhaps? |
@@ -100,14 +100,14 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | - * Makes the actual cURL call |
|
| 104 | - * - stores responses (url, code, error, headers, body) in the response array |
|
| 105 | - * - detects 301, 302, 307 codes and will redirect to the given response header location |
|
| 106 | - * |
|
| 107 | - * @param string $url The site to fetch |
|
| 108 | - * @param bool $redirect Whether or not this was a redirect request |
|
| 109 | - * @return void|bool Sets various properties of the class or returns false if the URL isn't specified |
|
| 110 | - */ |
|
| 103 | + * Makes the actual cURL call |
|
| 104 | + * - stores responses (url, code, error, headers, body) in the response array |
|
| 105 | + * - detects 301, 302, 307 codes and will redirect to the given response header location |
|
| 106 | + * |
|
| 107 | + * @param string $url The site to fetch |
|
| 108 | + * @param bool $redirect Whether or not this was a redirect request |
|
| 109 | + * @return void|bool Sets various properties of the class or returns false if the URL isn't specified |
|
| 110 | + */ |
|
| 111 | 111 | private function curl_request($url, $redirect = false) |
| 112 | 112 | { |
| 113 | 113 | // we do have a url I hope |
@@ -159,12 +159,12 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /** |
| 162 | - * Used if being redirected to ensure we have a fully qualified address |
|
| 163 | - * |
|
| 164 | - * @param string $last_url The URL we went to |
|
| 165 | - * @param string $new_url The URL we were redirected to |
|
| 166 | - * @return string The new URL that was in the HTTP header |
|
| 167 | - */ |
|
| 162 | + * Used if being redirected to ensure we have a fully qualified address |
|
| 163 | + * |
|
| 164 | + * @param string $last_url The URL we went to |
|
| 165 | + * @param string $new_url The URL we were redirected to |
|
| 166 | + * @return string The new URL that was in the HTTP header |
|
| 167 | + */ |
|
| 168 | 168 | private function get_redirect_url($last_url = '', $new_url = '') |
| 169 | 169 | { |
| 170 | 170 | // Get the elements for these urls |
@@ -182,13 +182,13 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | - * Used to return the results to the calling program |
|
| 186 | - * - called as ->result() will return the full final array |
|
| 187 | - * - called as ->result('body') to just return the page source of the result |
|
| 188 | - * |
|
| 189 | - * @param string $area Used to return an area such as body, header, error |
|
| 190 | - * @return string The response |
|
| 191 | - */ |
|
| 185 | + * Used to return the results to the calling program |
|
| 186 | + * - called as ->result() will return the full final array |
|
| 187 | + * - called as ->result('body') to just return the page source of the result |
|
| 188 | + * |
|
| 189 | + * @param string $area Used to return an area such as body, header, error |
|
| 190 | + * @return string The response |
|
| 191 | + */ |
|
| 192 | 192 | public function result($area = '') |
| 193 | 193 | { |
| 194 | 194 | $max_result = count($this->response) - 1; |
@@ -201,13 +201,13 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
| 204 | - * Will return all results from all loops (redirects) |
|
| 205 | - * - Can be called as ->result_raw(x) where x is a specific loop results. |
|
| 206 | - * - Call as ->result_raw() for everything. |
|
| 207 | - * |
|
| 208 | - * @param string $response_number Which response we want to get |
|
| 209 | - * @return array|string The entire response array or just the specified response |
|
| 210 | - */ |
|
| 204 | + * Will return all results from all loops (redirects) |
|
| 205 | + * - Can be called as ->result_raw(x) where x is a specific loop results. |
|
| 206 | + * - Call as ->result_raw() for everything. |
|
| 207 | + * |
|
| 208 | + * @param string $response_number Which response we want to get |
|
| 209 | + * @return array|string The entire response array or just the specified response |
|
| 210 | + */ |
|
| 211 | 211 | public function result_raw($response_number = '') |
| 212 | 212 | { |
| 213 | 213 | if (!is_numeric($response_number)) |
@@ -220,13 +220,13 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | /** |
| 223 | - * Takes supplied POST data and url encodes it |
|
| 224 | - * - forms the date (for post) in to a string var=xyz&var2=abc&var3=123 |
|
| 225 | - * - drops vars with @ since we don't support sending files (uploading) |
|
| 226 | - * |
|
| 227 | - * @param array|string $post_data The raw POST data |
|
| 228 | - * @return string A string of post data |
|
| 229 | - */ |
|
| 223 | + * Takes supplied POST data and url encodes it |
|
| 224 | + * - forms the date (for post) in to a string var=xyz&var2=abc&var3=123 |
|
| 225 | + * - drops vars with @ since we don't support sending files (uploading) |
|
| 226 | + * |
|
| 227 | + * @param array|string $post_data The raw POST data |
|
| 228 | + * @return string A string of post data |
|
| 229 | + */ |
|
| 230 | 230 | private function build_post_data($post_data) |
| 231 | 231 | { |
| 232 | 232 | if (is_array($post_data)) |
@@ -245,11 +245,11 @@ discard block |
||
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
| 248 | - * Sets the final cURL options for the current call |
|
| 249 | - * - overwrites our default values with user supplied ones or appends new user ones to what we have |
|
| 250 | - * - sets the callback function now that $this is existing |
|
| 251 | - * @return void |
|
| 252 | - */ |
|
| 248 | + * Sets the final cURL options for the current call |
|
| 249 | + * - overwrites our default values with user supplied ones or appends new user ones to what we have |
|
| 250 | + * - sets the callback function now that $this is existing |
|
| 251 | + * @return void |
|
| 252 | + */ |
|
| 253 | 253 | private function set_options() |
| 254 | 254 | { |
| 255 | 255 | // Callback to parse the returned headers, if any |
@@ -274,12 +274,12 @@ discard block |
||
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /** |
| 277 | - * Called to initiate a redirect from a 301, 302 or 307 header |
|
| 278 | - * - resets the cURL options for the loop, sets the referrer flag |
|
| 279 | - * |
|
| 280 | - * @param string $target_url The URL we want to redirect to |
|
| 281 | - * @param string $referer_url The URL that we're redirecting from |
|
| 282 | - */ |
|
| 277 | + * Called to initiate a redirect from a 301, 302 or 307 header |
|
| 278 | + * - resets the cURL options for the loop, sets the referrer flag |
|
| 279 | + * |
|
| 280 | + * @param string $target_url The URL we want to redirect to |
|
| 281 | + * @param string $referer_url The URL that we're redirecting from |
|
| 282 | + */ |
|
| 283 | 283 | private function redirect($target_url, $referer_url) |
| 284 | 284 | { |
| 285 | 285 | // no no I last saw that over there ... really, 301, 302, 307 |
@@ -289,13 +289,13 @@ discard block |
||
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | /** |
| 292 | - * Callback function to parse returned headers |
|
| 293 | - * - lowercases everything to make it consistent |
|
| 294 | - * |
|
| 295 | - * @param type $cr Not sure what this is used for? |
|
| 296 | - * @param string $header The header |
|
| 297 | - * @return int The length of the header |
|
| 298 | - */ |
|
| 292 | + * Callback function to parse returned headers |
|
| 293 | + * - lowercases everything to make it consistent |
|
| 294 | + * |
|
| 295 | + * @param type $cr Not sure what this is used for? |
|
| 296 | + * @param string $header The header |
|
| 297 | + * @return int The length of the header |
|
| 298 | + */ |
|
| 299 | 299 | private function header_callback($cr, $header) |
| 300 | 300 | { |
| 301 | 301 | $_header = trim($header); |
@@ -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 | |
@@ -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 | /** |
@@ -272,13 +272,13 @@ |
||
| 272 | 272 | $context['post_error']['messages'][] = $txt['mc_warning_template_error_no_body']; |
| 273 | 273 | // Add in few replacements. |
| 274 | 274 | /** |
| 275 | - * These are the defaults: |
|
| 276 | - * - {MEMBER} - Member Name. => current user for review |
|
| 277 | - * - {MESSAGE} - Link to Offending Post. (If Applicable) => not applicable here, so not replaced |
|
| 278 | - * - {FORUMNAME} - Forum Name. |
|
| 279 | - * - {SCRIPTURL} - Web address of forum. |
|
| 280 | - * - {REGARDS} - Standard email sign-off. |
|
| 281 | - */ |
|
| 275 | + * These are the defaults: |
|
| 276 | + * - {MEMBER} - Member Name. => current user for review |
|
| 277 | + * - {MESSAGE} - Link to Offending Post. (If Applicable) => not applicable here, so not replaced |
|
| 278 | + * - {FORUMNAME} - Forum Name. |
|
| 279 | + * - {SCRIPTURL} - Web address of forum. |
|
| 280 | + * - {REGARDS} - Standard email sign-off. |
|
| 281 | + */ |
|
| 282 | 282 | $find = array( |
| 283 | 283 | '{MEMBER}', |
| 284 | 284 | '{FORUMNAME}', |
@@ -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'])) |
@@ -842,7 +842,7 @@ |
||
| 842 | 842 | require_once($sourcedir . '/Subs-Boards.php'); |
| 843 | 843 | sortBoards($recycle_boards); |
| 844 | 844 | |
| 845 | - $recycle_boards = array('') + $recycle_boards; |
|
| 845 | + $recycle_boards = array('') + $recycle_boards; |
|
| 846 | 846 | |
| 847 | 847 | // Here and the board settings... |
| 848 | 848 | $config_vars = array( |