mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-30 10:14:31 +00:00
Do not allow .. anywhere in the filename.
git-svn-id: https://develop.svn.wordpress.org/trunk@2019 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -42,13 +42,15 @@ require(ABSPATH . '/wp-admin/menu.php');
|
||||
// Handle plugin admin pages.
|
||||
if (isset($_GET['page'])) {
|
||||
$plugin_page = plugin_basename($_GET['page']);
|
||||
if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page")) {
|
||||
die(sprintf(__('Cannot load %s.'), $plugin_page));
|
||||
if ( validate_file($plugin_page) ) {
|
||||
die(__('Invalid plugin page'));
|
||||
}
|
||||
|
||||
if (! isset($_GET['noheader'])) {
|
||||
if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page"))
|
||||
die(sprintf(__('Cannot load %s.'), $plugin_page));
|
||||
|
||||
if (! isset($_GET['noheader']))
|
||||
require_once(ABSPATH . '/wp-admin/admin-header.php');
|
||||
}
|
||||
|
||||
include(ABSPATH . "wp-content/plugins/$plugin_page");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user