summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wp-admin/admin-functions.php10
-rw-r--r--wp-admin/edit-page-form.php3
-rw-r--r--wp-includes/class-snoopy.php20
-rw-r--r--wp-includes/post.php42
-rw-r--r--wp-includes/theme.php16
5 files changed, 52 insertions, 39 deletions
diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php
index 60f45f3..8fa5184 100644
--- a/wp-admin/admin-functions.php
+++ b/wp-admin/admin-functions.php
@@ -1625,23 +1625,23 @@ function get_plugin_data($plugin_file) {
preg_match("|Author:(.*)|i", $plugin_data, $author_name);
preg_match("|Author URI:(.*)|i", $plugin_data, $author_uri);
if (preg_match("|Version:(.*)|i", $plugin_data, $version))
- $version = $version[1];
+ $version = trim($version[1]);
else
$version = '';
- $description = wptexturize($description[1]);
+ $description = wptexturize(trim($description[1]));
$name = $plugin_name[1];
$name = trim($name);
$plugin = $name;
if ('' != $plugin_uri[1] && '' != $name) {
- $plugin = '<a href="'.$plugin_uri[1].'" title="'.__('Visit plugin homepage').'">'.$plugin.'</a>';
+ $plugin = '<a href="' . trim($plugin_uri[1]) . '" title="'.__('Visit plugin homepage').'">'.$plugin.'</a>';
}
if ('' == $author_uri[1]) {
- $author = $author_name[1];
+ $author = trim($author_name[1]);
} else {
- $author = '<a href="'.$author_uri[1].'" title="'.__('Visit author homepage').'">'.$author_name[1].'</a>';
+ $author = '<a href="' . trim($author_uri[1]) . '" title="'.__('Visit author homepage').'">' . trim($author_name[1]) . '</a>';
}
return array ('Name' => $name, 'Title' => $plugin, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template[1]);
diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php
index 58cd669..2430393 100644
--- a/wp-admin/edit-page-form.php
+++ b/wp-admin/edit-page-form.php
@@ -32,7 +32,7 @@ if (isset($mode) && 'bookmarklet' == $mode) {
}
?>
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
-<input type="hidden" name="action" value='<?php echo $form_action ?>' />
+<input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
<?php echo $form_extra ?>
<input type="hidden" name="post_type" value="page" />
@@ -177,6 +177,7 @@ list_meta($metadata);
meta_form();
?>
</div>
+<div id="ajax-response"></div>
</fieldset>
<?php do_action('dbx_page_advanced'); ?>
diff --git a/wp-includes/class-snoopy.php b/wp-includes/class-snoopy.php
index 0149582..1527205 100644
--- a/wp-includes/class-snoopy.php
+++ b/wp-includes/class-snoopy.php
@@ -78,7 +78,7 @@ class Snoopy
var $error = ""; // error messages sent here
var $response_code = ""; // response code returned from server
var $headers = array(); // headers returned from server sent here
- var $maxlength = 500000; // max return data length (body)
+ var $maxlength = 8192; // max return data length (body)
var $read_timeout = 0; // timeout on read operations, in seconds
// supported only since PHP 4 Beta 4
// set to 0 to disallow timeouts
@@ -720,13 +720,13 @@ class Snoopy
chr(176),
chr(39),
chr(128),
- "ä",
- "ö",
- "ü",
- "Ä",
- "Ö",
- "Ü",
- "ß",
+ "ä",
+ "ö",
+ "ü",
+ "Ä",
+ "Ö",
+ "Ü",
+ "ß",
);
$text = preg_replace($search,$replace,$document);
@@ -1238,7 +1238,9 @@ class Snoopy
if (!is_readable($file_name)) continue;
$fp = fopen($file_name, "r");
- $file_content = fread($fp, filesize($file_name));
+ while (!feof($fp)) {
+ $file_content = fread($fp, filesize($file_name));
+ }
fclose($fp);
$base_name = basename($file_name);
diff --git a/wp-includes/post.php b/wp-includes/post.php
index c89c552..af34198 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -652,22 +652,7 @@ function wp_insert_post($postarr = array()) {
}
if ($post_status == 'publish' && $post_type == 'post') {
- do_action('publish_post', $post_ID);
-
- if ( !defined('WP_IMPORTING') ) {
- if ( $post_pingback )
- $result = $wpdb->query("
- INSERT INTO $wpdb->postmeta
- (post_id,meta_key,meta_value)
- VALUES ('$post_ID','_pingme','1')
- ");
- $result = $wpdb->query("
- INSERT INTO $wpdb->postmeta
- (post_id,meta_key,meta_value)
- VALUES ('$post_ID','_encloseme','1')
- ");
- wp_schedule_single_event(time(), 'do_pings');
- }
+ wp_publish_post($post_ID);
} else if ($post_type == 'page') {
wp_cache_delete('all_page_ids', 'pages');
$wp_rewrite->flush_rules();
@@ -731,15 +716,36 @@ function wp_update_post($postarr = array()) {
}
function wp_publish_post($post_id) {
+ global $wpdb;
+
$post = get_post($post_id);
if ( empty($post) )
return;
- if ( 'publish' == $post->post_status )
+ if ( 'publish' != $post->post_status )
+ $wpdb->query("UPDATE IGNORE $wpdb->posts SET post_status = 'publish' WHERE ID = $post_id");
+
+ do_action('publish_post', $post_id);
+
+ if ( defined('WP_IMPORTING') )
return;
- return wp_update_post(array('post_status' => 'publish', 'ID' => $post_id));
+ $post_pingback = get_option('default_pingback_flag');
+ if ( $post_pingback )
+ $result = $wpdb->query("
+ INSERT INTO $wpdb->postmeta
+ (post_id,meta_key,meta_value)
+ VALUES ('$post_ID','_pingme','1')
+ ");
+
+ $result = $wpdb->query("
+ INSERT INTO $wpdb->postmeta
+ (post_id,meta_key,meta_value)
+ VALUES ('$post_ID','_encloseme','1')
+ ");
+
+ wp_schedule_single_event(time(), 'do_pings');
}
function wp_set_post_categories($post_ID = 0, $post_categories = array()) {
diff --git a/wp-includes/theme.php b/wp-includes/theme.php
index 2ce5641..9130394 100644
--- a/wp-includes/theme.php
+++ b/wp-includes/theme.php
@@ -50,24 +50,24 @@ function get_theme_data($theme_file) {
preg_match("|Author URI:(.*)|i", $theme_data, $author_uri);
preg_match("|Template:(.*)|i", $theme_data, $template);
if ( preg_match("|Version:(.*)|i", $theme_data, $version) )
- $version = $version[1];
+ $version = trim($version[1]);
else
$version ='';
if ( preg_match("|Status:(.*)|i", $theme_data, $status) )
- $status = $status[1];
+ $status = trim($status[1]);
else
- $status ='publish';
+ $status = 'publish';
- $description = wptexturize($description[1]);
+ $description = wptexturize(trim($description[1]));
$name = $theme_name[1];
$name = trim($name);
$theme = $name;
if ( '' == $author_uri[1] ) {
- $author = $author_name[1];
+ $author = trim($author_name[1]);
} else {
- $author = '<a href="' . $author_uri[1] . '" title="' . __('Visit author homepage') . '">' . $author_name[1] . '</a>';
+ $author = '<a href="' . trim($author_uri[1]) . '" title="' . __('Visit author homepage') . '">' . trim($author_name[1]) . '</a>';
}
return array('Name' => $name, 'Title' => $theme, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template[1], 'Status' => $status);
@@ -371,6 +371,10 @@ function load_template($file) {
}
function validate_current_theme() {
+ // Don't validate during an install/upgrade.
+ if ( defined('WP_INSTALLING') )
+ return true;
+
if ((get_template() != 'default') && (!file_exists(get_template_directory() . '/index.php'))) {
update_option('template', 'default');
update_option('stylesheet', 'default');