summaryrefslogtreecommitdiffstats
path: root/wp-includes
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-07-05 11:55:16 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-07-05 11:55:16 +0000
commitc1e9ee019dcce4d8c2e5bc7d6feac95afa812598 (patch)
treecf1ce2babb677da1e8ed5980a2b93f50c007db6d /wp-includes
parent4f1ae2b3efc96635b7f4f8d40720f96117927204 (diff)
downloadwordpress-mu-c1e9ee019dcce4d8c2e5bc7d6feac95afa812598.tar.gz
wordpress-mu-c1e9ee019dcce4d8c2e5bc7d6feac95afa812598.tar.xz
wordpress-mu-c1e9ee019dcce4d8c2e5bc7d6feac95afa812598.zip
WP Merge.
Delete feed code and sql git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@636 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes')
-rw-r--r--wp-includes/default-filters.php1
-rw-r--r--wp-includes/formatting.php9
-rw-r--r--wp-includes/functions.php4
-rw-r--r--wp-includes/post.php2
-rw-r--r--wp-includes/query.php12
5 files changed, 19 insertions, 9 deletions
diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php
index d596500..9a34aeb 100644
--- a/wp-includes/default-filters.php
+++ b/wp-includes/default-filters.php
@@ -42,6 +42,7 @@ add_filter('comment_url', 'clean_url');
add_filter('comment_text', 'convert_chars');
add_filter('comment_text', 'make_clickable');
+add_filter('comment_text', 'force_balance_tags', 25);
add_filter('comment_text', 'wpautop', 30);
add_filter('comment_text', 'convert_smilies', 20);
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 7d52ed9..cc5e76b 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -70,7 +70,11 @@ function wpautop($pee, $br = 1) {
$pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
$pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "$1", $pee);
$pee = preg_replace('!(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee);
- if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
+ if ($br) {
+ $pee = preg_replace('/<(script|style).*?<\/\\1>/se', 'str_replace("\n", "<WPPreserveNewline />", "\\0")', $pee);
+ $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
+ $pee = str_replace('<WPPreserveNewline />', "\n", $pee);
+ }
$pee = preg_replace('!(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee);
$pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee);
$pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' ", $pee);
@@ -505,6 +509,9 @@ function balanceTags($text, $is_comment = 0, $force = false) {
return $newtext;
}
+function force_balance_tags($text) {
+ return balanceTags($text, 0, true);
+}
function format_to_edit($content, $richedit = false) {
$content = apply_filters('format_to_edit', $content);
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 91d3379..f36a79a 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -829,7 +829,7 @@ function is_blog_installed() {
}
function wp_nonce_url($actionurl, $action = -1) {
- return add_query_arg('_wpnonce', wp_create_nonce($action), $actionurl);
+ return wp_specialchars(add_query_arg('_wpnonce', wp_create_nonce($action), $actionurl));
}
function wp_nonce_field($action = -1) {
@@ -1036,7 +1036,7 @@ function wp_check_filetype($filename, $mimes = null) {
function wp_proxy_check($ipnum) {
if ( get_option('open_proxy_check') && isset($ipnum) ) {
$rev_ip = implode( '.', array_reverse( explode( '.', $ipnum ) ) );
- $lookup = $rev_ip . '.opm.blitzed.org.';
+ $lookup = $rev_ip . '.sbl-xbl.spamhaus.org.';
if ( $lookup != gethostbyname( $lookup ) )
return true;
}
diff --git a/wp-includes/post.php b/wp-includes/post.php
index b29d0d2..c89c552 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -1259,7 +1259,7 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) {
wp_set_post_categories($post_ID, $post_category);
if ( $file )
- add_post_meta($post_ID, '_wp_attached_file', $file );
+ add_post_meta($post_ID, '_wp_attached_file', quotemeta( $file ) );
clean_post_cache($post_ID);
diff --git a/wp-includes/query.php b/wp-includes/query.php
index 3bb98b0..d42aa9e 100644
--- a/wp-includes/query.php
+++ b/wp-includes/query.php
@@ -555,6 +555,7 @@ class WP_Query {
if (isset($q['page'])) {
$q['page'] = trim($q['page'], '/');
$q['page'] = (int) $q['page'];
+ $q['page'] = abs($q['page']);
}
$add_hours = intval(get_settings('gmt_offset'));
@@ -842,11 +843,11 @@ class WP_Query {
}
if ( $this->is_attachment ) {
- $where .= ' AND (post_type = "attachment")';
+ $where .= " AND (post_type = 'attachment')";
} elseif ($this->is_page) {
- $where .= ' AND (post_type = "page")';
+ $where .= " AND (post_type = 'page')";
} elseif ($this->is_single) {
- $where .= ' AND (post_type = "post")';
+ $where .= " AND (post_type = 'post')";
} else {
$where .= " AND (post_type = '$post_type' AND (post_status = 'publish'";
@@ -875,18 +876,19 @@ class WP_Query {
// Paging
if (empty($q['nopaging']) && ! $this->is_single && ! $this->is_page) {
- $page = $q['paged'];
+ $page = abs(intval($q['paged']));
if (empty($page)) {
$page = 1;
}
if (($q['what_to_show'] == 'posts')) {
+ $q['offset'] = abs(intval($q['offset']));
if ( empty($q['offset']) ) {
$pgstrt = '';
$pgstrt = (intval($page) -1) * $q['posts_per_page'] . ', ';
$limits = 'LIMIT '.$pgstrt.$q['posts_per_page'];
} else { // we're ignoring $page and using 'offset'
- $pgstrt = intval($q['offset']) . ', ';
+ $pgstrt = $q['offset'] . ', ';
$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
}
} elseif ($q['what_to_show'] == 'days') {