WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 6 years ago

Last modified 6 years ago

#13919 closed defect (bug) (wontfix)

$pagenow / vars.php refactoring / Move $pagenow generation into it's own function

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Warnings/Notices Keywords: has-patch
Focuses: Cc:
PR Number:

Description

In wp-include/vars.php an unset variable is passed by referecence to preg_match() in mutliple places.

The same code-fragment where that problem is located does poisen the globale variable table with temporary variables as well.

To prevent these problems, the variable needs to be set prior to be passed to preg_match and the code fragment needs to be refactored in it's own function.

This might be helpful a bit as well when we start to free the codebase from hardencoded /wp-admin/ admin directory definitions.

Attachments (1)

13919.patch (3.3 KB) - added by hakre 9 years ago.

Download all attachments as: .zip

Change History (7)

@hakre
9 years ago

#1 @hakre
9 years ago

This patch introduces a new function called wp_page() in wp-includes/functions.php. Both the name as the place is just an idea, I could not find a guide how to name a new function nor in which to place it. So let me know what makes more sense here.

I just inserted in before the function that follows in the alphabetical order of funtion names. Is that what is intended?

I thought it is a good idea to decouple it from $PHP_SELF a bit by parameterizing it.

#2 @hakre
9 years ago

  • Keywords tested added

Run some tests with the patch and it looks good so far.

#4 @c3mdigital
6 years ago

  • Keywords close removed
  • Resolution set to wontfix
  • Status changed from new to closed

#5 @SergeyBiryukov
6 years ago

  • Milestone Future Release deleted

#6 @SergeyBiryukov
6 years ago

In wp-include/vars.php an unset variable is passed by referecence to preg_match() in mutliple places.

$self_matches does not need to be defined, see #24222.

Note: See TracTickets for help on using tickets.