includes/paths.php
changeset 391 85f91037cd4f
parent 387 92664d2efab8
child 395 fa4c5ecb7c9a
equal deleted inserted replaced
390:9bcc185dc151 391:85f91037cd4f
   131     return ( $sanitize ) ? sanitize_page_id($title) : $title;
   131     return ( $sanitize ) ? sanitize_page_id($title) : $title;
   132   }
   132   }
   133   function init()
   133   function init()
   134   {
   134   {
   135     global $db, $session, $paths, $template, $plugins; // Common objects
   135     global $db, $session, $paths, $template, $plugins; // Common objects
       
   136     global $lang;
   136     
   137     
   137     $code = $plugins->setHook('paths_init_before');
   138     $code = $plugins->setHook('paths_init_before');
   138     foreach ( $code as $cmd )
   139     foreach ( $code as $cmd )
   139     {
   140     {
   140       eval($cmd);
   141       eval($cmd);
   357         }
   358         }
   358         else
   359         else
   359         {
   360         {
   360           $main_page = makeUrl($this->pages[0]['urlname']);
   361           $main_page = makeUrl($this->pages[0]['urlname']);
   361         }
   362         }
   362         $sp_link = '<a href="' . makeUrlNS('Special', 'SpecialPages') . '">here</a>';
   363         redirect($main_page, $lang->get('page_msg_special_404_title'), $lang->get('page_msg_special_404_body', array('sp_link' => makeUrlNS('Special', 'SpecialPages'))), 15);
   363         redirect($main_page, 'Can\'t load special page', 'The special page you requested could not be found. This may be due to a plugin failing to load. A list of all special pages on this website can be viewed '.$sp_link.'. You will be redirected to the main page in 15 seconds.', 14);
       
   364         exit;
   364         exit;
   365       }
   365       }
   366       // Allow the user to create/modify his user page uncondtionally (admins can still protect the page)
   366       // Allow the user to create/modify his user page uncondtionally (admins can still protect the page)
   367       if($this->page == $this->nslist['User'].str_replace(' ', '_', $session->username)) 
   367       if($this->page == $this->nslist['User'].str_replace(' ', '_', $session->username)) 
   368       {
   368       {