diff options
| author | 2014-08-24 15:29:09 +0200 | |
|---|---|---|
| committer | 2014-08-24 15:29:09 +0200 | |
| commit | 07444280d1a03daa7880c1539bde3a6e80945dab (patch) | |
| tree | c328a11f59e07d12e624576ed86b11ada1b9d198 /lib/lib_rss.php | |
| parent | 1d2527b8bc2a125cc8b8508402417f60d314e330 (diff) | |
| parent | d1f79fee69a3667913f419cd9726ffb11f410bd0 (diff) | |
Merge branch 'dev' into beta
Conflicts:
README.md
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 7ca611b04..823f53716 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -121,10 +121,10 @@ function customSimplePie() { 'onmouseover', 'onmousemove', 'onmouseout', 'onfocus', 'onblur', 'onkeypress', 'onkeydown', 'onkeyup', 'onselect', 'onchange', 'seamless'))); $simplePie->add_attributes(array( - 'img' => array('lazyload' => ''), //http://www.w3.org/TR/resource-priorities/ - 'audio' => array('preload' => 'none'), - 'iframe' => array('postpone' => '', 'sandbox' => 'allow-scripts allow-same-origin'), - 'video' => array('postpone' => '', 'preload' => 'none'), + 'img' => array('lazyload' => '', 'postpone' => ''), //http://www.w3.org/TR/resource-priorities/ + 'audio' => array('lazyload' => '', 'postpone' => '', 'preload' => 'none'), + 'iframe' => array('lazyload' => '', 'postpone' => '', 'sandbox' => 'allow-scripts allow-same-origin'), + 'video' => array('lazyload' => '', 'postpone' => '', 'preload' => 'none'), )); $simplePie->set_url_replacements(array( 'a' => 'href', @@ -183,16 +183,8 @@ function get_content_by_parsing ($url, $path) { */ function lazyimg($content) { return preg_replace( - '/<img([^>]+?)src=[\'"]([^"\']+)[\'"]([^>]*)>/i', - '<img$1src="' . Minz_Url::display('/themes/icons/grey.gif') . '" data-original="$2"$3>', - $content - ); -} - -function lazyIframe($content) { - return preg_replace( - '/<iframe([^>]+?)src=[\'"]([^"\']+)[\'"]([^>]*)>/i', - '<iframe$1src="about:blank" data-original="$2"$3>', + '/<((?:img|iframe)[^>]+?)src=[\'"]([^"\']+)[\'"]([^>]*)>/i', + '<$1src="' . Minz_Url::display('/themes/icons/grey.gif') . '" data-original="$2"$3>', $content ); } @@ -238,7 +230,3 @@ function cryptAvailable() { } return false; } - -function html_chars_utf8($str) { - return htmlspecialchars($str, ENT_COMPAT, 'UTF-8'); -} |
