@@ -185,13 +185,13 @@ discard block |
||
185 | 185 | $mr = 5; |
186 | 186 | $body = null; |
187 | 187 | |
188 | - if(ini_get("open_basedir") == "" && ini_get("safe_mode" == "Off")){ |
|
188 | + if (ini_get("open_basedir") == "" && ini_get("safe_mode" == "Off")) { |
|
189 | 189 | curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, $mr > 0); |
190 | 190 | curl_setopt($this->curl, CURLOPT_MAXREDIRS, $mr); |
191 | - } else{ |
|
191 | + } else { |
|
192 | 192 | $this->setOption(CURLOPT_FOLLOWLOCATION, false); |
193 | 193 | |
194 | - if($CURLOPT_MAXREDIRS > 0){ |
|
194 | + if ($CURLOPT_MAXREDIRS > 0) { |
|
195 | 195 | $original_url = $this->getInfo(CURLINFO_EFFECTIVE_URL); |
196 | 196 | $newurl = $original_url; |
197 | 197 | |
@@ -208,24 +208,24 @@ discard block |
||
208 | 208 | $header = substr($response, 0, $header_size); |
209 | 209 | $body = substr($response, $header_size); |
210 | 210 | |
211 | - if(curl_errno($rch)){ |
|
211 | + if (curl_errno($rch)) { |
|
212 | 212 | $code = 0; |
213 | - } else{ |
|
213 | + } else { |
|
214 | 214 | $code = curl_getinfo($rch, CURLINFO_HTTP_CODE); |
215 | 215 | |
216 | 216 | if ($code == 301 || $code == 302) { |
217 | 217 | preg_match('/Location:(.*?)\n/i', $header, $matches); |
218 | 218 | $newurl = trim(array_pop($matches)); |
219 | - } else{ |
|
219 | + } else { |
|
220 | 220 | $code = 0; |
221 | 221 | } |
222 | 222 | } |
223 | - } while($code && --$mr); |
|
223 | + } while ($code && --$mr); |
|
224 | 224 | |
225 | 225 | curl_close($rch); |
226 | 226 | |
227 | - if(!$mr){ |
|
228 | - if ($mr === null){ |
|
227 | + if (!$mr) { |
|
228 | + if ($mr === null) { |
|
229 | 229 | trigger_error('Too many redirects.', E_USER_WARNING); |
230 | 230 | } |
231 | 231 |