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:
parent
41ca2c5621
commit
9a004ff9c8
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue