Forums

[Plugin: Google Analytics for WordPress] W3C validation problems (1 post)

  1. mariusvw
    Member
    Posted 6 months ago #

    It seems that if you put the outbound tracking on that the code on line 467-468 is not working probably and causing double quotes too early in the onclick argument.

    My fix:
    //if (preg_match('/onclick=[\'\"](.*?)[\'\"]/i', $matches[4]) > 0) {
    //$matches[4] = preg_replace('/onclick=[\'\"](.*?)[\'\"]/i', 'onclick="' . $coolBit .' $1"', $matches[4]);
    if (preg_match('/onclick="(.*?)"/i', $matches[4]) > 0) {
    $matches[4] = preg_replace('/onclick="(.*?)"/i', 'onclick="' . $coolBit .' $1"', $matches[4]);

    Not sure why you would allow single quotes here, couldn't find any on my own blog.

Reply

You must log in to post.

About this Topic