Commit 2357bf76 authored by Simon Welsh's avatar Simon Welsh

Remove dead code

parent 97ce2036
...@@ -107,23 +107,5 @@ class :logs:log extends :x:element { ...@@ -107,23 +107,5 @@ class :logs:log extends :x:element {
} else { } else {
return $string; return $string;
} }
return preg_replace_callback("#$pattern#ix", function($matches) use($string) {
$input = $matches[0];
if(isset($matches[2]) && empty($matches[3]) && in_array(strtolower($matches[2]), ['php', 'yml', 'yaml', 'ss', 'xml', 'jpg', 'png', 'gif', 'jpeg', 'form', 'log', 'lock', 'json', 'main'])) {
return $input;
}
if(strrpos($input, '&') && strrpos($input, '&') != strrpos($input, '&')) {
list($input, $right) = explode('&', $input, 2);
$right = "&$right";
} else {
$right = '';
}
if(in_array(substr($input, -1), ['.',',','?'])) {
$right = substr($input, -1) . $right;
$input = substr($input, 0, -1);
}
$url = preg_match('!^https?://!i', $input) ? $input : "http://$input";
return '<a href="' . $url . '" rel="nofollow" target="_blank">' . "$input</a>$right";
}, $string);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment