File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55namespace SimpleSAML \WebServices \Security \Assert ;
66
7+ use SimpleSAML \Assert \AssertionFailedException ;
78use SimpleSAML \WebServices \Security \Exception \ProtocolViolationException ;
89
910/**
@@ -17,12 +18,15 @@ trait DateTimeTrait
1718 */
1819 protected static function validDateTime (string $ value , string $ message = '' ): void
1920 {
20- parent ::validDateTime ($ value );
21- parent ::endsWith (
22- $ value ,
23- 'Z ' ,
24- '%s is not a DateTime expressed in the UTC timezone using the \'Z \' timezone identifier. ' ,
25- ProtocolViolationException::class,
26- );
21+ try {
22+ parent ::validDateTime ($ value );
23+ parent ::endsWith (
24+ $ value ,
25+ 'Z ' ,
26+ '%s is not a DateTime expressed in the UTC timezone using the \'Z \' timezone identifier. ' ,
27+ );
28+ } catch (AssertionFailedException $ e ) {
29+ throw new ProtocolViolationException ($ message ?: $ e ->getMessage ());
30+ }
2731 }
2832}
You can’t perform that action at this time.
0 commit comments