LightboxGallery.php
changeset 3 b52509cf73af
parent 2 e7eb457efdff
child 4 c2458c3b0365
equal deleted inserted replaced
2:e7eb457efdff 3:b52509cf73af
    15 $plugins->attachHook('html_attribute_whitelist', '$whitelist["lightboxgallery"] = array("maxwidth"); $whitelist["trigger"] = array(); $whitelist["randomimage"] = array("/");');
    15 $plugins->attachHook('html_attribute_whitelist', '$whitelist["lightboxgallery"] = array("maxwidth"); $whitelist["trigger"] = array(); $whitelist["randomimage"] = array("/");');
    16 
    16 
    17 function lbgallery_process_tags(&$text)
    17 function lbgallery_process_tags(&$text)
    18 {
    18 {
    19   // if there are no galleries in this blob, just get out here. also pulls all the matches we need.
    19   // if there are no galleries in this blob, just get out here. also pulls all the matches we need.
    20   if ( !preg_match_all('#<lightboxgallery(?: maxwidth="?([0-9]+)"?)>(.+?)</lightboxgallery>#s', $text, $matches) )
    20   if ( !preg_match_all('#<lightboxgallery(?: maxwidth="?([0-9]+)"?)?>(.+?)</lightboxgallery>#s', $text, $matches) )
    21     return true;
    21     return true;
    22   
    22   
    23   lbgallery_add_headers();
    23   lbgallery_add_headers();
    24   
    24   
    25   foreach ( $matches[0] as $i => $match )
    25   foreach ( $matches[0] as $i => $match )