Fix for captions with $ and \ being truncated
-
Hi there,
I notice when using the Lightbox plugin, dollar signs and backslashes are truncated in image captions.
To resolve this, I have replaced preg_replace with preg_replace_callback in the function add_custom_gallery_lightbox_selector( $content ), e.g.
$content = str_replace( $link, preg_replace_callback( '/(?:data-rel)=(?:\'|")(.*?)(?:\'|")/', 'data-rel="' . Responsive_Lightbox()->options['settings']['selector'] . '-gallery-' . base64_encode( $result[1] ) . '"' . ( ! empty ( $title ) ? ' title="' . esc_attr( $title ) . '"' : '' ) . ( Responsive_Lightbox()->options['settings']['script'] === 'imagelightbox' ? ' data-imagelightbox="' . $id . '"' : '' ), $link ), $content );
Was wondering if a fix can be impelemented in the plugin? Thank you.
- The topic ‘Fix for captions with $ and \ being truncated’ is closed to new replies.