Forums

[Plugin: Google Analyticator] Quick fix for WordPress 2.7 and/or Sandbox (7 posts)

  1. Jeff Waugh
    Member
    Posted 3 years ago #

    Using g-a 2.21 + WordPress 2.7 + Sandbox... ga_outgoing_comment_author is a little bit hungry, which breaks URLs in comments. Just needs a bit of a regex "controlled diet" to be happy. :-)

    (Sorry, not quoting the entire patch here on the forum... this summary will give you the fix anyway.)

    Thanks for g-a!

    function ga_outgoing_comment_author($input) {
    -	static $link_pattern = '(.*href\s*=\s*)[\"\']*(.*)[\"\'] (.*)';
    +	static $link_pattern = '(.*href\s*=\s*)[\"\']*(.*?)[\"\'] (.*)';
  2. cavemonkey50
    Member
    Posted 3 years ago #

    Thanks for the heads up. Just released a patch.

  3. Jeff Waugh
    Member
    Posted 3 years ago #

    Legend! Thanks. :-)

  4. Jeff Waugh
    Member
    Posted 3 years ago #

    Looks like you have a leeeettle merge problem at the top of the php file:

    * Plugin Name: Google Analyticator
    <<<<<<< .mine
     * Version: 2.23
    =======
     * Version: 2.22
    >>>>>>> .r78429
  5. Jeff Waugh
    Member
    Posted 3 years ago #

    Your final fix was much better. ;-)

  6. Will Norris
    Member
    Posted 3 years ago #

    can I ask... why aren't you just adding these onclicks on the client side using jQuery? It would make the plugin much simpler, and the javascript far less intrusive.

  7. cavemonkey50
    Member
    Posted 3 years ago #

    A while back I was using Javascript to add the links, but it resulted in several Javascript conflicts. I may have had a crappy implementation, but I haven't noticed any problems with just adding the onclick via a filter.

Topic Closed

This topic has been closed to new replies.

About this Topic