Make WordPress Core

Opened 20 years ago

Closed 20 years ago

Last modified 18 years ago

#1581 closed defect (bug) (fixed)

When using fancy URIs, using a query string shows the front page

Reported by: markjaquith's profile markjaquith Owned by: markjaquith's profile markjaquith
Milestone: Priority: high
Severity: major Version: 1.6
Component: Administration Keywords: bg|has-patch bg|2nd-opinion bg|dev-feedback
Focuses: Cc:

Description

As reported by Andy Skelton on wp-testers:
http://comox.textdrive.com/pipermail/wp-testers/2005-August/000375.html


Hi guys and gals, I guess I should have subscribed to this list ages
ago. Now one of my BOTD plugin testers is having an issue with
1.6-ALPHA-2.

My plugin depends on the ability to receive query strings on permalink
pages. This was seamless in 1.5 in almost all cases; only some sites
with index.php in the permalink structure would lose additional query
strings.

Now, whenever I add a query string to a rewrite-enabled permalink URL,
the query string is preserved in $_GETfoo? but is_single() is FALSE
and is_home() is TRUE. This causes WP to load the home template with
the default query and, less critically, it causes problems with my
plugin.

I dug a little deeper and found $wp_query->query and
$wp_query->query_vars coming up blank when I do something like this:
http://gilford.textdrive.com/~acskelto/2005/08/07/hello-world/?foo=bar
so instead of showing the "Hello, World!" post, it shows the home page.


I looked into this with Owen Winkler and we managed to fix it. The solution was to remove the empty($_SERVERQUERY_STRING?) requirement of the rewrite engine, and to strip off everything after "?" in $req_uri and $pathinfo

We tested, and it seems to work just fine. Please test this patch and report any problems.

Attachments (1)

classes.16.php.diff (938 bytes) - added by markjaquith 20 years ago.
classes.php patch for current 1.6 SVN

Download all attachments as: .zip

Change History (4)

@markjaquith
20 years ago

classes.php patch for current 1.6 SVN

#1 @skeltoac
20 years ago

This diff does resolve the problem I was having. Thank you.

#2 @ryan
20 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [2823]) Allow query strings at the end of cruftless URIs. Props Owen and Mark. fixes #1581

#3 @(none)
18 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.