From ae484584028c752efb5faa4c02259556e853d26e Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 19 Sep 2006 16:06:15 +0000 Subject: WP Merge to 4197 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@761 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/classes.php | 2 +- wp-includes/comment.php | 4 --- wp-includes/default-filters.php | 1 + wp-includes/functions.php | 12 -------- wp-includes/js/scriptaculous/prototype.js | 6 ++-- wp-includes/js/tinymce/tiny_mce_config.php | 2 +- wp-includes/kses.php | 49 ++++++++++++++++++++++-------- wp-includes/locale.php | 18 +++++++++++ wp-includes/theme.php | 21 +++++++++++++ wp-includes/wp-db.php | 2 +- 10 files changed, 84 insertions(+), 33 deletions(-) (limited to 'wp-includes') diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 5437ed9..55b46a3 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -111,7 +111,7 @@ class WP { $pathinfo = $_SERVER['PATH_INFO']; $pathinfo_array = explode('?', $pathinfo); - $pathinfo = $pathinfo_array[0]; + $pathinfo = str_replace("%", "%25", $pathinfo_array[0]); $req_uri = $_SERVER['REQUEST_URI']; $req_uri_array = explode('?', $req_uri); $req_uri = $req_uri_array[0]; diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 45fe0f8..3189b14 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -257,10 +257,6 @@ function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_age if ( preg_match($pattern, $user_agent) ) return true; } - if ( isset($_SERVER['REMOTE_ADDR']) ) { - if ( wp_proxy_check($_SERVER['REMOTE_ADDR']) ) return true; - } - return false; } diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index 61afd0a..22b5528 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -144,6 +144,7 @@ add_filter('option_blog_charset', 'wp_specialchars'); // Actions add_action('wp_head', 'rsd_link'); +add_action('wp_head', 'locale_stylesheet'); add_action('publish_future_post', 'wp_publish_post', 10, 1); add_action('wp_head', 'noindex', 1); add_action('wp_head', 'wp_print_scripts'); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 230bf96..1401b7b 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1034,18 +1034,6 @@ function wp_check_filetype($filename, $mimes = null) { return compact('ext', 'type'); } -function wp_proxy_check($ipnum) { - if ( get_option('open_proxy_check') && isset($ipnum) ) { - $ipnum = preg_replace( '/([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*/', '$1', $ipnum ); - $rev_ip = implode( '.', array_reverse( explode( '.', $ipnum ) ) ); - $lookup = $rev_ip . '.sbl-xbl.spamhaus.org.'; - if ( $lookup != gethostbyname( $lookup ) ) - return true; - } - - return false; -} - function wp_explain_nonce($action) { if ( $action !== -1 && preg_match('/([a-z]+)-([a-z]+)(_(.+))?/', $action, $matches) ) { $verb = $matches[1]; diff --git a/wp-includes/js/scriptaculous/prototype.js b/wp-includes/js/scriptaculous/prototype.js index 0caf9cd..76846d2 100644 --- a/wp-includes/js/scriptaculous/prototype.js +++ b/wp-includes/js/scriptaculous/prototype.js @@ -1765,7 +1765,9 @@ Object.extend(Event, { if (element.removeEventListener) { element.removeEventListener(name, observer, useCapture); } else if (element.detachEvent) { - element.detachEvent('on' + name, observer); + try { + element.detachEvent('on' + name, observer); + } catch (e) {} } } }); @@ -2003,4 +2005,4 @@ if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) { return [valueL, valueT]; } -} \ No newline at end of file +} diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php index 283ffb8..dad3aff 100644 --- a/wp-includes/js/tinymce/tiny_mce_config.php +++ b/wp-includes/js/tinymce/tiny_mce_config.php @@ -21,7 +21,7 @@ } // Set up init variables - $valid_elements = 'p/-div[*],-b[*],-font[*],-ul[*],-ol[*],-li[*],*[*]'; + $valid_elements = 'p/-div[*],-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]'; $valid_elements = apply_filters('mce_valid_elements', $valid_elements); $plugins = array('inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress'); diff --git a/wp-includes/kses.php b/wp-includes/kses.php index 3f244bc..e3a0bcd 100644 --- a/wp-includes/kses.php +++ b/wp-includes/kses.php @@ -23,6 +23,7 @@ if (!CUSTOM_TAGS) { 'a' => array ( 'class' => array (), 'href' => array (), + 'id' => array (), 'title' => array (), 'rel' => array (), 'rev' => array (), @@ -35,16 +36,20 @@ if (!CUSTOM_TAGS) { 'b' => array (), 'big' => array (), 'blockquote' => array ( + 'id' => array (), 'cite' => array ()), - 'br' => array (), + 'br' => array ( + 'class' => array ()), 'button' => array ( 'disabled' => array (), 'name' => array (), 'type' => array (), 'value' => array ()), 'caption' => array ( - 'align' => array ()), + 'align' => array (), + 'class' => array ()), 'cite' => array ( + 'class' => array(), 'dir' => array(), 'lang' => array(), 'title' => array ()), @@ -63,7 +68,7 @@ if (!CUSTOM_TAGS) { 'div' => array ( 'align' => array (), 'class' => array (), - 'dir' => array ()), + 'dir' => array (), 'dl' => array (), 'dt' => array (), 'em' => array (), @@ -81,19 +86,26 @@ if (!CUSTOM_TAGS) { 'name' => array (), 'target' => array ()), 'h1' => array ( - 'align' => array ()), + 'align' => array (), + 'class' => array ()), 'h2' => array ( - 'align' => array ()), + 'align' => array (), + 'class' => array ()), 'h3' => array ( - 'align' => array ()), + 'align' => array (), + 'class' => array ()), 'h4' => array ( - 'align' => array ()), + 'align' => array (), + 'class' => array ()), 'h5' => array ( - 'align' => array ()), + 'align' => array (), + 'class' => array ()), 'h6' => array ( - 'align' => array ()), + 'align' => array (), + 'class' => array ()), 'hr' => array ( 'align' => array (), + 'class' => array (), 'noshade' => array (), 'size' => array (), 'width' => array ()), @@ -114,6 +126,7 @@ if (!CUSTOM_TAGS) { 'alt' => array (), 'align' => array (), 'border' => array (), + 'class' => array (), 'height' => array (), 'hspace' => array (), 'longdesc' => array (), @@ -134,12 +147,16 @@ if (!CUSTOM_TAGS) { 'p' => array ( 'class' => array (), 'align' => array (), - 'dir' => array()), + 'dir' => array(), 'pre' => array ( 'width' => array ()), 'q' => array ( 'cite' => array ()), 's' => array (), + 'span' => array ( + 'class' => array (), + 'dir' => array (), + 'align' => array (), 'strike' => array (), 'strong' => array (), 'sub' => array (), @@ -150,6 +167,7 @@ if (!CUSTOM_TAGS) { 'border' => array (), 'cellpadding' => array (), 'cellspacing' => array (), + 'class' => array (), 'dir' => array(), 'rules' => array (), 'summary' => array (), @@ -166,6 +184,7 @@ if (!CUSTOM_TAGS) { 'bgcolor' => array (), 'char' => array (), 'charoff' => array (), + 'class' => array (), 'colspan' => array (), 'dir' => array(), 'headers' => array (), @@ -184,6 +203,7 @@ if (!CUSTOM_TAGS) { 'tfoot' => array ( 'align' => array (), 'char' => array (), + 'class' => array (), 'charoff' => array (), 'valign' => array ()), 'th' => array ( @@ -193,6 +213,7 @@ if (!CUSTOM_TAGS) { 'bgcolor' => array (), 'char' => array (), 'charoff' => array (), + 'class' => array (), 'colspan' => array (), 'headers' => array (), 'height' => array (), @@ -205,6 +226,7 @@ if (!CUSTOM_TAGS) { 'align' => array (), 'char' => array (), 'charoff' => array (), + 'class' => array (), 'valign' => array ()), 'title' => array (), 'tr' => array ( @@ -212,11 +234,14 @@ if (!CUSTOM_TAGS) { 'bgcolor' => array (), 'char' => array (), 'charoff' => array (), + 'class' => array (), 'valign' => array ()), 'tt' => array (), 'u' => array (), - 'ul' => array (), - 'ol' => array (), + 'ul' => array ( + 'class' => array ()), + 'ol' => array ( + 'class' => array ()), 'var' => array ()); $allowedtags = array ( 'a' => array ( diff --git a/wp-includes/locale.php b/wp-includes/locale.php index 9fc37a4..4b6c654 100644 --- a/wp-includes/locale.php +++ b/wp-includes/locale.php @@ -12,6 +12,9 @@ class WP_Locale { var $meridiem; + var $text_direction = ''; + var $locale_vars = array('text_direction'); + function init() { // The Weekdays $this->weekday[0] = __('Sunday'); @@ -83,6 +86,21 @@ class WP_Locale { $this->meridiem['pm'] = __('pm'); $this->meridiem['AM'] = __('AM'); $this->meridiem['PM'] = __('PM'); + + $this->_load_locale_data(); + } + + function _load_locale_data() { + $locale = get_locale(); + $locale_file = ABSPATH . "wp-includes/languages/$locale.php"; + if ( !file_exists($locale_file) ) + return; + + include($locale_file); + + foreach ( $this->locale_vars as $var ) { + $this->$var = $$var; + } } function get_weekday($weekday_number) { diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 36f001d..d8051da 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -25,6 +25,20 @@ function get_stylesheet_uri() { return apply_filters('stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri); } +function get_locale_stylesheet_uri() { + global $wp_locale; + $stylesheet_dir_uri = get_stylesheet_directory_uri(); + $dir = get_stylesheet_directory(); + $locale = get_locale(); + if ( file_exists("$dir/$locale.css") ) + $stylesheet_uri = "$stylesheet_dir_uri/$locale.css"; + else if ( !empty($wp_locale->text_direction) && file_exists("$dir/{$wp_locale->text_direction}.css") ) + $stylesheet_uri = "$stylesheet_dir_uri/{$wp_locale->text_direction}.css"; + else + $stylesheet_uri = ''; + return apply_filters('locale_stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri); +} + function get_template() { return apply_filters('template', get_option('template')); } @@ -370,6 +384,13 @@ function load_template($file) { require_once($file); } +function locale_stylesheet() { + $stylesheet = get_locale_stylesheet_uri(); + if ( empty($stylesheet) ) + return; + echo ''; +} + function validate_current_theme() { // Don't validate during an install/upgrade. if ( defined('WP_INSTALLING') ) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index c80e5fc..d02606b 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -378,7 +378,7 @@ class wpdb { if ( !$this->show_errors ) return false; - header( 'Content-Type: text/html; charset=utf-8'); + header('Content-Type: text/html; charset=utf-8'); ?> -- cgit