summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-09-21 10:47:51 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-09-21 10:47:51 +0000
commit659852f4d4a6da8a8147d4fe73cd55a4e83d2264 (patch)
treeb7944d764b51e9789f0cd7f061512fa9c085d807
parenta194fea75f7340d53134ff1ecfa5969b03735576 (diff)
downloadwordpress-mu-659852f4d4a6da8a8147d4fe73cd55a4e83d2264.tar.gz
wordpress-mu-659852f4d4a6da8a8147d4fe73cd55a4e83d2264.tar.xz
wordpress-mu-659852f4d4a6da8a8147d4fe73cd55a4e83d2264.zip
WP Merge to rev 4201
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@763 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-includes/default-filters.php3
-rw-r--r--wp-includes/functions.php32
-rw-r--r--wp-includes/post.php6
-rw-r--r--wp-includes/rewrite.php2
4 files changed, 38 insertions, 5 deletions
diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php
index 22b5528..75f24ed 100644
--- a/wp-includes/default-filters.php
+++ b/wp-includes/default-filters.php
@@ -141,6 +141,8 @@ add_filter('the_author', 'ent2ncr', 8);
// Misc filters
add_filter('option_ping_sites', 'privacy_ping_filter');
add_filter('option_blog_charset', 'wp_specialchars');
+add_filter('mce_plugins', '_mce_load_rtl_plugin');
+add_filter('mce_buttons', '_mce_add_direction_buttons');
// Actions
add_action('wp_head', 'rsd_link');
@@ -158,4 +160,5 @@ add_action('do_pings', 'do_all_pings', 10, 1);
add_action('do_robots', 'do_robots');
add_action('sanitize_comment_cookies', 'sanitize_comment_cookies');
add_action('admin_print_scripts', 'wp_print_scripts', 20);
+add_action('mce_options', '_mce_set_direction');
?>
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 1401b7b..1bd1487 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -1131,6 +1131,12 @@ function wp_die($message, $title = '') {
if ( empty($title) )
$title = __('WordPress &rsaquo; Error');
+
+ if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') )
+ $logo_src = 'images/wordpress-logo.png';
+ else
+ $logo_src = 'wp-admin/images/wordpress-logo.png';
+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -1176,7 +1182,7 @@ function wp_die($message, $title = '') {
</style>
</head>
<body>
- <h1 id="logo"><img alt="WordPress" src="<?php echo get_option('siteurl'); ?>/wp-admin/images/wordpress-logo.png" /></h1>
+ <h1 id="logo"><img alt="WordPress" src="<?php echo $logo_src; ?>" /></h1>
<p><?php echo $message; ?></p>
</body>
</html>
@@ -1185,4 +1191,28 @@ function wp_die($message, $title = '') {
die();
}
+function _mce_set_direction() {
+ global $wp_locale;
+ if ('rtl' == $wp_locale->text_direction)
+ echo 'directionality : "rtl" ,';
+}
+
+function _mce_load_rtl_plugin($input) {
+ global $wp_locale;
+ if ('rtl' == $wp_locale->text_direction)
+ $input[] = 'directionality';
+
+ return $input;
+}
+
+function _mce_add_direction_buttons($input) {
+ global $wp_locale;
+ if ('rtl' == $wp_locale->text_direction) {
+ $new_buttons = array('separator', 'ltr', 'rtl');
+ $input = array_merge($input, $new_buttons);
+ }
+
+ return $input;
+}
+
?>
diff --git a/wp-includes/post.php b/wp-includes/post.php
index 468ed37..1968714 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -591,13 +591,13 @@ function wp_insert_post($postarr = array()) {
if ( 'draft' != $post_status ) {
$post_name_check = $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE post_name = '$post_name' AND post_type = '$post_type' AND ID != '$post_ID' AND post_parent = '$post_parent' LIMIT 1");
- if ($post_name_check) {
+ if ($post_name_check || in_array($post_name, $wp_rewrite->feeds) ) {
$suffix = 2;
- while ($post_name_check) {
+ do {
$alt_post_name = $post_name . "-$suffix";
$post_name_check = $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE post_name = '$alt_post_name' AND post_type = '$post_type' AND ID != '$post_ID' AND post_parent = '$post_parent' LIMIT 1");
$suffix++;
- }
+ } while ($post_name_check);
$post_name = $alt_post_name;
}
}
diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php
index 75445f8..6f34b57 100644
--- a/wp-includes/rewrite.php
+++ b/wp-includes/rewrite.php
@@ -97,7 +97,7 @@ function url_to_postid($url) {
$url = str_replace('://www.', '://', $url);
// Strip 'index.php/' if we're not using path info permalinks
- if ( false === strpos($rewrite, 'index.php/') )
+ if ( !$wp_rewrite->using_index_permalinks() )
$url = str_replace('index.php/', '', $url);
if ( false !== strpos($url, get_option('home')) ) {