WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#13919 new defect (bug)

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

Reported by: hakre Owned by:
Priority: normal Milestone: Future Release
Component: Warnings/Notices Version: 3.0
Severity: normal Keywords: has-patch close
Cc:

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 3 years ago.

Download all attachments as: .zip

Change History (4)

hakre3 years ago

comment:1 hakre3 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.

comment:2 hakre3 years ago

  • Keywords tested added

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

Note: See TracTickets for help on using tickets.