@@ -104,7 +104,7 @@ public function expiresAfter($time)
104
104
*
105
105
* @return static
106
106
*
107
- * @throws InvalidArgumentException When $tag is not valid.
107
+ * @throws InvalidArgumentException When $tag is not valid
108
108
*/
109
109
public function tag ($ tags )
110
110
{
@@ -121,7 +121,7 @@ public function tag($tags)
121
121
if (!isset ($ tag [0 ])) {
122
122
throw new InvalidArgumentException ('Cache tag length must be greater than zero ' );
123
123
}
124
- if (isset ($ tag[ strcspn ( $ tag , '{}()/\@: ' )] )) {
124
+ if (false !== strpbrk ($ tag , '{}()/\@: ' )) {
125
125
throw new InvalidArgumentException (sprintf ('Cache tag "%s" contains reserved characters {}()/\@: ' , $ tag ));
126
126
}
127
127
$ this ->tags [$ tag ] = $ tag ;
@@ -135,7 +135,7 @@ public function tag($tags)
135
135
*
136
136
* @param string $key The key to validate
137
137
*
138
- * @throws InvalidArgumentException When $key is not valid.
138
+ * @throws InvalidArgumentException When $key is not valid
139
139
*/
140
140
public static function validateKey ($ key )
141
141
{
@@ -145,7 +145,7 @@ public static function validateKey($key)
145
145
if (!isset ($ key [0 ])) {
146
146
throw new InvalidArgumentException ('Cache key length must be greater than zero ' );
147
147
}
148
- if (isset ($ key[ strcspn ( $ key , '{}()/\@: ' )] )) {
148
+ if (false !== strpbrk ($ key , '{}()/\@: ' )) {
149
149
throw new InvalidArgumentException (sprintf ('Cache key "%s" contains reserved characters {}()/\@: ' , $ key ));
150
150
}
151
151
}
0 commit comments