diff --git a/inc/functions.php b/inc/functions.php index 621edf8..95d7a87 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -26,6 +26,13 @@ function cleanString($string) { return str_replace($search, $replace, $string); } +function cleanQuotes($string) { + $search = array("'", "\""); + $replace = array("'", """); + + return str_replace($search, $replace, $string); +} + function plural($count, $singular, $plural) { if ($plural == 's') { $plural = $singular . $plural; diff --git a/inc/html.php b/inc/html.php index 59d5ba2..0985344 100644 --- a/inc/html.php +++ b/inc/html.php @@ -95,8 +95,8 @@ function _makeLinksClickable($matches) { if (!isset($matches[1])) { return ''; } - $url = str_replace('&', '&', htmlspecialchars($matches[1], ENT_QUOTES)); - $text = htmlentities($matches[1], ENT_QUOTES); + $url = cleanQuotes($matches[1]); + $text = $matches[1]; return '' . $text . ''; }