diff --git a/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php b/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php index 1d3764700..5a72b7d6d 100644 --- a/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php +++ b/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php @@ -76,9 +76,12 @@ class MetadataFilter extends \FilterIterator implements \Countable $metadata = $it->current(); foreach ($this->filter as $filter) { - $pregResult = preg_match("/" . preg_quote($filter) . "/", $metadata->name); + $pregResult = preg_match("/$filter/", $metadata->name); + if ($pregResult === false) { - return false; + throw new \RuntimeException( + sprintf("Error while evaluating regex '/%s/'.", $filter) + ); } if ($pregResult === 0) {