Skip to content

Instantly share code, notes, and snippets.

@harrisony
Last active December 11, 2015 03:09
Show Gist options
  • Save harrisony/4535862 to your computer and use it in GitHub Desktop.
Save harrisony/4535862 to your computer and use it in GitHub Desktop.
make simplesamlphp less strict in timezone parsing
--- Utilities.php.orig 2013-01-17 13:50:22.892638237 +1100
+++ Utilities.php 2013-01-17 13:49:42.712169200 +1100
@@ -355,7 +355,7 @@
/* We use a very strict regex to parse the timestamp. */
if(preg_match('/^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)' .
- 'T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.\\d+)?$/D',
+ 'T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.\\d+)?(Z)?$/D',
$time, $matches) == 0) {
throw new Exception(
'Invalid SAML2 timestamp passed to' .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment