Stationtype ?keyword?: check regex

This commit is contained in:
oliver 2016-01-31 17:21:11 +01:00
parent 813152b091
commit cf21b6c1a0

View file

@ -157,9 +157,16 @@
*/
private function isMatching($regex, $answer)
{
// Check regex
if(empty($regex)) {
return false;
}
// Execute regex
$score = preg_match($regex, trim($answer));
// Return result
return ($score !== false && $score > 0);
}