Ignore:
Timestamp:
Mar 6, 2023, 1:48:45 AM (22 months ago)
Author:
chronos
Message:
  • Fixed: Class types casting for better type checking.
  • Fixed: XML direct export.
  • Modified: User class instance moved from Core class to ModuleUser class.
File:
1 edited

Legend:

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

    r888 r893  
    33class ModuleRedirection extends Module
    44{
     5  public array $Excludes;
     6
    57  function __construct(System $System)
    68  {
     
    1214    $this->Description = 'Redirects erlier obsolete addresses to new ones.';
    1315    $this->Dependencies = array();
     16
    1417    $this->Excludes = array();
    1518  }
     
    1720  function DoStart(): void
    1821  {
    19     $this->System->OnPageNotFound = array($this, 'ShowRedirect');
     22    Core::Cast($this->System)->OnPageNotFound = array($this, 'ShowRedirect');
    2023  }
    2124
     
    3033  {
    3134    $Output = '';
    32     if (count($this->System->PathItems) > 0)
     35    if (count(Core::Cast($this->System)->PathItems) > 0)
    3336    {
    34       if ($this->System->PathItems[0] == 'user.php') $Output = $this->Redirect($this->System->Link('/user/'));
    35       if ($this->System->PathItems[0] == 'team.php') $Output = $this->Redirect($this->System->Link('/team/'));
    36       if ($this->System->PathItems[0] == 'version.php') $Output = $this->Redirect($this->System->Link('/client-version/'));
    37       if ($this->System->PathItems[0] == 'phpBB3') $Output = $this->Redirect($this->System->Link('/forum/'));
    38       if ($this->System->PathItems[0] == 'phpbb3') $Output = $this->Redirect($this->System->Link('/forum/'));
    39       if ($this->System->PathItems[0] == 'statistic.php') $Output = $this->Redirect($this->System->Link('/progress/'));
    40       if ($this->System->PathItems[0] == 'register.php') $Output = $this->Redirect($this->System->Link('/registration/'));
    41       if ($this->System->PathItems[0] == 'registrace.php') $Output = $this->Redirect($this->System->Link('/registration/'));
    42       if ($this->System->PathItems[0] == 'dictionary.php') $Output = $this->Redirect($this->System->Link('/dictionary/'));
    43       if ($this->System->PathItems[0] == 'download-addon.php') $Output = $this->Redirect($this->System->Link('/download/'));
    44       if ($this->System->PathItems[0] == 'banners.php') $Output = $this->Redirect($this->System->Link('/referrer/'));
    45       if ($this->System->PathItems[0] == 'download.php') $Output = $this->Redirect($this->System->Link('/download/'));
    46       if ($this->System->PathItems[0] == 'serverlist.php') $Output = $this->Redirect($this->System->Link('/server/'));
    47       if ($this->System->PathItems[0] == 'info.php') $Output = $this->Redirect($this->System->Link('/info/'));
    48       if ($this->System->PathItems[0] == 'userlist.php') $Output = $this->Redirect($this->System->Link('/users/'));
    49       if ($this->System->PathItems[0] == 'promotion.php') $Output = $this->Redirect($this->System->Link('/promotion/'));
    50       if ($this->System->PathItems[0] == 'log.php') $Output = $this->Redirect($this->System->Link('/log/'));
    51       if (count($this->System->PathItems) > 1)
     37      if (Core::Cast($this->System)->PathItems[0] == 'user.php') $Output = $this->Redirect($this->System->Link('/user/'));
     38      if (Core::Cast($this->System)->PathItems[0] == 'team.php') $Output = $this->Redirect($this->System->Link('/team/'));
     39      if (Core::Cast($this->System)->PathItems[0] == 'version.php') $Output = $this->Redirect($this->System->Link('/client-version/'));
     40      if (Core::Cast($this->System)->PathItems[0] == 'phpBB3') $Output = $this->Redirect($this->System->Link('/forum/'));
     41      if (Core::Cast($this->System)->PathItems[0] == 'phpbb3') $Output = $this->Redirect($this->System->Link('/forum/'));
     42      if (Core::Cast($this->System)->PathItems[0] == 'statistic.php') $Output = $this->Redirect($this->System->Link('/progress/'));
     43      if (Core::Cast($this->System)->PathItems[0] == 'register.php') $Output = $this->Redirect($this->System->Link('/registration/'));
     44      if (Core::Cast($this->System)->PathItems[0] == 'registrace.php') $Output = $this->Redirect($this->System->Link('/registration/'));
     45      if (Core::Cast($this->System)->PathItems[0] == 'dictionary.php') $Output = $this->Redirect($this->System->Link('/dictionary/'));
     46      if (Core::Cast($this->System)->PathItems[0] == 'download-addon.php') $Output = $this->Redirect($this->System->Link('/download/'));
     47      if (Core::Cast($this->System)->PathItems[0] == 'banners.php') $Output = $this->Redirect($this->System->Link('/referrer/'));
     48      if (Core::Cast($this->System)->PathItems[0] == 'download.php') $Output = $this->Redirect($this->System->Link('/download/'));
     49      if (Core::Cast($this->System)->PathItems[0] == 'serverlist.php') $Output = $this->Redirect($this->System->Link('/server/'));
     50      if (Core::Cast($this->System)->PathItems[0] == 'info.php') $Output = $this->Redirect($this->System->Link('/info/'));
     51      if (Core::Cast($this->System)->PathItems[0] == 'userlist.php') $Output = $this->Redirect($this->System->Link('/users/'));
     52      if (Core::Cast($this->System)->PathItems[0] == 'promotion.php') $Output = $this->Redirect($this->System->Link('/promotion/'));
     53      if (Core::Cast($this->System)->PathItems[0] == 'log.php') $Output = $this->Redirect($this->System->Link('/log/'));
     54      if (count(Core::Cast($this->System)->PathItems) > 1)
    5255      {
    53         if (($this->System->PathItems[0] == 'team') and ($this->System->PathItems[1] == 'userlist.php'))
     56        if ((Core::Cast($this->System)->PathItems[0] == 'team') and (Core::Cast($this->System)->PathItems[1] == 'userlist.php'))
    5457          $Output = $this->Redirect($this->System->Link('/userlist/'));
    55         if (($this->System->PathItems[0] == 'dictionary') and ($this->System->PathItems[1] == 'user.php'))
     58        if ((Core::Cast($this->System)->PathItems[0] == 'dictionary') and (Core::Cast($this->System)->PathItems[1] == 'user.php'))
    5659          $Output = $this->Redirect($this->System->Link('/user/'));
    57         if (($this->System->PathItems[0] == 'forum') and ($this->System->PathItems[1] == 'index.php'))
     60        if ((Core::Cast($this->System)->PathItems[0] == 'forum') and (Core::Cast($this->System)->PathItems[1] == 'index.php'))
    5861          $Output = $this->Redirect($this->System->Link('/forum/'));
    59         if (($this->System->PathItems[0] == 'phpbb3') and ($this->System->PathItems[1] == 'index.php'))
     62        if ((Core::Cast($this->System)->PathItems[0] == 'phpbb3') and (Core::Cast($this->System)->PathItems[1] == 'index.php'))
    6063          $Output = $this->Redirect($this->System->Link('/forum/'));
    61         if (($this->System->PathItems[0] == 'phpBB3') and ($this->System->PathItems[1] == 'index.php'))
     64        if ((Core::Cast($this->System)->PathItems[0] == 'phpBB3') and (Core::Cast($this->System)->PathItems[1] == 'index.php'))
    6265          $Output = $this->Redirect($this->System->Link('/forum/'));
    63         if (($this->System->PathItems[0] == 'download') and ($this->System->PathItems[1] == 'ceske_fonty_do_wow.zip'))
     66        if ((Core::Cast($this->System)->PathItems[0] == 'download') and (Core::Cast($this->System)->PathItems[1] == 'ceske_fonty_do_wow.zip'))
    6467          $Output = $this->Redirect($this->System->Link('/files/ceske_fonty_do_wow.zip'));
    6568      }
Note: See TracChangeset for help on using the changeset viewer.