Ensure we don't mangle the array of link categories when sanitising a link for editing. See #12168.

git-svn-id: http://svn.automattic.com/wordpress/trunk@13017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-02-07 21:59:24 +00:00
parent 41ca2c5621
commit 9a004ff9c8
1 changed files with 7 additions and 0 deletions

View File

@ -325,6 +325,13 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
if ( in_array($field, $int_fields) )
$value = (int) $value;
// Fields which contain arrays of ints.
$array_int_fields = array( 'link_category' );
if ( in_array($field, $array_int_fields) ) {
$value = array_map( 'absint', $value);
return $value;
}
$yesno = array('link_visible');
if ( in_array($field, $yesno) )
$value = preg_replace('/[^YNyn]/', '', $value);