summaryrefslogtreecommitdiffstats
path: root/wp-admin/wpmu-edit.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-03-26 15:46:27 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-03-26 15:46:27 +0000
commitb7fe2aee15c1f3ad0673d105624ea81f16f14288 (patch)
tree7b88927675de4b121e104a958647f10cfe438c10 /wp-admin/wpmu-edit.php
parent244e8f75fcb7110a9ded532d76e5bcba50bc45f6 (diff)
downloadwordpress-mu-b7fe2aee15c1f3ad0673d105624ea81f16f14288.tar.gz
wordpress-mu-b7fe2aee15c1f3ad0673d105624ea81f16f14288.tar.xz
wordpress-mu-b7fe2aee15c1f3ad0673d105624ea81f16f14288.zip
Index allowed_themes by stylesheet path instead of name. (fixes #284)
Important! Make sure you visit and save wp-admin/wpmu-themes.php to update the list! git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@936 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/wpmu-edit.php')
-rw-r--r--wp-admin/wpmu-edit.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/wp-admin/wpmu-edit.php b/wp-admin/wpmu-edit.php
index b7827e2..f891694 100644
--- a/wp-admin/wpmu-edit.php
+++ b/wp-admin/wpmu-edit.php
@@ -158,9 +158,9 @@ switch( $_REQUEST[ 'action' ] ) {
// themes
if( is_array( $_POST[ 'theme' ] ) ) {
$allowed_themes = $_POST[ 'theme' ];
- $_POST[ 'option' ][ 'allowed_themes' ] = $_POST[ 'theme' ];
+ $_POST[ 'option' ][ 'allowedthemes' ] = $_POST[ 'theme' ];
} else {
- $_POST[ 'option' ][ 'allowed_themes' ] = '';
+ $_POST[ 'option' ][ 'allowedthemes' ] = '';
}
if( is_array( $_POST[ 'option' ] ) ) {
$c = 1;
@@ -382,18 +382,17 @@ switch( $_REQUEST[ 'action' ] ) {
die();
break;
case "updatethemes":
- if( is_site_admin() == false ) {
+ if( is_site_admin() == false )
die( __('<p>You do not have permission to access this page.</p>') );
- }
+
if( is_array( $_POST[ 'theme' ] ) ) {
- $themes = array_flip( array_keys( get_themes() ) );
+ $themes = get_themes();
reset( $themes );
- while( list( $key, $val ) = each( $themes ) )
- {
- if( $_POST[ 'theme' ][ addslashes( $key ) ] == 'enabled' )
- $allowed_themes[ $key ] = true;
+ foreach( $themes as $key => $theme ) {
+ if( $_POST[ 'theme' ][ wp_specialchars( $theme[ 'Stylesheet' ] ) ] == 'enabled' )
+ $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] = true;
}
- update_site_option( 'allowed_themes', $allowed_themes );
+ update_site_option( 'allowedthemes', $allowed_themes );
}
wp_redirect( add_query_arg( "updated", "themesupdated", $_SERVER[ 'HTTP_REFERER' ] ) );
die();