diff options
-rw-r--r-- | wp-inst/wp-admin/admin-footer.php | 2 | ||||
-rw-r--r-- | wp-inst/wp-admin/edit-form-ajax-cat.php | 4 | ||||
-rw-r--r-- | wp-inst/wp-admin/execute-pings.php | 37 | ||||
-rw-r--r-- | wp-inst/wp-admin/install.php | 2 | ||||
-rw-r--r-- | wp-inst/wp-comments-post.php | 8 | ||||
-rw-r--r-- | wp-inst/wp-includes/classes.php | 6 | ||||
-rw-r--r-- | wp-inst/wp-includes/functions-post.php | 14 | ||||
-rw-r--r-- | wp-inst/wp-includes/functions.php | 13 |
8 files changed, 73 insertions, 13 deletions
diff --git a/wp-inst/wp-admin/admin-footer.php b/wp-inst/wp-admin/admin-footer.php index 7fb95ea..ce431d4 100644 --- a/wp-inst/wp-admin/admin-footer.php +++ b/wp-inst/wp-admin/admin-footer.php @@ -6,7 +6,7 @@ </p> </div> - +<?php check_for_pings(); ?> <?php do_action('admin_footer', ''); ?> </body> diff --git a/wp-inst/wp-admin/edit-form-ajax-cat.php b/wp-inst/wp-admin/edit-form-ajax-cat.php index 14ece3e..63659b6 100644 --- a/wp-inst/wp-admin/edit-form-ajax-cat.php +++ b/wp-inst/wp-admin/edit-form-ajax-cat.php @@ -24,10 +24,10 @@ $cat_name = rawurldecode($_GET['ajaxnewcat']); if ( !$category_nicename = sanitize_title($cat_name) ) die('0'); if ( $already = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'") ) - die($already); + die((string) $already); $cat_name = $wpdb->escape($cat_name); $cat_array = compact('cat_name', 'category_nicename'); wp_insert_category($cat_array); -die($new_cat_id); +die((string) $new_cat_id); ?> diff --git a/wp-inst/wp-admin/execute-pings.php b/wp-inst/wp-admin/execute-pings.php new file mode 100644 index 0000000..97499ba --- /dev/null +++ b/wp-inst/wp-admin/execute-pings.php @@ -0,0 +1,37 @@ +<?php +require_once('admin.php'); + +if ( ! current_user_can('edit_posts') ) + die ("Cheatin' uh?"); + +echo '/* No Styles Here */'; +register_shutdown_function('execute_all_pings'); +//execute_all_pings(); + +function execute_all_pings() { + global $wpdb; + // Do pingbacks + if($pings = $wpdb->get_results("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme';")) { + foreach($pings as $ping) { + pingback($ping->post_content, $ping->ID); + //echo "Pingback: $ping->post_title : $ping->ID<br/>"; + $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme';"); + } + } + // Do Enclosures + if($enclosures = $wpdb->get_results("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme';")) { + foreach($enclosures as $enclosure) { + do_enclose($enclosure->post_content, $enclosure->ID); + //echo "Enclosure: $enclosure->post_title : $enclosure->ID<br/>"; + $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$enclosure->ID} AND meta_key = '_encloseme';"); + } + } + // Do Trackbacks + if($trackbacks = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE TRIM(to_ping) != ''")) { + foreach($trackbacks as $trackback) { + //echo "trackback : $trackback->ID<br/>"; + do_trackback($trackback->ID); + } + } +} +?> diff --git a/wp-inst/wp-admin/install.php b/wp-inst/wp-admin/install.php index f2cfb17..53ba859 100644 --- a/wp-inst/wp-admin/install.php +++ b/wp-inst/wp-admin/install.php @@ -194,7 +194,7 @@ We hope you enjoy your new weblog. Thanks! http://wordpress.org/ "), $guessurl, $random_password); -@mail($admin_email, __('New WordPress Blog'), $message, $message_headers); +@wp_mail($admin_email, __('New WordPress Blog'), $message, $message_headers); upgrade_all(); ?> diff --git a/wp-inst/wp-comments-post.php b/wp-inst/wp-comments-post.php index f354c58..3440ae8 100644 --- a/wp-inst/wp-comments-post.php +++ b/wp-inst/wp-comments-post.php @@ -48,9 +48,11 @@ $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_emai wp_new_comment($commentdata); -setcookie('comment_author_' . COOKIEHASH, stripslashes($comment_author), time() + 30000000, COOKIEPATH); -setcookie('comment_author_email_' . COOKIEHASH, stripslashes($comment_author_email), time() + 30000000, COOKIEPATH); -setcookie('comment_author_url_' . COOKIEHASH, stripslashes($comment_author_url), time() + 30000000, COOKIEPATH); +if ( !$user_ID ) : + setcookie('comment_author_' . COOKIEHASH, stripslashes($comment_author), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); + setcookie('comment_author_email_' . COOKIEHASH, stripslashes($comment_author_email), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); + setcookie('comment_author_url_' . COOKIEHASH, stripslashes($comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); +endif; nocache_headers(); diff --git a/wp-inst/wp-includes/classes.php b/wp-inst/wp-includes/classes.php index d027514..770f848 100644 --- a/wp-inst/wp-includes/classes.php +++ b/wp-inst/wp-includes/classes.php @@ -915,7 +915,7 @@ class WP_Rewrite { } function get_year_permastruct() { - $structure = $this->get_date_permastruct($permalink_structure); + $structure = $this->get_date_permastruct($this->permalink_structure); if (empty($structure)) { return false; @@ -930,7 +930,7 @@ class WP_Rewrite { } function get_month_permastruct() { - $structure = $this->get_date_permastruct($permalink_structure); + $structure = $this->get_date_permastruct($this->permalink_structure); if (empty($structure)) { return false; @@ -944,7 +944,7 @@ class WP_Rewrite { } function get_day_permastruct() { - return $this->get_date_permastruct($permalink_structure); + return $this->get_date_permastruct($this->permalink_structure); } function get_category_permastruct() { diff --git a/wp-inst/wp-includes/functions-post.php b/wp-inst/wp-includes/functions-post.php index f79be3e..e5ddbfd 100644 --- a/wp-inst/wp-includes/functions-post.php +++ b/wp-inst/wp-includes/functions-post.php @@ -155,9 +155,17 @@ function wp_insert_post($postarr = array()) { if ($post_status == 'publish') { do_action('publish_post', $post_ID); if ($post_pingback) - register_shutdown_function('pingback', $content, $post_ID); - register_shutdown_function('do_enclose', $content, $post_ID ); - register_shutdown_function('do_trackbacks', $post_ID); + $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') + "); + //register_shutdown_function('do_trackbacks', $post_ID); } else if ($post_status == 'static') { generate_page_rewrite_rules(); diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php index ede626e..8d486ff 100644 --- a/wp-inst/wp-includes/functions.php +++ b/wp-inst/wp-includes/functions.php @@ -829,6 +829,19 @@ function debug_fclose($fp) { } } +function check_for_pings() { + global $wpdb; + $doping = false; + if($wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE TRIM(to_ping) != '' LIMIT 1")) { + $doping = true; + } + if($wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_pingme' OR meta_key = '_encloseme' LIMIT 1")) { + $doping = true; + } + if($doping) + echo '<iframe src="' . get_settings('siteurl') .'/wp-admin/execute-pings.php?time=' . time() . '" style="border:none;width:1px;height:1px;"></iframe>'; +} + function do_enclose( $content, $post_ID ) { global $wp_version, $wpdb; include_once (ABSPATH . WPINC . '/class-IXR.php'); |