Forums

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

  1. jdub
    Member
    Posted 11 months 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 11 months ago #

    Thanks for the heads up. Just released a patch.

  3. jdub
    Member
    Posted 11 months ago #

    Legend! Thanks. :-)

  4. jdub
    Member
    Posted 11 months 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. jdub
    Member
    Posted 11 months ago #

    Your final fix was much better. ;-)

  6. wnorris
    Member
    Posted 11 months 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 11 months 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.

Reply

You must log in to post.

About this Topic