Ticket #11214: 11214-first-pass.diff
File 11214-first-pass.diff, 2.6 KB (added by , 13 years ago) |
---|
-
wp-includes/theme.php
350 350 while ( ($file = $stylesheet_dir->read()) !== false ) { 351 351 if ( !preg_match('|^\.+$|', $file) ) { 352 352 if ( preg_match('|\.css$|', $file) ) 353 $stylesheet_files[] = "$ theme_root/$stylesheet/$file";353 $stylesheet_files[] = "$file"; 354 354 elseif ( preg_match('|\.php$|', $file) ) 355 $template_files[] = "$ theme_root/$stylesheet/$file";355 $template_files[] = "$file"; 356 356 } 357 357 } 358 358 @ $stylesheet_dir->close(); … … 364 364 if ( preg_match('|^\.+$|', $file) ) 365 365 continue; 366 366 if ( preg_match('|\.php$|', $file) ) { 367 $template_files[] = "$ template_directory/$file";367 $template_files[] = "$file"; 368 368 } elseif ( is_dir("$template_directory/$file") ) { 369 369 $template_subdir = @ dir("$template_directory/$file"); 370 370 if ( !$template_subdir ) … … 373 373 if ( preg_match('|^\.+$|', $subfile) ) 374 374 continue; 375 375 if ( preg_match('|\.php$|', $subfile) ) 376 $template_files[] = "$ template_directory/$file/$subfile";376 $template_files[] = "$file/$subfile"; 377 377 } 378 378 @ $template_subdir->close(); 379 379 } -
wp-admin/theme-editor.php
55 55 if ( ! isset($themes[$theme]) ) 56 56 wp_die(__('The requested theme does not exist.')); 57 57 58 $allowed_files = array_merge( $themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files'] );59 58 59 $stylefiles = $themes[$theme]['Stylesheet Files']; 60 foreach ( $stylefiles as $key => $filename ) 61 $stylefiles[$key] = $themes[$theme]['Stylesheet Dir'] . '/' . $filename; 62 63 $themefiles = $themes[$theme]['Template Files']; 64 foreach ( $themefiles as $key => $filename ) 65 $themefiles[$key] = $themes[$theme]['Template Dir'] . '/' . $filename; 66 67 $allowed_files = array_merge( $stylefiles, $themefiles ); 68 60 69 if ( empty( $file ) ) { 61 70 if ( false !== array_search( $themes[$theme]['Stylesheet Dir'] . '/style.css', $allowed_files ) ) 62 71 $file = $themes[$theme]['Stylesheet Dir'] . '/style.css'; … … 65 74 } else { 66 75 $file = stripslashes($file); 67 76 if ( 'theme' == $dir ) { 68 $file = dirname(dirname($themes[$theme]['Template Dir'])). $file ;77 $file = $themes[$theme]['Template Dir'] . '/' . $file ; 69 78 } else if ( 'style' == $dir) { 70 $file = dirname(dirname($themes[$theme]['Stylesheet Dir'])). $file ;79 $file = $themes[$theme]['Stylesheet Dir'] . '/' . $file ; 71 80 } 72 81 } 73 82