Revision: 1995
Author: olavmrk
Date: Wed Nov 18 00:14:44 2009
Log: Auth_State: Make loadExceptionState return NULL if no exception was  
passed to the current page.
http://code.google.com/p/simplesamlphp/source/detail?r=1995

Modified:
  /trunk/lib/SimpleSAML/Auth/State.php

=======================================
--- /trunk/lib/SimpleSAML/Auth/State.php        Tue Oct 27 05:51:50 2009
+++ /trunk/lib/SimpleSAML/Auth/State.php        Wed Nov 18 00:14:44 2009
@@ -245,13 +245,16 @@
         * Retrieve an exception state.
         *
         * @param string|NULL $id  The exception id. Can be NULL, in which case 
 
it will be retrieved from the request.
-        * @return array  The state array with the exception.
+        * @return array|NULL  The state array with the exception, or NULL if 
no  
exception was thrown.
         */
        public static function loadExceptionState($id = NULL) {
                assert('is_string($id) || is_null($id)');

                if ($id === NULL) {
-                       assert('array_key_exists(self::EXCEPTION_PARAM, 
$_REQUEST)');
+                       if (!array_key_exists(self::EXCEPTION_PARAM, 
$_REQUEST)) {
+                               /* No exception. */
+                               return NULL;
+                       }
                        $id = $_REQUEST[self::EXCEPTION_PARAM];
                }

--

You received this message because you are subscribed to the Google Groups 
"simpleSAMLphp commits" group.
To post to this group, send email to [email protected].
For more options, visit this group at 
http://groups.google.com/group/simplesamlphp-commits?hl=.


Reply via email to