Changeset 812 for trunk


Ignore:
Timestamp:
May 31, 2014, 9:35:15 AM (10 years ago)
Author:
chronos
Message:
  • Fixed: "Page not found" was not handled correctly. It was handled incorrectly by Redirection module.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Redirection/Redirection.php

    r807 r812  
    2020  }
    2121
     22  function Redirect($Location)
     23  {
     24        Header($_SERVER['SERVER_PROTOCOL'].' 301 Moved Permanently');
     25    Header('Location: '.$Location);
     26    return('<h3 align="center">Požadovaná stránka byla přesunuta do nového umístění.</h3>');
     27  }
     28
    2229  function ShowRedirect()
    2330  {
    24     Header($_SERVER['SERVER_PROTOCOL'].' 301 Moved Permanently');
     31    $Output = '';
    2532    if(count($this->System->PathItems) > 0)
    2633    {
    27         if($this->System->PathItems[0] == 'team.php') Header('Location: '.$this->System->Link('/team/'));
    28       if($this->System->PathItems[0] == 'version.php') Header('Location: '.$this->System->Link('/client-version/'));
    29       if($this->System->PathItems[0] == 'phpBB3') Header('Location: '.$this->System->Link('/forum/'));
    30       if($this->System->PathItems[0] == 'phpbb3') Header('Location: '.$this->System->Link('/forum/'));
    31       if($this->System->PathItems[0] == 'statistic.php') Header('Location: '.$this->System->Link('/progress/'));
    32       if($this->System->PathItems[0] == 'register.php') Header('Location: '.$this->System->Link('/registrace.php'));
    33       if($this->System->PathItems[0] == 'dictionary.php') Header('Location: '.$this->System->Link('/dictionary/'));
    34       if($this->System->PathItems[0] == 'download-addon.php') Header('Location: '.$this->System->Link('/download/'));
    35       if($this->System->PathItems[0] == 'banners.php') Header('Location: '.$this->System->Link('/referrer/'));
    36       if($this->System->PathItems[0] == 'download.php') Header('Location: '.$this->System->Link('/download/'));
    37       if($this->System->PathItems[0] == 'serverlist.php') Header('Location: '.$this->System->Link('/server/'));
     34        if($this->System->PathItems[0] == 'team.php') $Output = $this->Redirect($this->System->Link('/team/'));
     35      if($this->System->PathItems[0] == 'version.php') $Output = $this->Redirect($this->System->Link('/client-version/'));
     36      if($this->System->PathItems[0] == 'phpBB3') $Output = $this->Redirect($this->System->Link('/forum/'));
     37      if($this->System->PathItems[0] == 'phpbb3') $Output = $this->Redirect($this->System->Link('/forum/'));
     38      if($this->System->PathItems[0] == 'statistic.php') $Output = $this->Redirect($this->System->Link('/progress/'));
     39      if($this->System->PathItems[0] == 'register.php') $Output = $this->Redirect($this->System->Link('/registrace.php'));
     40      if($this->System->PathItems[0] == 'dictionary.php') $Output = $this->Redirect($this->System->Link('/dictionary/'));
     41      if($this->System->PathItems[0] == 'download-addon.php') $Output = $this->Redirect($this->System->Link('/download/'));
     42      if($this->System->PathItems[0] == 'banners.php') $Output = $this->Redirect($this->System->Link('/referrer/'));
     43      if($this->System->PathItems[0] == 'download.php') $Output = $this->Redirect($this->System->Link('/download/'));
     44      if($this->System->PathItems[0] == 'serverlist.php') $Output = $this->Redirect($this->System->Link('/server/'));
    3845      if(count($this->System->PathItems) > 1)
    3946      {
    4047        if(($this->System->PathItems[0] == 'team') and ($this->System->PathItems[1] == 'userlist.php'))
    41           Header('Location: '.$this->System->Link('/userlist.php'));
     48          $Output = $this->Redirect($this->System->Link('/userlist.php'));
    4249        if(($this->System->PathItems[0] == 'dictionary') and ($this->System->PathItems[1] == 'user.php'))
    43           Header('Location: '.$this->System->Link('/user.php'));
     50          $Output = $this->Redirect($this->System->Link('/user.php'));
    4451        if(($this->System->PathItems[0] == 'forum') and ($this->System->PathItems[1] == 'index.php'))
    45           Header('Location: '.$this->System->Link('/forum/'));
     52          $Output = $this->Redirect($this->System->Link('/forum/'));
    4653        if(($this->System->PathItems[0] == 'phpbb3') and ($this->System->PathItems[1] == 'index.php'))
    47           Header('Location: '.$this->System->Link('/forum/'));
     54          $Output = $this->Redirect($this->System->Link('/forum/'));
    4855        if(($this->System->PathItems[0] == 'phpBB3') and ($this->System->PathItems[1] == 'index.php'))
    49           Header('Location: '.$this->System->Link('/forum/'));
     56          $Output = $this->Redirect($this->System->Link('/forum/'));
    5057      }
    5158    }
    52     return('<h3 align="center">Požadovaná stránka byla přesunuta do nového umístění.</h3>');
     59    return($Output);
    5360  }
    5461}
  • trunk/includes/Version.php

    r811 r812  
    66// and system will need database update.
    77
    8 $Revision = 811; // Subversion revision
     8$Revision = 812; // Subversion revision
    99$DatabaseRevision = 811; // Database structure revision
    10 $ReleaseTime = '2014-05-28';
     10$ReleaseTime = '2014-05-31';
  • trunk/includes/system.php

    r811 r812  
    247247      if($Page->RawPage == false) $Output = $this->BaseView->ShowPage($Output);
    248248    } else {
     249      $Output2 = '';
    249250        if((count($this->OnPageNotFound) == 2)
    250251  and method_exists($this->OnPageNotFound[0], $this->OnPageNotFound[1]))
    251           $Output = $this->BaseView->ShowPage(call_user_func_array($this->OnPageNotFound, array()));
    252                 else
    253                 {
     252          $Output2 = call_user_func_array($this->OnPageNotFound, array());
     253     if($Output2 != '') $Output .= $this->BaseView->ShowPage($Output2);
     254                else {
    254255                        $Output = $this->PageNotFound();
    255             $this->BaseView->Title = T('Page not found');
    256                 $Output = $this->BaseView->ShowPage($Output);
     256          $this->BaseView->Title = T('Page not found');
     257        $Output = $this->BaseView->ShowPage($Output);
    257258                }
    258259        }
Note: See TracChangeset for help on using the changeset viewer.