Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-12119

ShowAccessDeniedReason enabled will cause PHP Warning

    XMLWordPrintable

Details

    Description

      If ShowAccessDeniedReason is enabled and a page without access will be entered a PHP warning will be shown:

      Warning: Invalid argument supplied for foreach() in /home/dis/dev/ezpublish/trunk/kernel/error/view.php
      <code>
      
      Patch to fix this:
      <code>
      Index: kernel/error/view.php
      ===================================================================
      --- kernel/error/view.php       (revision 20915)
      +++ kernel/error/view.php       (working copy)
      @@ -165,8 +165,11 @@
                           $accessMessage .= " PolicyID : " . $policy['PolicyID'] . "\n" ;
                           $accessMessage .= "  Limitation : " . $policy['LimitationList']['Limitation'] . "\n" ;
                           $accessMessage .= "  Required : ";
      -                    foreach ( $policy['LimitationList']['Required'] as $required )
      -                        $accessMessage .= "$required, ";
      +                   if ( isset( $policy['LimitationList']['Required'] ) )
      +                   {
      +                        foreach ( $policy['LimitationList']['Required'] as $required )
      +                            $accessMessage .= "$required, ";
      +                    }
                           $accessMessage .= "\n";
                       }
                   }
      

      Attachments

        Activity

          People

            cyberwolf cyberwolf
            dis dis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: