File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 44 "license" : " MIT" ,
55 "keywords" : [" dns" ],
66 "require" : {
7- "php" : " >=7.0"
7+ "php" : " >=7.0" ,
8+ "ext-ctype" : " *"
89 },
910 "autoload" : {
1011 "psr-4" : {
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public function setOctets(array $octets)
8181 }
8282
8383 foreach ($ octets as &$ octet ) {
84- if (\strspn (( string ) $ octet, " 0123456789 " ) !== \strlen ((string )$ octet ) || $ octet < 0x00 || $ octet > 0xff ) {
84+ if ((! \is_int ( $ octet) && ! \ctype_digit ((string )$ octet) ) || $ octet < 0x00 || $ octet > 0xff ) {
8585 throw new \UnexpectedValueException ('Octet list is not a valid IPv4 address: invalid octet value ' . $ octet );
8686 }
8787
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ public function setShorts(array $shorts)
145145 }
146146
147147 foreach ($ shorts as &$ short ) {
148- if (\strspn (( string ) $ short, " 0123456789 " ) !== \strlen ( $ short ) || $ short < 0x0000 || $ short > 0xffff ) {
148+ if ((! \is_int ( $ short) && ! \ctype_digit (( string ) $ short) ) || $ short < 0x0000 || $ short > 0xffff ) {
149149 throw new \UnexpectedValueException ('Short list is not a valid IPv6 address: invalid short value ' . $ short );
150150 }
151151
You can’t perform that action at this time.
0 commit comments