Converts shorthand urls to absolute urls.If the url is already absolute or protocol-relative, no change is made.
<?php
$r = preg_replace_callback(
'/(?<![=\/"\'])((ht|f)tps?:\/\/[^\s\r\n\t<>"\']+)/i',
create_function(
'$matches',
'
$url = $matches[1];
$punc = "";
$last = substr($url, -1, 1);
if (in_array($last, array(".", "!", ",", "(", ")"))) {
$punc = $last;
$url = rtrim($url, ".!,()");
}
$urltext = str_replace("/", "/<wbr />", $url);
return "<a href=\"$url\" rel=\"nofollow\">$urltext</a>$punc";
'
}
}
if ($string_length <= $num_chars) {
}
if ($space === false) {
$space = $num_chars;
}
$excerpt .= '...';
}
return $excerpt;
}
return preg_replace(
'/&(?!amp;)/',
'&',
$url);
}
return false;
}
$base = log(
$size) / log(1024);
$suffixes = array('B', 'kB', 'MB', 'GB', 'TB');
return round(pow(1024, $base - floor($base)), $precision) . ' ' . $suffixes[floor($base)];
}
return '';
}
}
}
foreach (
$attrs as $attr => $val) {
$attr = strtolower($attr);
if ($val === true) {
$val = $attr;
}
if ($val !== NULL && $val !== false && (is_array($val) || !is_object($val))) {
if (is_array($val)) {
$val = implode(' ', $val);
}
$val = htmlspecialchars($val, ENT_QUOTES, 'UTF-8', false);
}
}
}
if (!is_string($tag_name)) {
throw new \InvalidArgumentException('$tag_name is required');
}
} else {
$is_void = in_array(strtolower($tag_name), array(
'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem',
'meta', 'param', 'source', 'track', 'wbr'
));
}
$double_encode = empty(
$options[
'double_encode']) ?
false :
true;
$text = htmlspecialchars(
$text, ENT_QUOTES,
'UTF-8', $double_encode);
}
}
} else {
}
if ($is_void) {
return empty(
$options[
'is_xml']) ?
"<{$tag_name}{$attrs}>" :
"<{$tag_name}{$attrs} />";
} else {
return "<{$tag_name}{$attrs}>$text</$tag_name>";
}
}
if (isset(
$vars[
'internalname'])) {
if (!isset(
$vars[
'__ignoreInternalname'])) {
}
unset(
$vars[
'internalname']);
}
if (isset(
$vars[
'internalid'])) {
if (!isset(
$vars[
'__ignoreInternalid'])) {
}
unset(
$vars[
'internalid']);
}
if (isset(
$vars[
'__ignoreInternalid'])) {
unset(
$vars[
'__ignoreInternalid']);
}
if (isset(
$vars[
'__ignoreInternalname'])) {
unset(
$vars[
'__ignoreInternalname']);
}
}
$php_5_2_13_and_below = version_compare(PHP_VERSION, '5.2.14', '<');
$php_5_3_0_to_5_3_2 = version_compare(PHP_VERSION, '5.3.0', '>=') &&
version_compare(PHP_VERSION, '5.3.3', '<');
if ($php_5_2_13_and_below || $php_5_3_0_to_5_3_2) {
$tmp_address = str_replace(
"-",
"",
$url);
$validated = filter_var($tmp_address, FILTER_VALIDATE_URL);
} else {
$validated = filter_var(
$url, FILTER_VALIDATE_URL);
}
if (!$validated && (strpos(
$url,
'http:') === 0) || (strpos(
$url,
'https:') === 0)) {
$validated = true;
}
if ($validated) {
} elseif (preg_match(
"#^(\#|\?|//)#i",
$url)) {
} elseif (stripos(
$url,
'javascript:') === 0 || stripos(
$url,
'mailto:') === 0) {
} elseif (preg_match(
"#^[^/]*\.php(\?.*)?$#i",
$url)) {
} elseif (preg_match(
"#^[^/?]*\.#i",
$url)) {
return "http://$url";
} else {
}
}
}
}
if (!$current_time) {
$current_time = time();
}
$params = array(
'time' => $time,
'current_time' => $current_time);
}
$diff = abs((int)$current_time - (int)$time);
$minute = 60;
$hour = $minute * 60;
$day = $hour * 24;
if ($diff < $minute) {
}
if ($diff < $hour) {
$granularity = ':minutes';
$diff = round($diff / $minute);
} else if ($diff < $day) {
$granularity = ':hours';
$diff = round($diff / $hour);
} else {
$granularity = ':days';
$diff = round($diff / $day);
}
if ($diff == 0) {
$diff = 1;
}
$future = ((int)$current_time - (int)$time < 0) ? ':future' : '';
$singular = ($diff == 1) ? ':singular' : '';
return elgg_echo(
"friendlytime{$future}{$granularity}{$singular}", array($diff));
}
switch ($error_code) {
case UPLOAD_ERR_OK:
return '';
case UPLOAD_ERR_INI_SIZE:
break;
case UPLOAD_ERR_FORM_SIZE:
break;
case UPLOAD_ERR_PARTIAL:
break;
case UPLOAD_ERR_NO_FILE:
break;
case UPLOAD_ERR_NO_TMP_DIR:
break;
case UPLOAD_ERR_CANT_WRITE:
break;
case UPLOAD_ERR_EXTENSION:
break;
default:
break;
}
}
$params[
'allowable_tags'] = $allowable_tags;
}
array('>', '<', '&', '"', '''),
array('&gt;', '&lt;', '&amp;', '&quot;', '&#039;'),
);
array('&gt;', '&lt;', '&amp;', '&quot;', '&#039;'),
array('>', '<', '&', '"', '''),
);
}
if (function_exists('mb_convert_encoding')) {
$display_query = mb_convert_encoding(
$string,
'HTML-ENTITIES',
'UTF-8');
} else {
$display_query = preg_replace(
"/[^\x01-\x7F]/",
"",
$string);
}
return htmlspecialchars($display_query, ENT_QUOTES, 'UTF-8', false);
}
$value[] =
"{$CONFIG->path}engine/tests/ElggCoreOutputAutoPTest.php";
}
}
$events->registerHandler('init', 'system', '_elgg_output_init');
};