Converts shorthand URLs to absolute URLs, unless the given URL is absolute, protocol-relative, or starts with a protocol/fragment/queryelgg_normalize_url(''); // 'http://my.site.com/' elgg_normalize_url('dashboard'); // 'http://my.site.com/dashboard' elgg_normalize_url('http://google.com/'); // no change elgg_normalize_url('//google.com/'); // no change
<?php
}
}
}
}
$view =
'output/excerpt';
];
}
return false;
}
$precision = (int) $precision;
if ($precision < 0) {
$precision = 2;
}
$suffixes = ['B', 'kB', 'MB', 'GB', 'TB'];
return round(pow(1024, $base - floor($base)), $precision) . ' ' . $suffixes[floor($base)];
}
}
}
if (!is_string($unsafe_url)) {
return false;
}
$unsafe_url =
_elgg_services()->urls->normalizeUrl((
string) $unsafe_url);
return $unsafe_url;
}
return false;
}
}
$title = html_entity_decode(
$title ??
'', ENT_QUOTES,
'UTF-8');
}
if (!isset($current_time)) {
$current_time = time();
}
$params = [
'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}", [$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;
}
}
return _elgg_services()->html_formatter->stripTags($string, $allowable_tags);
}
}
if (empty($string)) {
return $string;
}
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);
}