Skip to content

Commit 1e31258

Browse files
committed
Fix raised exception
1 parent 4efe2ab commit 1e31258

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Assert/XPathFilterTrait.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Exception;
88
use InvalidArgumentException;
99
use SimpleSAML\Assert\Assert as BaseAssert;
10+
use SimpleSAML\Assert\AssertionFailedException;
1011
use SimpleSAML\XML\Constants as C;
1112

1213
use function in_array;
@@ -148,7 +149,7 @@ public static function allowedXPathFilter(
148149
// Check that all the function names we found are in the list of allowed function names
149150
foreach ($matches[1] as $match) {
150151
if (!in_array($match, $allowed_functions)) {
151-
throw new InvalidArgumentException(sprintf(
152+
throw new AssertionFailedException(sprintf(
152153
$message ?: '\'%s\' is not an allowed XPath function.',
153154
$match,
154155
));
@@ -171,7 +172,7 @@ public static function allowedXPathFilter(
171172
// Check that all the axes names we found are in the list of allowed axes names
172173
foreach ($matches[1] as $match) {
173174
if (!in_array($match, $allowed_axes)) {
174-
throw new InvalidArgumentException(sprintf(
175+
throw new AssertionFailedException(sprintf(
175176
$message ?: '\'%s\' is not an allowed XPath axis.',
176177
$match,
177178
));

0 commit comments

Comments
 (0)