Changeset 887


Ignore:
Timestamp:
Dec 27, 2022, 2:34:03 PM (2 years ago)
Author:
chronos
Message:
  • Fixed: Run with PHP 8.1.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/HTML/BBCodeParser2.php

    r815 r887  
    482482        foreach ($this->_tagArray as $tag) {
    483483            $prevTag = end($newTagArray);
     484
     485            // TODO: why prevTag cann by type bool?
     486            if (!is_array($prevTag)) continue;
     487
    484488            switch ($tag['type']) {
    485489            case 0:
     
    500504                    $openTags[] = $child['tag'];
    501505                }
     506
    502507                if ($prevTag['type'] === 0) {
    503508                    $tag['text'] = $prevTag['text'].$tag['text'];
  • trunk/Packages/Common/AppModule.php

    r880 r887  
    392392  }
    393393
    394   function LoadModules()
    395   {
    396     if (method_exists($this->OnLoadModules[0], $this->OnLoadModules[1]))
    397       $this->OnLoadModules();
     394  function LoadModules(): void
     395  {
     396    if (is_array($this->OnLoadModules) and (count($this->OnLoadModules) == 2) and method_exists($this->OnLoadModules[0], $this->OnLoadModules[1]))
     397      call_user_func($this->OnLoadModules);
    398398    else $this->LoadModulesFromDir($this->ModulesDir);
    399399  }
  • trunk/Packages/Common/Error.php

    r880 r887  
    33class ErrorHandler
    44{
    5   var $Encoding;
    6   var $ShowError;
    7   var $UserErrors;
    8   var $OnError;
     5  public string $Encoding;
     6  public bool $ShowError;
     7  public int $UserErrors;
     8  public $OnError;
    99
    1010  function __construct()
     
    2828  }
    2929
    30   function ErrorHandler($Number, $Message, $FileName, $LineNumber, $Variables)
     30  function ErrorHandler($Number, $Message, $FileName, $LineNumber)
    3131  {
    3232    $ErrorType = array
     
    6363  }
    6464
    65   function ExceptionHandler(Exception $Exception)
     65  function ExceptionHandler(Throwable $Exception)
    6666  {
    6767    $Backtrace = $Exception->getTrace();
     
    7575  }
    7676
    77   function ShowDefaultError($Message)
     77  function ShowDefaultError(string $Message): void
    7878  {
    7979    $Output = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>'."\n".
  • trunk/Packages/Common/UTF8.php

    r880 r887  
    546546    for ($I = 0; $I < strlen($String); $I++)
    547547    {
    548       if (ord($String{$I}) & 0x80) // UTF control character
     548      if (ord($String[$I]) & 0x80) // UTF control character
    549549      {
    550         if (ord($String{$I}) & 0x40) // First
     550        if (ord($String[$I]) & 0x40) // First
    551551        {
    552552          if ($UTFPrefix != '') $Result .= chr(array_search($UTFPrefix, $this->CharTable[$Charset]));
    553           $UTFPrefix = $String{$I};
     553          $UTFPrefix = $String[$I];
    554554        }
    555         else $UTFPrefix .= $String{$I}; // Next
     555        else $UTFPrefix .= $String[$I]; // Next
    556556      } else
    557557      {
    558558        if ($UTFPrefix != '') $Result .= chr(array_search($UTFPrefix, $this->CharTable[$Charset]));
    559559        $UTFPrefix = '';
    560         $Result .= $String{$I};
     560        $Result .= $String[$I];
    561561      }
    562562    }
  • trunk/robots.txt

    r886 r887  
    11User-agent: *
    2 Disallow: /TranslationList.php
    3 Disallow: /form.php
    4 Disallow: /log/
    5 
    6 
     2Disallow: /*?
Note: See TracChangeset for help on using the changeset viewer.