aboutsummaryrefslogtreecommitdiff
path: root/lib/lib_text.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib_text.php')
-rw-r--r--lib/lib_text.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/lib_text.php b/lib/lib_text.php
index 6e8f7b2bf..9792e191e 100644
--- a/lib/lib_text.php
+++ b/lib/lib_text.php
@@ -86,3 +86,11 @@ function parse_tags ($desc) {
return $desc_parse;
}
+
+function lazyimg($content) {
+ return preg_replace(
+ '/<img([^<]+)src=([\'"])([^"\']*)([\'"])([^<]*)>/i',
+ '<img$1src="' . Url::display('/data/grey.gif') . '" data-original="$3"$5>',
+ $content
+ );
+} \ No newline at end of file