Skip to content

Commit bb69b61

Browse files
committed
protect - (not a range)
fix PHP 7.3 warning "preg_match(): Compilation failed: invalid range in character class at offset 8"
1 parent ea17eff commit bb69b61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/OpenCloud/Compute/Resource/KeyPair.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class KeyPair extends PersistentObject
4141

4242
public function setName($name)
4343
{
44-
if (preg_match('#[^\w\d\s-_]#', $name) || strlen($name) > 255) {
44+
if (preg_match('#[^\w\d\s\-_]#', $name) || strlen($name) > 255) {
4545
throw new InvalidArgumentError(sprintf(
4646
'The key name may not exceed 255 characters. It can contain the'
4747
. ' following characters: alphanumeric, spaces, dashes and'

0 commit comments

Comments
 (0)