File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ public static function equals($knownString, $userInput)
5454 $ knownLen = self ::safeStrlen ($ knownString );
5555 $ userLen = self ::safeStrlen ($ userInput );
5656
57- if ($ userLen != $ knownLen ) {
57+ if ($ userLen != = $ knownLen ) {
5858 return false ;
5959 }
6060
@@ -69,21 +69,22 @@ public static function equals($knownString, $userInput)
6969 }
7070
7171 /**
72- * Return the number of bytes in a string
72+ * Returns the number of bytes in a string.
7373 *
7474 * @param string $string The string whose length we wish to obtain
75+ *
7576 * @return int
7677 */
7778 public static function safeStrlen ($ string )
7879 {
7980 // Premature optimization
8081 // Since this cannot be changed at runtime, we can cache it
81- static $ func_exists = null ;
82- if ($ func_exists === null ) {
83- $ func_exists = function_exists ('mb_strlen ' );
82+ static $ funcExists = null ;
83+ if (null === $ funcExists ) {
84+ $ funcExists = function_exists ('mb_strlen ' );
8485 }
8586
86- if ($ func_exists ) {
87+ if ($ funcExists ) {
8788 return mb_strlen ($ string , '8bit ' );
8889 }
8990
You can’t perform that action at this time.
0 commit comments