// curl wrapper. If binary flag is true, return binary
-// results.
+// results.
// Set the cookiejar argument to a string (e.g. "/tmp/friendica-cookies.txt")
// to preserve cookies from one request to the next.
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
}
-// These settings aren't needed. We're following the location already.
+// These settings aren't needed. We're following the location already.
// @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// @curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
}}
// Generic XML return
-// Outputs a basic dfrn XML status structure to STDOUT, with a <status> variable
-// of $st and an optional text <message> of $message and terminates the current process.
+// Outputs a basic dfrn XML status structure to STDOUT, with a <status> variable
+// of $st and an optional text <message> of $message and terminates the current process.
if(! function_exists('xml_status')) {
function xml_status($st, $message = '') {
if($val >= 200 && $val < 300)
$err = 'OK';
- logger('http_status_exit ' . $val);
+ logger('http_status_exit ' . $val);
header($_SERVER["SERVER_PROTOCOL"] . ' ' . $val . ' ' . $err);
killme();
}
}}
-// Given an email style address, perform webfinger lookup and
+// Given an email style address, perform webfinger lookup and
// return the resulting DFRN profile URL, or if no DFRN profile URL
-// is located, returns an OStatus subscription template (prefixed
+// is located, returns an OStatus subscription template (prefixed
// with the string 'stat:' to identify it as on OStatus template).
// If this isn't an email style address just return $s.
// Return an empty string if email-style addresses but webfinger fails,
-// or if the resultant personal XRD doesn't contain a supported
+// or if the resultant personal XRD doesn't contain a supported
// subscription/friend-request attribute.
-// amended 7/9/2011 to return an hcard which could save potentially loading
+// amended 7/9/2011 to return an hcard which could save potentially loading
// a lengthy content page to scrape dfrn attributes
if(! function_exists('webfinger_dfrn')) {
return $profile_link;
}}
-// Given an email style address, perform webfinger lookup and
+// Given an email style address, perform webfinger lookup and
// return the array of link attributes from the personal XRD file.
// On error/failure return an empty array.
// All we have is an email address. Resource-priority is irrelevant
// because our URI isn't directly resolvable.
- if(strstr($uri,'@')) {
+ if(strstr($uri,'@')) {
return(webfinger($uri));
}
foreach($properties as $prop)
if((string) $prop['@attributes'] === 'http://lrdd.net/priority/resource')
$priority = 'resource';
- }
+ }
// save the links in case we need them
$tpl = '';
if($priority === 'host') {
- if(strlen($tpl))
+ if(strlen($tpl))
$pxrd = str_replace('{uri}', urlencode($uri), $tpl);
elseif(isset($href))
$pxrd = $href;
if(! function_exists('validate_url')) {
function validate_url(&$url) {
+
+ if(get_config('system','disable_url_validation'))
+ return true;
// no naked subdomains (allow localhost for tests)
if(strpos($url,'.') === false && strpos($url,'/localhost/') === false)
return false;
foreach($allowed as $a) {
$pat = strtolower(trim($a));
if(($fnmatch && fnmatch($pat,$host)) || ($pat == $host)) {
- $found = true;
+ $found = true;
break;
}
}
foreach($allowed as $a) {
$pat = strtolower(trim($a));
if(($fnmatch && fnmatch($pat,$domain)) || ($pat == $domain)) {
- $found = true;
+ $found = true;
break;
}
}
$new_height = $ph->getHeight();
logger('scale_external_images: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], LOGGER_DEBUG);
$s = str_replace($mtch[0],'[img=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/img]'
- . "\n" . (($include_link)
+ . "\n" . (($include_link)
? '[url=' . $mtch[1] . ']' . t('view full size') . '[/url]' . "\n"
: ''),$s);
logger('scale_external_images: new string: ' . $s, LOGGER_DEBUG);
}
if($ssl_changed) {
- q("update contact set
- url = '%s',
+ q("update contact set
+ url = '%s',
request = '%s',
notify = '%s',
poll = '%s',
return array();
}
- xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8");
+ xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8");
// http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);