Lines Matching refs:this
129 $this->user = $URI_PARTS["user"];
131 $this->pass = $URI_PARTS["pass"];
140 $this->host = $URI_PARTS["host"];
142 $this->port = $URI_PARTS["port"];
143 if($this->_connect($fp))
145 if($this->_isproxy)
148 $this->_httprequest($URI,$fp,$URI,$this->_httpmethod);
154 $this->_httprequest($path, $fp, $URI, $this->_httpmethod);
157 $this->_disconnect($fp);
159 if($this->_redirectaddr)
162 if($this->maxredirs > $this->_redirectdepth)
165 … if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
168 $this->_redirectdepth++;
169 $this->lastredirectaddr=$this->_redirectaddr;
170 $this->fetch($this->_redirectaddr);
175 if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
177 $frameurls = $this->_frameurls;
178 $this->_frameurls = array();
182 if($this->_framedepth < $this->maxframes)
184 $this->fetch($frameurl);
185 $this->_framedepth++;
199 if(!$this->curl_path)
202 if (!is_executable($this->curl_path))
204 $this->host = $URI_PARTS["host"];
206 $this->port = $URI_PARTS["port"];
207 if($this->_isproxy)
210 $this->_httpsrequest($URI,$URI,$this->_httpmethod);
216 $this->_httpsrequest($path, $URI, $this->_httpmethod);
219 if($this->_redirectaddr)
222 if($this->maxredirs > $this->_redirectdepth)
225 … if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
228 $this->_redirectdepth++;
229 $this->lastredirectaddr=$this->_redirectaddr;
230 $this->fetch($this->_redirectaddr);
235 if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
237 $frameurls = $this->_frameurls;
238 $this->_frameurls = array();
242 if($this->_framedepth < $this->maxframes)
244 $this->fetch($frameurl);
245 $this->_framedepth++;
255 $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n';
277 $postdata = $this->_prepare_post_body($formvars, $formfiles);
281 $this->user = $URI_PARTS["user"];
283 $this->pass = $URI_PARTS["pass"];
292 $this->host = $URI_PARTS["host"];
294 $this->port = $URI_PARTS["port"];
295 if($this->_connect($fp))
297 if($this->_isproxy)
300 $this->_httprequest($URI,$fp,$URI,$this->_submit_method,$this->_submit_type,$postdata);
306 $this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata);
309 $this->_disconnect($fp);
311 if($this->_redirectaddr)
314 if($this->maxredirs > $this->_redirectdepth)
316 if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr))
317 …$this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PA…
320 … if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
323 $this->_redirectdepth++;
324 $this->lastredirectaddr=$this->_redirectaddr;
325 if( strpos( $this->_redirectaddr, "?" ) > 0 )
326 …$this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get
328 $this->submit($this->_redirectaddr,$formvars, $formfiles);
333 if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
335 $frameurls = $this->_frameurls;
336 $this->_frameurls = array();
340 if($this->_framedepth < $this->maxframes)
342 $this->fetch($frameurl);
343 $this->_framedepth++;
358 if(!$this->curl_path)
361 if (!is_executable($this->curl_path))
363 $this->host = $URI_PARTS["host"];
365 $this->port = $URI_PARTS["port"];
366 if($this->_isproxy)
369 $this->_httpsrequest($URI, $URI, $this->_submit_method, $this->_submit_type, $postdata);
375 $this->_httpsrequest($path, $URI, $this->_submit_method, $this->_submit_type, $postdata);
378 if($this->_redirectaddr)
381 if($this->maxredirs > $this->_redirectdepth)
383 if(!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr))
384 …$this->_redirectaddr = $this->_expandlinks($this->_redirectaddr,$URI_PARTS["scheme"]."://".$URI_PA…
387 … if(preg_match("|^http://".preg_quote($this->host)."|i",$this->_redirectaddr) || $this->offsiteok)
390 $this->_redirectdepth++;
391 $this->lastredirectaddr=$this->_redirectaddr;
392 if( strpos( $this->_redirectaddr, "?" ) > 0 )
393 …$this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get
395 $this->submit($this->_redirectaddr,$formvars, $formfiles);
400 if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0)
402 $frameurls = $this->_frameurls;
403 $this->_frameurls = array();
407 if($this->_framedepth < $this->maxframes)
409 $this->fetch($frameurl);
410 $this->_framedepth++;
421 $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n';
437 if ($this->fetch($URI))
439 if($this->lastredirectaddr)
440 $URI = $this->lastredirectaddr;
441 if(is_array($this->results))
443 for($x=0;$x<count($this->results);$x++)
444 $this->results[$x] = $this->_striplinks($this->results[$x]);
447 $this->results = $this->_striplinks($this->results);
449 if($this->expandlinks)
450 $this->results = $this->_expandlinks($this->results, $URI);
467 if ($this->fetch($URI))
470 if(is_array($this->results))
472 for($x=0;$x<count($this->results);$x++)
473 $this->results[$x] = $this->_stripform($this->results[$x]);
476 $this->results = $this->_stripform($this->results);
494 if($this->fetch($URI))
496 if(is_array($this->results))
498 for($x=0;$x<count($this->results);$x++)
499 $this->results[$x] = $this->_striptext($this->results[$x]);
502 $this->results = $this->_striptext($this->results);
518 if($this->submit($URI,$formvars, $formfiles))
520 if($this->lastredirectaddr)
521 $URI = $this->lastredirectaddr;
522 if(is_array($this->results))
524 for($x=0;$x<count($this->results);$x++)
526 $this->results[$x] = $this->_striplinks($this->results[$x]);
527 if($this->expandlinks)
528 $this->results[$x] = $this->_expandlinks($this->results[$x],$URI);
533 $this->results = $this->_striplinks($this->results);
534 if($this->expandlinks)
535 $this->results = $this->_expandlinks($this->results,$URI);
552 if($this->submit($URI,$formvars, $formfiles))
554 if($this->lastredirectaddr)
555 $URI = $this->lastredirectaddr;
556 if(is_array($this->results))
558 for($x=0;$x<count($this->results);$x++)
560 $this->results[$x] = $this->_striptext($this->results[$x]);
561 if($this->expandlinks)
562 $this->results[$x] = $this->_expandlinks($this->results[$x],$URI);
567 $this->results = $this->_striptext($this->results);
568 if($this->expandlinks)
569 $this->results = $this->_expandlinks($this->results,$URI);
586 $this->_submit_type = "multipart/form-data";
597 $this->_submit_type = "application/x-www-form-urlencoded";
749 $search = array( "|^http://".preg_quote($this->host)."|i",
781 if($this->passcookies && $this->_redirectaddr)
782 $this->setcookies();
787 $headers = $http_method." ".$url." ".$this->_httpversion."\r\n";
788 if(!empty($this->agent))
789 $headers .= "User-Agent: ".$this->agent."\r\n";
790 if(!empty($this->host) && !isset($this->rawheaders['Host'])) {
791 $headers .= "Host: ".$this->host;
792 if(!empty($this->port))
793 $headers .= ":".$this->port;
796 if(!empty($this->accept))
797 $headers .= "Accept: ".$this->accept."\r\n";
798 if(!empty($this->referer))
799 $headers .= "Referer: ".$this->referer."\r\n";
800 if(!empty($this->cookies))
802 if(!is_array($this->cookies))
803 $this->cookies = (array)$this->cookies;
805 reset($this->cookies);
806 if ( count($this->cookies) > 0 ) {
808 foreach ( $this->cookies as $cookieKey => $cookieVal ) {
814 if(!empty($this->rawheaders))
816 if(!is_array($this->rawheaders))
817 $this->rawheaders = (array)$this->rawheaders;
818 while(list($headerKey,$headerVal) = each($this->rawheaders))
824 $headers .= "; boundary=".$this->_mime_boundary;
829 if(!empty($this->user) || !empty($this->pass))
830 $headers .= "Authorization: Basic ".base64_encode($this->user.":".$this->pass)."\r\n";
833 if(!empty($this->proxy_user))
834 …$headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->pr…
840 if ($this->read_timeout > 0)
841 socket_set_timeout($fp, $this->read_timeout);
842 $this->timed_out = false;
846 $this->_redirectaddr = false;
847 unset($this->headers);
849 while($currentHeader = fgets($fp,$this->_maxlinelen))
851 if ($this->read_timeout > 0 && $this->_check_timeout($fp))
853 $this->status=-100;
869 $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port;
872 $this->_redirectaddr .= "/".$matches[2];
874 $this->_redirectaddr .= $matches[2];
877 $this->_redirectaddr = $matches[2];
884 $this->status= $status[1];
886 $this->response_code = $currentHeader;
889 $this->headers[] = $currentHeader;
894 $_data = fread($fp, $this->maxlength);
901 if ($this->read_timeout > 0 && $this->_check_timeout($fp))
903 $this->status=-100;
912 $this->_redirectaddr = $this->_expandlinks($match[1],$URI);
916 …if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\…
918 $this->results[] = $results;
920 $this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
923 elseif(is_array($this->results))
924 $this->results[] = $results;
927 $this->results = $results;
943 if($this->passcookies && $this->_redirectaddr)
944 $this->setcookies();
953 if(!empty($this->agent))
954 $headers[] = "User-Agent: ".$this->agent;
955 if(!empty($this->host))
956 if(!empty($this->port))
957 $headers[] = "Host: ".$this->host.":".$this->port;
959 $headers[] = "Host: ".$this->host;
960 if(!empty($this->accept))
961 $headers[] = "Accept: ".$this->accept;
962 if(!empty($this->referer))
963 $headers[] = "Referer: ".$this->referer;
964 if(!empty($this->cookies))
966 if(!is_array($this->cookies))
967 $this->cookies = (array)$this->cookies;
969 reset($this->cookies);
970 if ( count($this->cookies) > 0 ) {
972 foreach ( $this->cookies as $cookieKey => $cookieVal ) {
978 if(!empty($this->rawheaders))
980 if(!is_array($this->rawheaders))
981 $this->rawheaders = (array)$this->rawheaders;
982 while(list($headerKey,$headerVal) = each($this->rawheaders))
987 $headers[] = "Content-type: $content_type; boundary=".$this->_mime_boundary;
993 if(!empty($this->user) || !empty($this->pass))
994 $headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass);
1004 if($this->read_timeout > 0)
1005 $cmdline_params .= " -m ".$this->read_timeout;
1009 …exec($this->curl_path." -k -D \"$headerfile\"".$cmdline_params." \"".escapeshellcmd($URI)."\"",$re…
1013 $this->error = "Error: cURL could not retrieve the document, error $return.";
1022 $this->_redirectaddr = false;
1023 unset($this->headers);
1037 $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port;
1040 $this->_redirectaddr .= "/".$matches[2];
1042 $this->_redirectaddr .= $matches[2];
1045 $this->_redirectaddr = $matches[2];
1049 $this->response_code = $result_headers[$currentHeader];
1051 $this->headers[] = $result_headers[$currentHeader];
1058 $this->_redirectaddr = $this->_expandlinks($match[1],$URI);
1062 …if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\…
1064 $this->results[] = $results;
1066 $this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
1069 elseif(is_array($this->results))
1070 $this->results[] = $results;
1073 $this->results = $results;
1087 for($x=0; $x<count($this->headers); $x++)
1089 if(preg_match('/^set-cookie:[\s]+([^=]+)=([^;]+)/i', $this->headers[$x],$match))
1090 $this->cookies[$match[1]] = urldecode($match[2]);
1103 if ($this->read_timeout > 0) {
1106 $this->timed_out = true;
1121 if(!empty($this->proxy_host) && !empty($this->proxy_port))
1123 $this->_isproxy = true;
1125 $host = $this->proxy_host;
1126 $port = $this->proxy_port;
1130 $host = $this->host;
1131 $port = $this->port;
1134 $this->status = 0;
1141 $this->_fp_timeout
1151 $this->status = $errno;
1155 $this->error="socket creation failed (-3)";
1157 $this->error="dns lookup failure (-4)";
1159 $this->error="connection refused or timed out (-5)";
1161 $this->error="connection failed (".$errno.")";
1195 switch ($this->_submit_type) {
1209 $this->_mime_boundary = "Snoopy".md5(uniqid(microtime()));
1215 $postdata .= "--".$this->_mime_boundary."\r\n";
1220 $postdata .= "--".$this->_mime_boundary."\r\n";
1237 $postdata .= "--".$this->_mime_boundary."\r\n";
1242 $postdata .= "--".$this->_mime_boundary."--\r\n";