Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu...
File: class-snoopy.php
{
[500] Fix | Delete
if(is_array($this->results))
[501] Fix | Delete
{
[502] Fix | Delete
for($x=0;$x<count($this->results);$x++)
[503] Fix | Delete
$this->results[$x] = $this->_striptext($this->results[$x]);
[504] Fix | Delete
}
[505] Fix | Delete
else
[506] Fix | Delete
$this->results = $this->_striptext($this->results);
[507] Fix | Delete
return true;
[508] Fix | Delete
}
[509] Fix | Delete
else
[510] Fix | Delete
return false;
[511] Fix | Delete
}
[512] Fix | Delete
[513] Fix | Delete
/*======================================================================*\
[514] Fix | Delete
Function: submitlinks
[515] Fix | Delete
Purpose: grab links from a form submission
[516] Fix | Delete
Input: $URI where you are submitting from
[517] Fix | Delete
Output: $this->results an array of the links from the post
[518] Fix | Delete
\*======================================================================*/
[519] Fix | Delete
[520] Fix | Delete
function submitlinks($URI, $formvars="", $formfiles="")
[521] Fix | Delete
{
[522] Fix | Delete
if($this->submit($URI,$formvars, $formfiles))
[523] Fix | Delete
{
[524] Fix | Delete
if($this->lastredirectaddr)
[525] Fix | Delete
$URI = $this->lastredirectaddr;
[526] Fix | Delete
if(is_array($this->results))
[527] Fix | Delete
{
[528] Fix | Delete
for($x=0;$x<count($this->results);$x++)
[529] Fix | Delete
{
[530] Fix | Delete
$this->results[$x] = $this->_striplinks($this->results[$x]);
[531] Fix | Delete
if($this->expandlinks)
[532] Fix | Delete
$this->results[$x] = $this->_expandlinks($this->results[$x],$URI);
[533] Fix | Delete
}
[534] Fix | Delete
}
[535] Fix | Delete
else
[536] Fix | Delete
{
[537] Fix | Delete
$this->results = $this->_striplinks($this->results);
[538] Fix | Delete
if($this->expandlinks)
[539] Fix | Delete
$this->results = $this->_expandlinks($this->results,$URI);
[540] Fix | Delete
}
[541] Fix | Delete
return true;
[542] Fix | Delete
}
[543] Fix | Delete
else
[544] Fix | Delete
return false;
[545] Fix | Delete
}
[546] Fix | Delete
[547] Fix | Delete
/*======================================================================*\
[548] Fix | Delete
Function: submittext
[549] Fix | Delete
Purpose: grab text from a form submission
[550] Fix | Delete
Input: $URI where you are submitting from
[551] Fix | Delete
Output: $this->results the text from the web page
[552] Fix | Delete
\*======================================================================*/
[553] Fix | Delete
[554] Fix | Delete
function submittext($URI, $formvars = "", $formfiles = "")
[555] Fix | Delete
{
[556] Fix | Delete
if($this->submit($URI,$formvars, $formfiles))
[557] Fix | Delete
{
[558] Fix | Delete
if($this->lastredirectaddr)
[559] Fix | Delete
$URI = $this->lastredirectaddr;
[560] Fix | Delete
if(is_array($this->results))
[561] Fix | Delete
{
[562] Fix | Delete
for($x=0;$x<count($this->results);$x++)
[563] Fix | Delete
{
[564] Fix | Delete
$this->results[$x] = $this->_striptext($this->results[$x]);
[565] Fix | Delete
if($this->expandlinks)
[566] Fix | Delete
$this->results[$x] = $this->_expandlinks($this->results[$x],$URI);
[567] Fix | Delete
}
[568] Fix | Delete
}
[569] Fix | Delete
else
[570] Fix | Delete
{
[571] Fix | Delete
$this->results = $this->_striptext($this->results);
[572] Fix | Delete
if($this->expandlinks)
[573] Fix | Delete
$this->results = $this->_expandlinks($this->results,$URI);
[574] Fix | Delete
}
[575] Fix | Delete
return true;
[576] Fix | Delete
}
[577] Fix | Delete
else
[578] Fix | Delete
return false;
[579] Fix | Delete
}
[580] Fix | Delete
[581] Fix | Delete
[582] Fix | Delete
[583] Fix | Delete
/*======================================================================*\
[584] Fix | Delete
Function: set_submit_multipart
[585] Fix | Delete
Purpose: Set the form submission content type to
[586] Fix | Delete
multipart/form-data
[587] Fix | Delete
\*======================================================================*/
[588] Fix | Delete
function set_submit_multipart()
[589] Fix | Delete
{
[590] Fix | Delete
$this->_submit_type = "multipart/form-data";
[591] Fix | Delete
}
[592] Fix | Delete
[593] Fix | Delete
[594] Fix | Delete
/*======================================================================*\
[595] Fix | Delete
Function: set_submit_normal
[596] Fix | Delete
Purpose: Set the form submission content type to
[597] Fix | Delete
application/x-www-form-urlencoded
[598] Fix | Delete
\*======================================================================*/
[599] Fix | Delete
function set_submit_normal()
[600] Fix | Delete
{
[601] Fix | Delete
$this->_submit_type = "application/x-www-form-urlencoded";
[602] Fix | Delete
}
[603] Fix | Delete
[604] Fix | Delete
[605] Fix | Delete
[606] Fix | Delete
[607] Fix | Delete
/*======================================================================*\
[608] Fix | Delete
Private functions
[609] Fix | Delete
\*======================================================================*/
[610] Fix | Delete
[611] Fix | Delete
[612] Fix | Delete
/*======================================================================*\
[613] Fix | Delete
Function: _striplinks
[614] Fix | Delete
Purpose: strip the hyperlinks from an html document
[615] Fix | Delete
Input: $document document to strip.
[616] Fix | Delete
Output: $match an array of the links
[617] Fix | Delete
\*======================================================================*/
[618] Fix | Delete
[619] Fix | Delete
function _striplinks($document)
[620] Fix | Delete
{
[621] Fix | Delete
preg_match_all("'<\s*a\s.*?href\s*=\s* # find <a href=
[622] Fix | Delete
([\"\'])? # find single or double quote
[623] Fix | Delete
(?(1) (.*?)\\1 | ([^\s\>]+)) # if quote found, match up to next matching
[624] Fix | Delete
# quote, otherwise match up to next space
[625] Fix | Delete
'isx",$document,$links);
[626] Fix | Delete
[627] Fix | Delete
[628] Fix | Delete
// catenate the non-empty matches from the conditional subpattern
[629] Fix | Delete
[630] Fix | Delete
foreach ( $links[2] as $key => $val )
[631] Fix | Delete
{
[632] Fix | Delete
if(!empty($val))
[633] Fix | Delete
$match[] = $val;
[634] Fix | Delete
}
[635] Fix | Delete
[636] Fix | Delete
foreach ( $links[3] as $key => $val )
[637] Fix | Delete
{
[638] Fix | Delete
if(!empty($val))
[639] Fix | Delete
$match[] = $val;
[640] Fix | Delete
}
[641] Fix | Delete
[642] Fix | Delete
// return the links
[643] Fix | Delete
return $match;
[644] Fix | Delete
}
[645] Fix | Delete
[646] Fix | Delete
/*======================================================================*\
[647] Fix | Delete
Function: _stripform
[648] Fix | Delete
Purpose: strip the form elements from an html document
[649] Fix | Delete
Input: $document document to strip.
[650] Fix | Delete
Output: $match an array of the links
[651] Fix | Delete
\*======================================================================*/
[652] Fix | Delete
[653] Fix | Delete
function _stripform($document)
[654] Fix | Delete
{
[655] Fix | Delete
preg_match_all("'<\/?(FORM|INPUT|SELECT|TEXTAREA|(OPTION))[^<>]*>(?(2)(.*(?=<\/?(option|select)[^<>]*>[\r\n]*)|(?=[\r\n]*))|(?=[\r\n]*))'Usi",$document,$elements);
[656] Fix | Delete
[657] Fix | Delete
// catenate the matches
[658] Fix | Delete
$match = implode("\r\n",$elements[0]);
[659] Fix | Delete
[660] Fix | Delete
// return the links
[661] Fix | Delete
return $match;
[662] Fix | Delete
}
[663] Fix | Delete
[664] Fix | Delete
[665] Fix | Delete
[666] Fix | Delete
/*======================================================================*\
[667] Fix | Delete
Function: _striptext
[668] Fix | Delete
Purpose: strip the text from an html document
[669] Fix | Delete
Input: $document document to strip.
[670] Fix | Delete
Output: $text the resulting text
[671] Fix | Delete
\*======================================================================*/
[672] Fix | Delete
[673] Fix | Delete
function _striptext($document)
[674] Fix | Delete
{
[675] Fix | Delete
[676] Fix | Delete
// I didn't use preg eval (//e) since that is only available in PHP 4.0.
[677] Fix | Delete
// so, list your entities one by one here. I included some of the
[678] Fix | Delete
// more common ones.
[679] Fix | Delete
[680] Fix | Delete
$search = array("'<script[^>]*?>.*?</script>'si", // strip out javascript
[681] Fix | Delete
"'<[\/\!]*?[^<>]*?>'si", // strip out html tags
[682] Fix | Delete
"'([\r\n])[\s]+'", // strip out white space
[683] Fix | Delete
"'&(quot|#34|#034|#x22);'i", // replace html entities
[684] Fix | Delete
"'&(amp|#38|#038|#x26);'i", // added hexadecimal values
[685] Fix | Delete
"'&(lt|#60|#060|#x3c);'i",
[686] Fix | Delete
"'&(gt|#62|#062|#x3e);'i",
[687] Fix | Delete
"'&(nbsp|#160|#xa0);'i",
[688] Fix | Delete
"'&(iexcl|#161);'i",
[689] Fix | Delete
"'&(cent|#162);'i",
[690] Fix | Delete
"'&(pound|#163);'i",
[691] Fix | Delete
"'&(copy|#169);'i",
[692] Fix | Delete
"'&(reg|#174);'i",
[693] Fix | Delete
"'&(deg|#176);'i",
[694] Fix | Delete
"'&(#39|#039|#x27);'",
[695] Fix | Delete
"'&(euro|#8364);'i", // europe
[696] Fix | Delete
"'&a(uml|UML);'", // german
[697] Fix | Delete
"'&o(uml|UML);'",
[698] Fix | Delete
"'&u(uml|UML);'",
[699] Fix | Delete
"'&A(uml|UML);'",
[700] Fix | Delete
"'&O(uml|UML);'",
[701] Fix | Delete
"'&U(uml|UML);'",
[702] Fix | Delete
"'&szlig;'i",
[703] Fix | Delete
);
[704] Fix | Delete
$replace = array( "",
[705] Fix | Delete
"",
[706] Fix | Delete
"\\1",
[707] Fix | Delete
"\"",
[708] Fix | Delete
"&",
[709] Fix | Delete
"<",
[710] Fix | Delete
">",
[711] Fix | Delete
" ",
[712] Fix | Delete
chr(161),
[713] Fix | Delete
chr(162),
[714] Fix | Delete
chr(163),
[715] Fix | Delete
chr(169),
[716] Fix | Delete
chr(174),
[717] Fix | Delete
chr(176),
[718] Fix | Delete
chr(39),
[719] Fix | Delete
chr(128),
[720] Fix | Delete
chr(0xE4), // ANSI &auml;
[721] Fix | Delete
chr(0xF6), // ANSI &ouml;
[722] Fix | Delete
chr(0xFC), // ANSI &uuml;
[723] Fix | Delete
chr(0xC4), // ANSI &Auml;
[724] Fix | Delete
chr(0xD6), // ANSI &Ouml;
[725] Fix | Delete
chr(0xDC), // ANSI &Uuml;
[726] Fix | Delete
chr(0xDF), // ANSI &szlig;
[727] Fix | Delete
);
[728] Fix | Delete
[729] Fix | Delete
$text = preg_replace($search,$replace,$document);
[730] Fix | Delete
[731] Fix | Delete
return $text;
[732] Fix | Delete
}
[733] Fix | Delete
[734] Fix | Delete
/*======================================================================*\
[735] Fix | Delete
Function: _expandlinks
[736] Fix | Delete
Purpose: expand each link into a fully qualified URL
[737] Fix | Delete
Input: $links the links to qualify
[738] Fix | Delete
$URI the full URI to get the base from
[739] Fix | Delete
Output: $expandedLinks the expanded links
[740] Fix | Delete
\*======================================================================*/
[741] Fix | Delete
[742] Fix | Delete
function _expandlinks($links,$URI)
[743] Fix | Delete
{
[744] Fix | Delete
[745] Fix | Delete
preg_match("/^[^\?]+/",$URI,$match);
[746] Fix | Delete
[747] Fix | Delete
$match = preg_replace("|/[^\/\.]+\.[^\/\.]+$|","",$match[0]);
[748] Fix | Delete
$match = preg_replace("|/$|","",$match);
[749] Fix | Delete
$match_part = parse_url($match);
[750] Fix | Delete
$match_root =
[751] Fix | Delete
$match_part["scheme"]."://".$match_part["host"];
[752] Fix | Delete
[753] Fix | Delete
$search = array( "|^http://".preg_quote($this->host)."|i",
[754] Fix | Delete
"|^(\/)|i",
[755] Fix | Delete
"|^(?!http://)(?!mailto:)|i",
[756] Fix | Delete
"|/\./|",
[757] Fix | Delete
"|/[^\/]+/\.\./|"
[758] Fix | Delete
);
[759] Fix | Delete
[760] Fix | Delete
$replace = array( "",
[761] Fix | Delete
$match_root."/",
[762] Fix | Delete
$match."/",
[763] Fix | Delete
"/",
[764] Fix | Delete
"/"
[765] Fix | Delete
);
[766] Fix | Delete
[767] Fix | Delete
$expandedLinks = preg_replace($search,$replace,$links);
[768] Fix | Delete
[769] Fix | Delete
return $expandedLinks;
[770] Fix | Delete
}
[771] Fix | Delete
[772] Fix | Delete
/*======================================================================*\
[773] Fix | Delete
Function: _httprequest
[774] Fix | Delete
Purpose: go get the http data from the server
[775] Fix | Delete
Input: $url the url to fetch
[776] Fix | Delete
$fp the current open file pointer
[777] Fix | Delete
$URI the full URI
[778] Fix | Delete
$body body contents to send if any (POST)
[779] Fix | Delete
Output:
[780] Fix | Delete
\*======================================================================*/
[781] Fix | Delete
[782] Fix | Delete
function _httprequest($url,$fp,$URI,$http_method,$content_type="",$body="")
[783] Fix | Delete
{
[784] Fix | Delete
$cookie_headers = '';
[785] Fix | Delete
if($this->passcookies && $this->_redirectaddr)
[786] Fix | Delete
$this->setcookies();
[787] Fix | Delete
[788] Fix | Delete
$URI_PARTS = parse_url($URI);
[789] Fix | Delete
if(empty($url))
[790] Fix | Delete
$url = "/";
[791] Fix | Delete
$headers = $http_method." ".$url." ".$this->_httpversion."\r\n";
[792] Fix | Delete
if(!empty($this->agent))
[793] Fix | Delete
$headers .= "User-Agent: ".$this->agent."\r\n";
[794] Fix | Delete
if(!empty($this->host) && !isset($this->rawheaders['Host'])) {
[795] Fix | Delete
$headers .= "Host: ".$this->host;
[796] Fix | Delete
if(!empty($this->port) && $this->port != 80)
[797] Fix | Delete
$headers .= ":".$this->port;
[798] Fix | Delete
$headers .= "\r\n";
[799] Fix | Delete
}
[800] Fix | Delete
if(!empty($this->accept))
[801] Fix | Delete
$headers .= "Accept: ".$this->accept."\r\n";
[802] Fix | Delete
if(!empty($this->referer))
[803] Fix | Delete
$headers .= "Referer: ".$this->referer."\r\n";
[804] Fix | Delete
if(!empty($this->cookies))
[805] Fix | Delete
{
[806] Fix | Delete
if(!is_array($this->cookies))
[807] Fix | Delete
$this->cookies = (array)$this->cookies;
[808] Fix | Delete
[809] Fix | Delete
reset($this->cookies);
[810] Fix | Delete
if ( count($this->cookies) > 0 ) {
[811] Fix | Delete
$cookie_headers .= 'Cookie: ';
[812] Fix | Delete
foreach ( $this->cookies as $cookieKey => $cookieVal ) {
[813] Fix | Delete
$cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; ";
[814] Fix | Delete
}
[815] Fix | Delete
$headers .= substr($cookie_headers,0,-2) . "\r\n";
[816] Fix | Delete
}
[817] Fix | Delete
}
[818] Fix | Delete
if(!empty($this->rawheaders))
[819] Fix | Delete
{
[820] Fix | Delete
if(!is_array($this->rawheaders))
[821] Fix | Delete
$this->rawheaders = (array)$this->rawheaders;
[822] Fix | Delete
foreach ( $this->rawheaders as $headerKey => $headerVal )
[823] Fix | Delete
$headers .= $headerKey.": ".$headerVal."\r\n";
[824] Fix | Delete
}
[825] Fix | Delete
if(!empty($content_type)) {
[826] Fix | Delete
$headers .= "Content-Type: $content_type";
[827] Fix | Delete
if ($content_type == "multipart/form-data")
[828] Fix | Delete
$headers .= "; boundary=".$this->_mime_boundary;
[829] Fix | Delete
$headers .= "\r\n";
[830] Fix | Delete
}
[831] Fix | Delete
if(!empty($body))
[832] Fix | Delete
$headers .= "Content-Length: ".strlen($body)."\r\n";
[833] Fix | Delete
if(!empty($this->user) || !empty($this->pass))
[834] Fix | Delete
$headers .= "Authorization: Basic ".base64_encode($this->user.":".$this->pass)."\r\n";
[835] Fix | Delete
[836] Fix | Delete
//add proxy auth headers
[837] Fix | Delete
if(!empty($this->proxy_user))
[838] Fix | Delete
$headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass)."\r\n";
[839] Fix | Delete
[840] Fix | Delete
[841] Fix | Delete
$headers .= "\r\n";
[842] Fix | Delete
[843] Fix | Delete
// set the read timeout if needed
[844] Fix | Delete
if ($this->read_timeout > 0)
[845] Fix | Delete
socket_set_timeout($fp, $this->read_timeout);
[846] Fix | Delete
$this->timed_out = false;
[847] Fix | Delete
[848] Fix | Delete
fwrite($fp,$headers.$body,strlen($headers.$body));
[849] Fix | Delete
[850] Fix | Delete
$this->_redirectaddr = false;
[851] Fix | Delete
unset($this->headers);
[852] Fix | Delete
[853] Fix | Delete
while($currentHeader = fgets($fp,$this->_maxlinelen))
[854] Fix | Delete
{
[855] Fix | Delete
if ($this->read_timeout > 0 && $this->_check_timeout($fp))
[856] Fix | Delete
{
[857] Fix | Delete
$this->status=-100;
[858] Fix | Delete
return false;
[859] Fix | Delete
}
[860] Fix | Delete
[861] Fix | Delete
if($currentHeader == "\r\n")
[862] Fix | Delete
break;
[863] Fix | Delete
[864] Fix | Delete
// if a header begins with Location: or URI:, set the redirect
[865] Fix | Delete
if(preg_match("/^(Location:|URI:)/i",$currentHeader))
[866] Fix | Delete
{
[867] Fix | Delete
// get URL portion of the redirect
[868] Fix | Delete
preg_match("/^(Location:|URI:)[ ]+(.*)/i",chop($currentHeader),$matches);
[869] Fix | Delete
// look for :// in the Location header to see if hostname is included
[870] Fix | Delete
if(!preg_match("|\:\/\/|",$matches[2]))
[871] Fix | Delete
{
[872] Fix | Delete
// no host in the path, so prepend
[873] Fix | Delete
$this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port;
[874] Fix | Delete
// eliminate double slash
[875] Fix | Delete
if(!preg_match("|^/|",$matches[2]))
[876] Fix | Delete
$this->_redirectaddr .= "/".$matches[2];
[877] Fix | Delete
else
[878] Fix | Delete
$this->_redirectaddr .= $matches[2];
[879] Fix | Delete
}
[880] Fix | Delete
else
[881] Fix | Delete
$this->_redirectaddr = $matches[2];
[882] Fix | Delete
}
[883] Fix | Delete
[884] Fix | Delete
if(preg_match("|^HTTP/|",$currentHeader))
[885] Fix | Delete
{
[886] Fix | Delete
if(preg_match("|^HTTP/[^\s]*\s(.*?)\s|",$currentHeader, $status))
[887] Fix | Delete
{
[888] Fix | Delete
$this->status= $status[1];
[889] Fix | Delete
}
[890] Fix | Delete
$this->response_code = $currentHeader;
[891] Fix | Delete
}
[892] Fix | Delete
[893] Fix | Delete
$this->headers[] = $currentHeader;
[894] Fix | Delete
}
[895] Fix | Delete
[896] Fix | Delete
$results = '';
[897] Fix | Delete
do {
[898] Fix | Delete
$_data = fread($fp, $this->maxlength);
[899] Fix | Delete
if (strlen($_data) == 0) {
[900] Fix | Delete
break;
[901] Fix | Delete
}
[902] Fix | Delete
$results .= $_data;
[903] Fix | Delete
} while(true);
[904] Fix | Delete
[905] Fix | Delete
if ($this->read_timeout > 0 && $this->_check_timeout($fp))
[906] Fix | Delete
{
[907] Fix | Delete
$this->status=-100;
[908] Fix | Delete
return false;
[909] Fix | Delete
}
[910] Fix | Delete
[911] Fix | Delete
// check if there is a redirect meta tag
[912] Fix | Delete
[913] Fix | Delete
if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
[914] Fix | Delete
[915] Fix | Delete
{
[916] Fix | Delete
$this->_redirectaddr = $this->_expandlinks($match[1],$URI);
[917] Fix | Delete
}
[918] Fix | Delete
[919] Fix | Delete
// have we hit our frame depth and is there frame src to fetch?
[920] Fix | Delete
if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match))
[921] Fix | Delete
{
[922] Fix | Delete
$this->results[] = $results;
[923] Fix | Delete
for($x=0; $x<count($match[1]); $x++)
[924] Fix | Delete
$this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
[925] Fix | Delete
}
[926] Fix | Delete
// have we already fetched framed content?
[927] Fix | Delete
elseif(is_array($this->results))
[928] Fix | Delete
$this->results[] = $results;
[929] Fix | Delete
// no framed content
[930] Fix | Delete
else
[931] Fix | Delete
$this->results = $results;
[932] Fix | Delete
[933] Fix | Delete
return true;
[934] Fix | Delete
}
[935] Fix | Delete
[936] Fix | Delete
/*======================================================================*\
[937] Fix | Delete
Function: _httpsrequest
[938] Fix | Delete
Purpose: go get the https data from the server using curl
[939] Fix | Delete
Input: $url the url to fetch
[940] Fix | Delete
$URI the full URI
[941] Fix | Delete
$body body contents to send if any (POST)
[942] Fix | Delete
Output:
[943] Fix | Delete
\*======================================================================*/
[944] Fix | Delete
[945] Fix | Delete
function _httpsrequest($url,$URI,$http_method,$content_type="",$body="")
[946] Fix | Delete
{
[947] Fix | Delete
if($this->passcookies && $this->_redirectaddr)
[948] Fix | Delete
$this->setcookies();
[949] Fix | Delete
[950] Fix | Delete
$headers = array();
[951] Fix | Delete
[952] Fix | Delete
$URI_PARTS = parse_url($URI);
[953] Fix | Delete
if(empty($url))
[954] Fix | Delete
$url = "/";
[955] Fix | Delete
// GET ... header not needed for curl
[956] Fix | Delete
//$headers[] = $http_method." ".$url." ".$this->_httpversion;
[957] Fix | Delete
if(!empty($this->agent))
[958] Fix | Delete
$headers[] = "User-Agent: ".$this->agent;
[959] Fix | Delete
if(!empty($this->host))
[960] Fix | Delete
if(!empty($this->port))
[961] Fix | Delete
$headers[] = "Host: ".$this->host.":".$this->port;
[962] Fix | Delete
else
[963] Fix | Delete
$headers[] = "Host: ".$this->host;
[964] Fix | Delete
if(!empty($this->accept))
[965] Fix | Delete
$headers[] = "Accept: ".$this->accept;
[966] Fix | Delete
if(!empty($this->referer))
[967] Fix | Delete
$headers[] = "Referer: ".$this->referer;
[968] Fix | Delete
if(!empty($this->cookies))
[969] Fix | Delete
{
[970] Fix | Delete
if(!is_array($this->cookies))
[971] Fix | Delete
$this->cookies = (array)$this->cookies;
[972] Fix | Delete
[973] Fix | Delete
reset($this->cookies);
[974] Fix | Delete
if ( count($this->cookies) > 0 ) {
[975] Fix | Delete
$cookie_str = 'Cookie: ';
[976] Fix | Delete
foreach ( $this->cookies as $cookieKey => $cookieVal ) {
[977] Fix | Delete
$cookie_str .= $cookieKey."=".urlencode($cookieVal)."; ";
[978] Fix | Delete
}
[979] Fix | Delete
$headers[] = substr($cookie_str,0,-2);
[980] Fix | Delete
}
[981] Fix | Delete
}
[982] Fix | Delete
if(!empty($this->rawheaders))
[983] Fix | Delete
{
[984] Fix | Delete
if(!is_array($this->rawheaders))
[985] Fix | Delete
$this->rawheaders = (array)$this->rawheaders;
[986] Fix | Delete
foreach ( $this->rawheaders as $headerKey => $headerVal )
[987] Fix | Delete
$headers[] = $headerKey.": ".$headerVal;
[988] Fix | Delete
}
[989] Fix | Delete
if(!empty($content_type)) {
[990] Fix | Delete
if ($content_type == "multipart/form-data")
[991] Fix | Delete
$headers[] = "Content-Type: $content_type; boundary=".$this->_mime_boundary;
[992] Fix | Delete
else
[993] Fix | Delete
$headers[] = "Content-Type: $content_type";
[994] Fix | Delete
}
[995] Fix | Delete
if(!empty($body))
[996] Fix | Delete
$headers[] = "Content-Length: ".strlen($body);
[997] Fix | Delete
if(!empty($this->user) || !empty($this->pass))
[998] Fix | Delete
$headers[] = "Authorization: BASIC ".base64_encode($this->user.":".$this->pass);
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function