X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=d365122951579613f8a90b2f610dc8c91f890253;hb=2e1f74397c3fccc8cedaad0c16c0ec658e2ed783;hp=9866077d23b1dcdfa05c655153d012d10ab104fe;hpb=69f4db9e1229e9dacd0d71ecd3ac13c1647bc36d;p=friendica.git diff --git a/boot.php b/boot.php index 9866077d23..d365122951 100644 --- a/boot.php +++ b/boot.php @@ -1,12 +1,8 @@ \r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -139,7 +135,7 @@ define ( 'NAMESPACE_POCO', 'http://portablecontacts.net/spec/1.0' ); define ( 'NAMESPACE_FEED', 'http://schemas.google.com/g/2010#updates-from' ); define ( 'NAMESPACE_OSTATUS', 'http://ostatus.org/schema/1.0' ); define ( 'NAMESPACE_STATUSNET', 'http://status.net/schema/api/1/' ); - +define ( 'NAMESPACE_ATOM1', 'http://www.w3.org/2005/Atom' ); /** * activity stream defines */ @@ -179,20 +175,28 @@ define ( 'GRAVITY_COMMENT', 6); * */ -if (get_magic_quotes_gpc()) { - $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); - while (list($key, $val) = each($process)) { - foreach ($val as $k => $v) { - unset($process[$key][$k]); - if (is_array($v)) { - $process[$key][stripslashes($k)] = $v; - $process[] = &$process[$key][stripslashes($k)]; - } else { - $process[$key][stripslashes($k)] = stripslashes($v); - } - } - } - unset($process); +function startup() { + error_reporting(E_ERROR | E_WARNING | E_PARSE); + set_time_limit(0); + ini_set('pcre.backtrack_limit', 250000); + + + if (get_magic_quotes_gpc()) { + $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); + while (list($key, $val) = each($process)) { + foreach ($val as $k => $v) { + unset($process[$key][$k]); + if (is_array($v)) { + $process[$key][stripslashes($k)] = $v; + $process[] = &$process[$key][stripslashes($k)]; + } else { + $process[$key][stripslashes($k)] = stripslashes($v); + } + } + } + unset($process); + } + } /* @@ -260,6 +264,8 @@ class App { $this->query_string = ''; + startup(); + $this->scheme = ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'])) ? 'https' : 'http' ); if(x($_SERVER,'SERVER_NAME')) { @@ -774,8 +780,8 @@ function post_url($url,$params, $headers = null, &$redirects = 0) { } } } - - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + if($headers) + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $check_cert = get_config('system','verifyssl'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false)); @@ -2951,3 +2957,15 @@ function return_bytes ($size_str) { } }} +function generate_guid() { + $found = true; + do { + $guid = substr(random_string(),0,16); + $x = q("SELECT `uid` FROM `user` WHERE `guid` = '%s' LIMIT 1", + dbesc($guid) + ); + if(! count($x)) + $found = false; + } while ($found == true ); + return $guid; +} \ No newline at end of file