Fixed some plugin compatibility issues seen in Nuggie
authorDan
Sat, 14 Jun 2008 22:01:24 -0400
changeset 570 4d0d5dae61e5
parent 569 6ba792bc9071
child 571 66e14e61613e
Fixed some plugin compatibility issues seen in Nuggie
includes/pageprocess.php
includes/sessions.php
--- a/includes/pageprocess.php	Tue Jun 10 10:51:44 2008 -0400
+++ b/includes/pageprocess.php	Sat Jun 14 22:01:24 2008 -0400
@@ -174,13 +174,12 @@
     
     profiler_log("PageProcessor [{$this->namespace}:{$this->page_id}]: Started send process");
     
-    if ( $this->send_headers )
-    {
-      $template->init_vars($this);
-    }
-    
     if ( !$this->perms->get_permissions('read') )
     {
+      if ( $this->send_headers )
+      {
+        $template->init_vars($this);
+      }
       // Permission denied to read page. Is this one of our core pages that must always be allowed?
       // NOTE: Not even the administration panel will work if ACLs deny access to it.
       if ( $this->namespace == 'Special' && in_array($this->page_id, array('Login', 'Logout', 'LangExportJSON', 'CSS')) )
@@ -199,6 +198,10 @@
     $strict_no_headers = false;
     if ( $this->namespace == 'Admin' && strstr($this->page_id, '/') )
     {
+      if ( $this->send_headers )
+      {
+        $template->init_vars($this);
+      }
       $this->page_id = substr($this->page_id, 0, strpos($this->page_id, '/'));
       $funcname = "page_{$this->namespace}_{$this->page_id}";
       if ( function_exists($funcname) )
@@ -208,6 +211,10 @@
     }
     if ( isset($paths->pages[$pathskey]) )
     {
+      if ( $this->send_headers )
+      {
+        $template->init_vars($this);
+      }
       if ( $paths->pages[$pathskey]['special'] == 1 )
       {
         $this->send_headers = false;
@@ -233,6 +240,11 @@
     }
     if ( $this->namespace == 'Special' || $this->namespace == 'Admin' )
     {
+      if ( $this->send_headers )
+      {
+        $template->init_vars($this);
+      }
+      
       $this->revision_time = time();
       
       if ( !$this->page_exists )
@@ -272,10 +284,20 @@
     }
     else if ( $this->namespace == 'User' && strpos($this->page_id, '/') === false )
     {
+      if ( $this->send_headers )
+      {
+        $template->init_vars($this);
+      }
+      
       $this->_handle_userpage();
     }
     else if ( ( $this->namespace == 'Template' || $this->namespace == 'System' ) && $this->page_exists )
     {
+      if ( $this->send_headers )
+      {
+        $template->init_vars($this);
+      }
+      
       $this->header();
       
       $text = $this->fetch_text();
@@ -290,6 +312,11 @@
     }
     else if ( $this->namespace == 'Anonymous' )
     {
+      if ( $this->send_headers )
+      {
+        $template->init_vars($this);
+      }
+      
       $uri = scriptPath . '/' . $this->page_id;
       if ( !$this->send_headers )
       {
@@ -313,6 +340,10 @@
       
       if ( empty($ob) )
       {
+        if ( $this->send_headers )
+        {
+          $template->init_vars($this);
+        }
         $this->err_page_not_existent();
       }
       else
@@ -327,6 +358,10 @@
     else // (disabled for compatibility reasons) if ( in_array($this->namespace, array('Article', 'User', 'Project', 'Help', 'File', 'Category')) && $this->page_exists )
     {
       // Send as regular page
+      if ( $this->send_headers )
+      {
+        $template->init_vars($this);
+      }
       
       // die($this->page_id);
       
--- a/includes/sessions.php	Tue Jun 10 10:51:44 2008 -0400
+++ b/includes/sessions.php	Sat Jun 14 22:01:24 2008 -0400
@@ -3091,7 +3091,7 @@
    * @return array
    */
    
-  function acl_merge($perm1, $perm2, $is_everyone = false, &$defaults_used)
+  function acl_merge($perm1, $perm2, $is_everyone = false, &$defaults_used = array())
   {
     $ret = $perm1;
     if ( !is_array(@$defaults_used) )