• Platinum SEO uses the deprecated attribute_escape() in its output handler function. That’s the worst place to use a deprecated function, because it causes fatal errors when debugging. Such as:

    Fatal error: print_r() ref.outcontrol: Cannot use output buffering in output buffering display handlers in...
    
    Fatal error: ob_start() ref.outcontrol: Cannot use output buffering in output buffering display handlers in...

    The bug is that Platinum uses the wrong logic:

    if (function_exists('attribute_escape')) {
    	$search = attribute_escape($s);
    } else {
    	$search = esc_attr($s);
    }

    should be

    if (function_exists('esc_attr')) {
    	$search = esc_attr($s);
    } else {
    	$search = attribute_escape($s);
    }

    The same block is in the file twice.
    platinum-seo-pack/platinum_seo_pack.php

    It’s been deprecated since WordPress 2.8, so you could just forget the if/else and simply use:

    $search = esc_attr($s);

    http://wordpress.org/plugins/platinum-seo-pack/

  • The topic ‘attribute_escape() logic backwards, fatal error in debug’ is closed to new replies.