thomascube
2011-12-22 f38dfc294abde08a7296f871397f18c2162f143d
Accept absolute urls without protocol

1 files modified
2 ■■■ changed files
program/lib/washtml.php 2 ●●● patch | view | raw | blame | history
program/lib/washtml.php
@@ -199,7 +199,7 @@
      $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('!^(http:|https:|ftp:|mailto:|//|#).+!i', $value)))
        $t .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES) . '"';
      else if ($key == 'style' && ($style = $this->wash_style($value))) {
        $quot = strpos($style, '"') !== false ? "'" : '"';