[wp-cvs] wordpress/wp-admin post.php,1.102,1.103
Michel Valdrighi
michelvaldrighi at users.sourceforge.net
Mon Oct 18 15:58:08 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18234/wp-admin
Modified Files:
post.php
Log Message:
fix for bug #328: better/sane way to get before using it as a fallback for post_name
Index: post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/post.php,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -d -r1.102 -r1.103
*** post.php 18 Oct 2004 12:09:19 -0000 1.102
--- post.php 18 Oct 2004 15:58:06 -0000 1.103
***************
*** 45,50 ****
}
- $post_ID = $wpdb->get_var("SELECT MAX(ID) FROM $wpdb->posts") + 1;
-
$post_pingback = intval($_POST['post_pingback']);
$content = apply_filters('content_save_pre', $_POST['content']);
--- 45,48 ----
***************
*** 74,84 ****
$post_password = $_POST['post_password'];
- if ( empty($post_name) ) {
- if ( !empty($post_title) )
- $post_name = sanitize_title($post_title, $post_ID);
- } else {
- $post_name = sanitize_title($post_name, $post_ID);
- }
-
$trackback = $_POST['trackback_url'];
$trackback = preg_replace('|\s+|', "\n", $trackback);
--- 72,75 ----
***************
*** 109,112 ****
--- 100,113 ----
if ('' != $_POST['savepage']) $post_status = 'static';
+ $id_result = $wpdb->get_row("SHOW TABLE STATUS LIKE '$wpdb->posts'");
+ $post_ID = $id_result->Auto_increment;
+
+ if ( empty($post_name) ) {
+ if ( !empty($post_title) )
+ $post_name = sanitize_title($post_title, $post_ID);
+ } else {
+ $post_name = sanitize_title($post_name, $post_ID);
+ }
+
$postquery ="INSERT INTO $wpdb->posts
(ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt, post_parent)
More information about the cvs
mailing list