From 51809bd66c3dc08fb578950a0394c8603a419b9e Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 8 Jun 2012 08:53:07 +0200 Subject: Fix handling of links with various URI schemes e.g. "skype:" (#1488106) Fix handling of links inside PRE elements on html to text conversion Fix indexing of links on html to text conversion Conflicts: CHANGELOG --- program/lib/washtml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'program/lib/washtml.php') diff --git a/program/lib/washtml.php b/program/lib/washtml.php index 4221abdef..6ea59f03f 100644 --- a/program/lib/washtml.php +++ b/program/lib/washtml.php @@ -202,7 +202,7 @@ class washtml $key = strtolower($key); $value = $node->getAttribute($key); if (isset($this->_html_attribs[$key]) || - ($key == 'href' && preg_match('!^(http:|https:|ftp:|mailto:|//|#).+!i', $value))) + ($key == 'href' && preg_match('!^([a-z][a-z0-9.+-]+:|//|#).+!i', $value))) $t .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES) . '"'; else if ($key == 'style' && ($style = $this->wash_style($value))) { $quot = strpos($style, '"') !== false ? "'" : '"'; -- cgit v1.2.3