File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ public function setOctets(array $octets)
8686 }
8787
8888 foreach ($ octets as &$ octet ) {
89- if (! ctype_digit ((string ) $ octet ) || $ octet < 0x00 || $ octet > 0xff ) {
89+ if (strspn ((string )$ octet , " 0123456789 " ) !== strlen ( $ octet ) || $ octet < 0x00 || $ octet > 0xff ) {
9090 throw new \UnexpectedValueException ('Octet list is not a valid IPv4 address: invalid octet value ' . $ octet );
9191 }
9292
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ public function setShorts(array $shorts)
151151 }
152152
153153 foreach ($ shorts as &$ short ) {
154- if (! ctype_digit ((string ) $ short ) || $ short < 0x0000 || $ short > 0xffff ) {
154+ if (strspn ((string )$ short , " 0123456789 " ) !== strlen ( $ short ) || $ short < 0x0000 || $ short > 0xffff ) {
155155 throw new \UnexpectedValueException ('Short list is not a valid IPv6 address: invalid short value ' . $ short );
156156 }
157157
You can’t perform that action at this time.
0 commit comments