prep_atom_text_construct() and before_last_bar() should strictly check against false when using str(r)?pos().

Sidenote: there's a function named `before_last_bar`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32940 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-06-25 16:48:14 +00:00
parent f335ef9a66
commit 9cef023a96
2 changed files with 2 additions and 2 deletions

View File

@ -580,7 +580,7 @@ function prep_atom_text_construct($data) {
}
}
if (strpos($data, ']]>') == false) {
if (strpos($data, ']]>') === false) {
return array('html', "<![CDATA[$data]]>");
} else {
return array('html', htmlspecialchars($data));

View File

@ -116,7 +116,7 @@ function translate( $text, $domain = 'default' ) {
*/
function before_last_bar( $string ) {
$last_bar = strrpos( $string, '|' );
if ( false == $last_bar )
if ( false === $last_bar )
return $string;
else
return substr( $string, 0, $last_bar );