Skip to content

Commit

Permalink
Update FieldHelper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
esokullu authored Mar 20, 2018
1 parent 5c298f1 commit fc45943
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Pho/Framework/FieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ public function probe(): void
case "lessThan":
Assert::$constraint($this->value, $constraint_val);
break;

//case "uuid":

case "id":
try {
LibGraph\ID::fromString($this->value);
Expand All @@ -183,7 +182,10 @@ public function probe(): void
break;

case "regex":
Assert::$constraint($this->value, "/".addslashes($constraint_val)."/");
if($constraint_val[0]!="/")
Assert::$constraint($this->value, "/".addslashes($constraint_val)."/");
else
Assert::$constraint($this->value, $constraint_val);
break;
}
}
Expand Down

0 comments on commit fc45943

Please sign in to comment.