Converts shorthand urls to absolute urls.No change is made if the URL: is absolute, protocol-relative, starts with a protocol/fragment/query.
<?php
$linkify = new \Misd\Linkify\Linkify();
return $linkify->processUrls(
$text, [
'attr' => [
'rel' =>
'nofollow']]);
}
$linkify = new \Misd\Linkify\Linkify();
return $linkify->processEmails(
$text, [
'attr' => [
'rel' =>
'nofollow']]);
}
}
$view =
'output/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 '';
}
if (0 !== strpos(
$attr,
'data-') &&
false !== strpos(
$attr,
'_')) {
continue;
}
if (!isset($val) || $val === false) {
continue;
}
if ($val === true) {
}
if (is_scalar($val)) {
$val = [$val];
}
if (!is_array($val)) {
continue;
}
$filtered_val = array_filter($val,
function(
$e) {
});
if (count($val) != count($filtered_val)) {
continue;
}
$val = implode(' ', $val);
$val = htmlspecialchars($val, ENT_QUOTES, 'UTF-8', false);
}
}
if (is_array($tag_name)) {
throw new \InvalidArgumentException('If $tag_name is an array, the other arguments must not be set');
}
if (isset(
$args[
'#tag_name'])) {
$tag_name =
$args[
'#tag_name'];
}
if (isset(
$args[
'#text'])) {
}
if (isset(
$args[
'#options'])) {
}
}
if (!is_string($tag_name) || $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 (preg_match(
"#^([a-z]+)\\:#",
$url,
$m)) {
if (
$m[1] !==
'http' &&
$m[1] !==
'https') {
}
}
if (preg_match(
"#^(\\#|\\?|//)#",
$url)) {
}
if (preg_match(
"#^[^/]*\\.php(\\?.*)?$#",
$url)) {
}
if (preg_match(
"#^[^/?]*\\.#",
$url)) {
return "http://$url";
}
}
if (!is_string($unsafe_url)) {
return false;
}
return $unsafe_url;
}
return false;
}
}
}
if (!$current_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);
}
$res = filter_var(
$url, FILTER_VALIDATE_URL);
if ($res) {
return $res;
}
if (strlen(
$url) == $l) {
return $res;
}
$s = '';
for ($i = 0; $i < $l; ++$i) {
$s .= (strlen($ch) > 1) ? 'X' : $ch;
}
return filter_var($s, FILTER_VALIDATE_URL) ?
$url :
false;
}
};