Split admin-header.php into admin.php and admin-header.php. Split menu.php into menu-header.php and menu.php. Add plugin admin page support.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -1,20 +1,9 @@
|
||||
<?php
|
||||
require_once('../wp-includes/wp-l10n.php');
|
||||
require_once('admin.php');
|
||||
|
||||
$title = __("Template & file editing");
|
||||
$parent_file = 'themes.php';
|
||||
|
||||
function add_magic_quotes($array) {
|
||||
foreach ($array as $k => $v) {
|
||||
if (is_array($v)) {
|
||||
$array[$k] = add_magic_quotes($v);
|
||||
} else {
|
||||
$array[$k] = addslashes($v);
|
||||
}
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
function validate_file($file) {
|
||||
if ('..' == substr($file,0,2))
|
||||
die (__('Sorry, can’t edit files with ".." in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.'));
|
||||
@@ -31,13 +20,7 @@ function validate_file($file) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
if (!get_magic_quotes_gpc()) {
|
||||
$_GET = add_magic_quotes($_GET);
|
||||
$_POST = add_magic_quotes($_POST);
|
||||
$_COOKIE = add_magic_quotes($_COOKIE);
|
||||
}
|
||||
|
||||
$wpvarstoreset = array('action','standalone','redirect','profile','error','warning','a','file', 'theme');
|
||||
$wpvarstoreset = array('action','redirect','profile','error','warning','a','file', 'theme');
|
||||
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||
$wpvar = $wpvarstoreset[$i];
|
||||
if (!isset($$wpvar)) {
|
||||
@@ -57,9 +40,6 @@ switch($action) {
|
||||
|
||||
case 'update':
|
||||
|
||||
$standalone = 1;
|
||||
require_once("admin-header.php");
|
||||
|
||||
if ($user_level < 5) {
|
||||
die(__('<p>You have do not have sufficient permissions to edit templates for this blog.</p>'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user