[wp-trac] [WordPress Trac] #6394: Leading and trailing white space
in values of custom fields should not be trimmed
WordPress Trac
wp-trac at lists.automattic.com
Wed Mar 26 19:28:05 GMT 2008
#6394: Leading and trailing white space in values of custom fields should not be
trimmed
-----------------------+----------------------------------------------------
Reporter: aercolino | Owner: markjaquith
Type: defect | Status: new
Priority: normal | Milestone: 2.5
Component: General | Version:
Severity: normal | Keywords: meta value, custom field
-----------------------+----------------------------------------------------
Custom fields that begin or end with white space in their key or value are
trimmed.
I can undestand that a key is more easily dealt with if it is trimmed
before saving it into the database. But values should definitely retain
all their white space AS IS.
'''Suggested Fix'''
http://trac.wordpress.org/browser/trunk/wp-includes/functions.php#L405
(7508)
{{{
function maybe_serialize($data, $trim = true) { //was
maybe_serialize($data)
}}}
http://trac.wordpress.org/browser/trunk/wp-includes/functions.php#L406
(7508)
{{{
if ( $trim && is_string($data) ) //was if ( is_string( $data ) )
}}}
http://trac.wordpress.org/browser/trunk/wp-admin/includes/post.php#L365
(7458)
{{{
$metavalue = maybe_serialize( stripslashes( ( $_POST['metavalue'] ) ),
false ); //was $metavalue = maybe_serialize( stripslashes( (trim(
$_POST['metavalue'] ) ) ));
}}}
http://trac.wordpress.org/browser/trunk/wp-admin/includes/post.php#L449
(7458)
{{{
$mvalue = maybe_serialize( stripslashes( $mvalue ), false ); //was $mvalue
= maybe_serialize( stripslashes( $mvalue ));
}}}
----
[http://noteslog.com/post/wordpress-rendering-troubles/ WordPress
Rendering Troubles]
--
Ticket URL: <http://trac.wordpress.org/ticket/6394>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list