Ticket #3157: 3157.diff
File 3157.diff, 7.2 KB (added by , 18 years ago) |
---|
-
wp-includes/l10n.php
1 1 <?php 2 3 if ( defined('WPLANG') && '' != constant('WPLANG') ) {4 include_once(ABSPATH . 'wp-includes/streams.php');5 include_once(ABSPATH . 'wp-includes/gettext.php');6 }7 8 2 function get_locale() { 9 3 global $locale; 10 4 … … 75 69 global $l10n; 76 70 77 71 $locale = get_locale(); 78 $mofile = ABSPATH . "wp-includes/languages/$locale.mo";72 $mofile = ABSPATH . LANGDIR . "/$locale.mo"; 79 73 80 74 load_textdomain('default', $mofile); 81 75 } 82 76 83 function load_plugin_textdomain($domain, $path = 'wp-content/plugins') {77 function load_plugin_textdomain($domain, $path = false) { 84 78 $locale = get_locale(); 79 if ( false === $path ) 80 $path = PLUGINDIR; 85 81 86 82 $mofile = ABSPATH . "$path/$domain-$locale.mo"; 87 83 load_textdomain($domain, $mofile); … … 94 90 load_textdomain($domain, $mofile); 95 91 } 96 92 97 ?> 98 No newline at end of file 93 ?> -
wp-settings.php
81 81 require (ABSPATH . 'wp-content/advanced-cache.php'); 82 82 83 83 define('WPINC', 'wp-includes'); 84 if ( !defined('LANGDIR') ) 85 define('LANGDIR', WPINC . '/languages'); // no leading slash, no trailing slash 86 if ( !defined('PLUGINDIR') ) 87 define('PLUGINDIR', 'wp-content/plugins'); // no leading slash, no trailing slash 84 88 if ( file_exists(ABSPATH . 'wp-content/db.php') ) 85 89 require (ABSPATH . 'wp-content/db.php'); 86 90 else … … 119 123 require (ABSPATH . WPINC . '/functions.php'); 120 124 require (ABSPATH . WPINC . '/plugin.php'); 121 125 require (ABSPATH . WPINC . '/default-filters.php'); 126 if ( defined('WPLANG') && '' != constant('WPLANG') ) { 127 include_once(ABSPATH . WPINC . '/streams.php'); 128 include_once(ABSPATH . WPINC . '/gettext.php'); 129 } 122 130 require_once (ABSPATH . WPINC . '/l10n.php'); 123 131 124 132 if ( !is_blog_installed() && (!strstr($_SERVER['PHP_SELF'], 'install.php') && !defined('WP_INSTALLING')) ) { -
wp-admin/menu-header.php
12 12 if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"'; 13 13 14 14 if ( !empty($submenu[$item[2]]) || current_user_can($item[1]) ) { 15 if ( file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") )15 if ( file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") ) 16 16 echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 17 17 else 18 18 echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>"; … … 40 40 41 41 $menu_hook = get_plugin_page_hook($item[2], $parent_file); 42 42 43 if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") || ! empty($menu_hook)) {43 if (file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") || ! empty($menu_hook)) { 44 44 if ( 'admin.php' == $pagenow ) 45 45 echo "\n\t<li><a href='" . get_option('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>"; 46 46 else … … 58 58 59 59 do_action('admin_notices'); 60 60 61 ?> 62 No newline at end of file 61 ?> -
wp-admin/admin.php
52 52 wp_die(__('Invalid plugin page')); 53 53 } 54 54 55 if (! file_exists(ABSPATH . "wp-content/plugins/$plugin_page"))55 if (! file_exists(ABSPATH . PLUGINDIR . "/$plugin_page")) 56 56 wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page))); 57 57 58 58 do_action('load-' . $plugin_page); … … 60 60 if (! isset($_GET['noheader'])) 61 61 require_once(ABSPATH . '/wp-admin/admin-header.php'); 62 62 63 include(ABSPATH . "wp-content/plugins/$plugin_page");63 include(ABSPATH . PLUGINDIR . "/$plugin_page"); 64 64 } 65 65 66 66 include(ABSPATH . 'wp-admin/admin-footer.php'); -
wp-admin/admin-functions.php
1721 1721 } 1722 1722 1723 1723 $wp_plugins = array (); 1724 $plugin_loc = 'wp-content/plugins'; 1725 $plugin_root = ABSPATH.$plugin_loc; 1724 $plugin_root = ABSPATH . PLUGINDIR; 1726 1725 1727 1726 // Files in wp-content/plugins directory 1728 1727 $plugins_dir = @ dir($plugin_root); -
wp-admin/plugins.php
9 9 $current[] = trim( $_GET['plugin'] ); 10 10 sort($current); 11 11 update_option('active_plugins', $current); 12 include(ABSPATH . 'wp-content/plugins/' . trim( $_GET['plugin'] ));12 include(ABSPATH . PLUGINDIR . '/' . trim( $_GET['plugin'] )); 13 13 do_action('activate_' . trim( $_GET['plugin'] )); 14 14 } 15 15 wp_redirect('plugins.php?activate=true'); … … 42 42 // If a plugin file does not exist, remove it from the list of active 43 43 // plugins. 44 44 foreach ($check_plugins as $check_plugin) { 45 if (!file_exists(ABSPATH . 'wp-content/plugins/' . $check_plugin)) {45 if (!file_exists(ABSPATH . PLUGINDIR . '/' . $check_plugin)) { 46 46 $current = get_option('active_plugins'); 47 47 $key = array_search($check_plugin, $current); 48 48 if ( false !== $key && NULL !== $key ) { … … 123 123 } 124 124 ?> 125 125 126 <p><?php _e( 'If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the <code>wp-content/plugins</code> directory and it will be automatically deactivated.'); ?></p>126 <p><?php _e(sprintf('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the <code>%s</code> directory and it will be automatically deactivated.', PLUGINDIR)); ?></p> 127 127 128 128 <h2><?php _e('Get More Plugins'); ?></h2> 129 <p><?php _e( 'You can find additional plugins for your site in the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>. To install a plugin you generally just need to upload the plugin file into your <code>wp-content/plugins</code> directory. Once a plugin is uploaded, you may activate it here.'); ?></p>129 <p><?php _e(sprintf('You can find additional plugins for your site in the <a href="http://wordpress.org/extend/plugins/">WordPress plugin directory</a>. To install a plugin you generally just need to upload the plugin file into your <code>%s</code> directory. Once a plugin is uploaded, you may activate it here.', PLUGINDIR)); ?></p> 130 130 131 131 </div> 132 132 -
wp-admin/plugin-editor.php
14 14 } 15 15 16 16 $file = validate_file_to_edit($file, $plugin_files); 17 $real_file = get_real_file_to_edit( "wp-content/plugins/$file");17 $real_file = get_real_file_to_edit( PLUGINDIR . "/$file"); 18 18 19 19 switch($action) { 20 20 … … 46 46 47 47 require_once('admin-header.php'); 48 48 49 update_recently_edited( "wp-content/plugins/$file");49 update_recently_edited(PLUGINDIR . "/$file"); 50 50 51 51 if (!is_file($real_file)) 52 52 $error = 1;