Make checked and selected compare more carefully and update the phpdoc with the correct @since version. Fixes #9862 props Denis-de-Bernardy.

git-svn-id: https://develop.svn.wordpress.org/trunk@11703 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2009-07-09 21:13:23 +00:00
parent 7cda7bfd4d
commit 1d984da04a
1 changed files with 3 additions and 3 deletions

View File

@ -376,7 +376,7 @@ function link_cat_row( $category, $name_override = false ) {
*
* Compares the first two arguments and if identical marks as checked
*
* @since 2.8
* @since 1.0
*
* @param any $checked One of the values to compare
* @param any $current (true) The other value to compare if not just true
@ -391,7 +391,7 @@ function checked( $checked, $current = true, $echo = true) {
*
* Compares the first two arguments and if identical marks as selected
*
* @since 2.8
* @since 1.0
*
* @param any selected One of the values to compare
* @param any $current (true) The other value to compare if not just true
@ -415,7 +415,7 @@ function selected( $selected, $current = true, $echo = true) {
* @param string $type The type of checked|selected we are doing.
*/
function __checked_selected_helper( $helper, $current, $echo, $type) {
if ( $helper == $current)
if ( (string) $helper === (string) $current)
$result = " $type='$type'";
else
$result = '';