X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/022dfbbbe3215917d84708eb09acca93b21ae9e0..7688c6ba71852cd89123b62b2d57683535e4702a:/wp-admin/templates.php diff --git a/wp-admin/templates.php b/wp-admin/templates.php index 5f678046..a061072e 100644 --- a/wp-admin/templates.php +++ b/wp-admin/templates.php @@ -3,21 +3,7 @@ require_once('admin.php'); $title = __('Template & File Editing'); $parent_file = 'edit.php'; -$wpvarstoreset = array('action','redirect','profile','error','warning','a','file'); -for ($i=0; $i'.__('You have do not have sufficient permissions to edit templates for this blog.').'

'); + wp_die('

'.__('You do not have sufficient permissions to edit templates for this blog.').'

'); $newcontent = stripslashes($_POST['newcontent']); if (is_writeable($real_file)) { @@ -62,18 +48,19 @@ break; default: require_once('./admin-header.php'); - + if ( ! current_user_can('edit_files') ) - die('

'.__('You have do not have sufficient permissions to edit templates for this blog.').'

'); + wp_die('

'.__('You do not have sufficient permissions to edit templates for this blog.').'

'); - if ( strstr( $file, 'wp-config.php' ) ) - die('

'.__('The config file cannot be edited or viewed through the web interface. Sorry!').'

'); + if (strpos($file, 'wp-config.php') !== false) + wp_die('

'.__('The config file cannot be edited or viewed through the web interface. Sorry!').'

'); update_recently_edited($file); - if ( !is_file($real_file) ) { + if (!is_file($real_file)) $error = true; - } else { + + if (!$error) { $f = @ fopen($real_file, 'r'); if ( $f ) { if ( filesize($real_file ) > 0 ) { @@ -93,9 +80,9 @@ default:

- + -
+
' . sprintf(__('Editing %s'), wp_specialchars($file) ) . ''; @@ -104,8 +91,8 @@ if (is_writeable($real_file)) { } ?>
-

-
    - -
  • - -
+
    + +
  • + +
-
- -
- - -
+ + +
+ + +
-

+

"; + echo ""; ?>

-
- +

' . __('Oops, no such file exists! Double check the name and try again, merci.') . '

'; } @@ -156,14 +143,14 @@ endif;

-

writable by the server, e.g. CHMOD 666.') ?>

-
- - -
+

writable by the server, e.g. CHMOD 666.') ?>

+
+ + +
-

-
+

+