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;
}
};
static urlize($string, $separator='-')
Create a version of a string for embedding in a URL.
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
$args
Some servers don't allow PHP to check the rewrite, so try via AJAX.
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
_elgg_view_under_viewtype($view, $vars, $viewtype)
Render a view while the global viewtype is temporarily changed.
elgg_view_exists($view, $viewtype='', $recurse=true)
Returns whether the specified view exists.
elgg_substr()
Wrapper function for mb_substr().
elgg_strlen()
Wrapper function for mb_strlen().
elgg_normalize_site_url($unsafe_url)
From untrusted input, get a site URL safe for forwarding.
elgg_format_url($url)
Handles formatting of ampersands in urls.
elgg_get_friendly_title($title)
When given a title, returns a version suitable for inclusion in a URL.
_elgg_sane_validate_url($url)
Use a "fixed" filter_var() with FILTER_VALIDATE_URL that handles multi-byte chars.
elgg_html_decode($string)
Decode HTML markup into a raw text string.
elgg_format_bytes($size, $precision=2)
Format bytes to a human readable format.
_elgg_html_decode($string)
Alias of elgg_html_decode.
elgg_strip_tags($string, $allowable_tags=null)
Strip tags and offer plugins the chance.
elgg_get_friendly_upload_error($error_code)
Returns a human-readable message for PHP's upload error codes.
elgg_format_attributes(array $attrs=array())
Converts an associative array into a string of well-formed HTML/XML attributes Returns a concatenated...
elgg_parse_emails($text)
Takes a string and turns any email addresses into formatted links.
_elgg_get_display_query($string)
Prepares query string for output to prevent CSRF attacks.
elgg_format_element($tag_name, array $attributes=array(), $text='', array $options=array())
Format an HTML element.
elgg_get_excerpt($text, $num_chars=250)
Returns an excerpt.
parse_urls($text)
Takes a string and turns any URLs into formatted links.
elgg_get_friendly_time($time, $current_time=null)
Formats a UNIX timestamp in a friendly way (eg "less than a minute ago")
elgg_autop($string)
Create paragraphs from text with line spacing.