Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge pull request #227 from samsonasik/strpos
Browse files Browse the repository at this point in the history
change substr with strpos when possible
  • Loading branch information
weierophinney committed Dec 13, 2018
2 parents 932f250 + 9e3569a commit 93be67f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CreditCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public function isValid($value)
$foundl = false;
foreach ($types as $type) {
foreach ($this->cardType[$type] as $prefix) {
if (substr($value, 0, strlen($prefix)) == $prefix) {
if (0 === strpos($value, $prefix)) {
$foundp = true;
if (in_array($length, $this->cardLength[$type])) {
$foundl = true;
Expand Down

0 comments on commit 93be67f

Please sign in to comment.