]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - extlib/Auth/OpenID/PAPE.php
Update the (formerly) Janrain OpenID library to 2.2.2 -- bug fixes including PHP...
[quix0rs-gnu-social.git] / extlib / Auth / OpenID / PAPE.php
index 62cba8a912d46cf6691d3920bab55966d9cde10b..f08ca8bd0b21e358e976d790bb11af91c718fb9e 100644 (file)
@@ -21,7 +21,7 @@ define('PAPE_AUTH_PHISHING_RESISTANT',
        'http://schemas.openid.net/pape/policies/2007/06/phishing-resistant');
 
 define('PAPE_TIME_VALIDATOR',
-       '^[0-9]{4,4}-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]Z$');
+      '/^[0-9]{4,4}-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]Z$/');
 /**
  * A Provider Authentication Policy request, sent from a relying party
  * to a provider
@@ -82,7 +82,7 @@ class Auth_OpenID_PAPE_Request extends Auth_OpenID_Extension {
      * Instantiate a Request object from the arguments in a checkid_*
      * OpenID message
      */
-    function fromOpenIDRequest($request)
+    static function fromOpenIDRequest($request)
     {
         $obj = new Auth_OpenID_PAPE_Request();
         $args = $request->message->getArgs(Auth_OpenID_PAPE_NS_URI);
@@ -201,7 +201,7 @@ class Auth_OpenID_PAPE_Response extends Auth_OpenID_Extension {
      * @returns: A provider authentication policy response from the
      * data that was supplied with the id_res response.
      */
-    function fromSuccessResponse($success_response)
+    static function fromSuccessResponse($success_response)
     {
         $obj = new Auth_OpenID_PAPE_Response();
 
@@ -262,7 +262,7 @@ class Auth_OpenID_PAPE_Response extends Auth_OpenID_Extension {
 
         $auth_time = Auth_OpenID::arrayGet($args, 'auth_time');
         if ($auth_time !== null) {
-            if (ereg(PAPE_TIME_VALIDATOR, $auth_time)) {
+            if (preg_match(PAPE_TIME_VALIDATOR, $auth_time)) {
                 $this->auth_time = $auth_time;
             } else if ($strict) {
                 return false;
@@ -287,7 +287,7 @@ class Auth_OpenID_PAPE_Response extends Auth_OpenID_Extension {
         }
 
         if ($this->auth_time !== null) {
-            if (!ereg(PAPE_TIME_VALIDATOR, $this->auth_time)) {
+            if (!preg_match(PAPE_TIME_VALIDATOR, $this->auth_time)) {
                 return false;
             }
 
@@ -298,4 +298,3 @@ class Auth_OpenID_PAPE_Response extends Auth_OpenID_Extension {
     }
 }
 
-?>
\ No newline at end of file