This repository was archived by the owner on May 31, 2024. It is now read-only.
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)
54
54
$ knownLen = self ::safeStrlen ($ knownString );
55
55
$ userLen = self ::safeStrlen ($ userInput );
56
56
57
- if ($ userLen != $ knownLen ) {
57
+ if ($ userLen != = $ knownLen ) {
58
58
return false ;
59
59
}
60
60
@@ -69,21 +69,22 @@ public static function equals($knownString, $userInput)
69
69
}
70
70
71
71
/**
72
- * Return the number of bytes in a string
72
+ * Returns the number of bytes in a string.
73
73
*
74
74
* @param string $string The string whose length we wish to obtain
75
+ *
75
76
* @return int
76
77
*/
77
78
public static function safeStrlen ($ string )
78
79
{
79
80
// Premature optimization
80
81
// 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 ' );
84
85
}
85
86
86
- if ($ func_exists ) {
87
+ if ($ funcExists ) {
87
88
return mb_strlen ($ string , '8bit ' );
88
89
}
89
90
You can’t perform that action at this time.
0 commit comments