[wp-cvs] wordpress/wp-admin post.php,1.69,1.70

Ryan Boren rboren at users.sourceforge.net
Sat Jul 24 03:22:51 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15107/wp-admin

Modified Files:
	post.php 
Log Message:
If the sanitized title is empty, fallback to the post ID for the nicename. http://mosquito.wordpress.org/bug_view_page.php?bug_id=0000116

Index: post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/post.php,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** post.php	30 Jun 2004 02:02:49 -0000	1.69
--- post.php	24 Jul 2004 03:22:49 -0000	1.70
***************
*** 46,49 ****
--- 46,51 ----
  		require_once('admin-header.php');
  
+         $post_ID = $wpdb->get_var("SELECT ID FROM $wpdb->posts ORDER BY ID DESC LIMIT 1") + 1;
+ 
  		$post_pingback = intval($_POST['post_pingback']);
  		$content = balanceTags($_POST['content']);
***************
*** 72,78 ****
  		
  		if (empty($post_name))
! 			$post_name = sanitize_title($post_title);
  		else
! 			$post_name = sanitize_title($post_name);
  
  		$trackback = $_POST['trackback_url'];
--- 74,80 ----
  		
  		if (empty($post_name))
! 			$post_name = sanitize_title($post_title, $post_ID);
  		else
! 			$post_name = sanitize_title($post_name, $post_ID);
  
  		$trackback = $_POST['trackback_url'];
***************
*** 124,129 ****
  	$result = $wpdb->query($postquery);
  
- 	$post_ID = $wpdb->get_var("SELECT ID FROM $wpdb->posts ORDER BY ID DESC LIMIT 1");
- 
  	if (!empty($_POST['mode'])) {
  	switch($_POST['mode']) {
--- 126,129 ----
***************
*** 303,307 ****
  		//if (!$_POST['ping_status']) $ping_status = get_settings('default_ping_status');
  		$post_password = $_POST['post_password'];
! 		$post_name = sanitize_title($_POST['post_name']);
  		if (empty($post_name)) $post_name = sanitize_title($post_title);
  		$trackback = $_POST['trackback_url'];
--- 303,307 ----
  		//if (!$_POST['ping_status']) $ping_status = get_settings('default_ping_status');
  		$post_password = $_POST['post_password'];
! 		$post_name = sanitize_title($_POST['post_name'], $post_ID);
  		if (empty($post_name)) $post_name = sanitize_title($post_title);
  		$trackback = $_POST['trackback_url'];




More information about the cvs mailing list