• Resolved Blobfolio

    (@blobfolio)


    WP Retina 2x should automatically identify and ignore images with Data URI sources. Even a simple pattern match against the unfiltered source string like /^data:/i would help.

    When treated like a file path, file_exists() tests can result in PHP errors like:
    PHP Warning: file_exists(): File name is longer than the maximum allowed path length on this platform (4096): /var/www/vhosts/image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwgH...

    https://www.ads-software.com/plugins/wp-retina-2x/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hello blobfolio,

    I completely agree with that. I will add a filter to allow users adding their own “ignore” filters as well. And I will implement a first filter for the Data URI. Good catch ??

    Thread Starter Blobfolio

    (@blobfolio)

    Thanks Jordy!

    Plugin Author Jordy Meow

    (@tigroumeow)

    Done, I added a wr2x_validate_src filter.

    The default filter is:

    function wr2x_validate_src( $src ) {
    	if ( preg_match( "/^data:/i", $src ) )
    		return null;
    	return $src;
    }

    That takes care of it ?? Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Smarter Data URI handling’ is closed to new replies.