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 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:' . __('Oops, no such file exists! Double check the name and try again, merci.') . '
writable by the server, e.g. CHMOD 666.') ?>
- +writable by the server, e.g. CHMOD 666.') ?>
+ - -