13
Aug
06

bug in paged comments plugin when using other queries, with solution

I found a minor bug in the paged comments plugin (last updated April 2006) when you are trying to use other queries on the URL.

ie. example.com/2006/07/25/text-example/comment-page-3/?test=1
will cause a 404, at least on my blogs

I traced it back to the function paged_comments_fancy_url() which doesn’t expect anything else on the URI except an ending slash or not.

To fix this just take the first line of that function and change it from

$req = rtrim($_SERVER['REQUEST_URI'], '/');

to

$req = rtrim(str_replace('?'.$_SERVER['QUERY_STRING'],'',$_SERVER['REQUEST_URI']), '/');

This is a quick fix solution and I am not certain what the effects might be since the function resets the request url back to $req later on. Other plugins might look direct at the url for the query string instead of at $_SERVER['QUERY_STRING']

Not quite sure why he does it that way but my fix works so there you go.


0 Responses to “bug in paged comments plugin when using other queries, with solution”



  1. No Comments Yet

c

Blog Stats

  • 48,360 hits

 

August 2006
S M T W T F S
    Feb »
 12345
6789101112
13141516171819
20212223242526
2728293031