• php Script Kenner an Bord?

    seit mein Hoster auf php 8 xy umgestellt hat, funktioniert mein kleiner Blog nicht mehr.
    Der hat keine Datenbank und basiert auf Nibbleblog.
    Fehlermeldung:
    Fatal error: Array and string offset access syntax with curly braces is no longer supported in...
    In Zeile 171
    Da ist das Skript:

    Show Plain Text
    1. <?php
    2.  
    3. /*
    4.  * Nibbleblog -
    5.  * http://www.nibbleblog.com
    6.  * Author Diego Najar
    7.  
    8.  * All Nibbleblog code is released under the GNU General Public License.
    9.  * See COPYRIGHT.txt and LICENSE.txt.
    10. */
    11.  
    12. class Text {
    13.  
    14.   public static function unserialize($string)
    15.   {
    16.     parse_str($string, $data);
    17.  
    18.     // Clean magic quotes if this enabled
    19.     if(get_magic_quotes_gpc())
    20.     {
    21.       $data = self::clean_magic_quotes($data);
    22.     }
    23.  
    24.     return($data);
    25.   }
    26.  
    27.   public static function ajax_header($tmp)
    28.   {
    29.     $xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
    30.     $xml .= '<ajax>';
    31.     $xml .= $tmp;
    32.     $xml .= '</ajax>';
    33.     return( $xml );
    34.   }
    35.  
    36.   // Clean magic quotes
    37.   public static function clean_magic_quotes($args)
    38.   {
    39.     $tmp_array = array();
    40.     foreach($args as $key => $arg)
    41.     {
    42.       $tmp_array[$key] = stripslashes($arg);
    43.     }
    44.  
    45.     return($tmp_array);
    46.   }
    47.  
    48.   public static function cut_text($text, $maxlength)
    49.   {
    50.     return( substr($text,0,strrpos(substr($text,0,$maxlength)," ")) );
    51.   }
    52.  
    53.   public static function cut_words($text, $count)
    54.   {
    55.     $explode = explode(" ", $text);
    56.  
    57.     if(count($explode) > $count)
    58.     {
    59.       array_splice($explode, $count);
    60.       $text = implode(' ', $explode);
    61.     }
    62.  
    63.     return($text);
    64.   }
    65.  
    66.   // Strip spaces
    67.   public static function replace($search, $replace, $string)
    68.   {
    69.     return( str_replace($search,$replace,$string) );
    70.   }
    71.  
    72.   // Strip spaces
    73.   public static function strip_spaces($string)
    74.   {
    75.     return( str_replace(' ','',$string) );
    76.   }
    77.  
    78.   // Strip quotes ' and "
    79.   public static function strip_quotes($text)
    80.   {
    81.     $text = str_replace('\'', '', $text);
    82.     $text = str_replace('"', '', $text);
    83.     return( $text );
    84.   }
    85.  
    86.   function clean_non_alphanumeric($string)
    87.   {
    88.     $string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
    89.  
    90.     return $string;
    91.   }
    92.  
    93.   // RETURN
    94.   // TRUE - si contiene el substring
    95.   // FALSE - caso contrario
    96.   public static function is_substring($string, $substring)
    97.   {
    98.     return( strpos($string, $substring) !== false );
    99.   }
    100.  
    101.   // RETURN
    102.   // TRUE - is not empty
    103.   // FALSE - is empty
    104.   public static function not_empty($string)
    105.   {
    106.     return( !self::is_empty($string) );
    107.   }
    108.  
    109.   public static function is_empty($string)
    110.   {
    111.     $string = self::strip_spaces($string);
    112.     return( empty($string) );
    113.   }
    114.  
    115.   // Compara 2 cadenas
    116.   // Retorna TRUE si son iguales, FALSE caso contrario
    117.   public static function compare($value1, $value2)
    118.   {
    119.     return( strcmp($value1, $value2) == 0 );
    120.   }
    121.  
    122.   // Clean text for URL
    123.   public static function clean_url($text, $spaces='-', $translit=false)
    124.   {
    125.     // Delete characters
    126.     $text = str_replace(array("“", "”", "!", "*", "&#039;", "&quot;", "(", ")", ";", ":", "@", "&amp", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]", "|"),'',$text);
    127.     $text = preg_replace('![^\\pL\d]+!u', '-', $text);
    128.  
    129.     // Translit
    130.     if($translit!=false)
    131.     {
    132.       $text = str_replace(array_keys($translit),array_values($translit),$text);
    133.     }
    134.         if (function_exists('iconv'))
    135.     {
    136.       $ret = iconv('utf-8', 'us-ascii//TRANSLIT//IGNORE', $text);
    137.       if ($ret!==false){ //iconv might return false on error
    138.         $text = $ret;
    139.       }
    140.     }
    141.  
    142.     // Replace spaces by $spaces
    143.     $text = str_replace(' ',$spaces,$text);
    144.  
    145.     //remove any additional characters that might appear after translit
    146.     $text = preg_replace('![^-\w]+!', '', $text);
    147.  
    148.     // Replace multiple dashes
    149.     $text = preg_replace('/-{2,}/', '-', $text);
    150.  
    151.     // Make a string lowercase
    152.     $text = self::str2lower($text);
    153.  
    154.     return $text;
    155.   }
    156.  
    157.   public static function str2lower($string)
    158.   {
    159.     if(function_exists('mb_strtolower'))
    160.       return mb_strtolower($string, 'UTF-8');
    161.  
    162.     return strtolower($string);
    163.   }
    164.  
    165.   public static function random_text($length)
    166.   {
    167.      $characteres = "1234567890abcdefghijklmnopqrstuvwxyz!@#%^&*";
    168.      $text = '';
    169.      for($i=0; $i<$length; $i++)
    170.      {
    171.       $text .= $characteres{rand(0,41)};
    172.      }
    173.      return $text;
    174.   }
    175.  
    176.   public static function replace_assoc(array $replace, $text)
    177.   {
    178.     return str_replace(array_keys($replace), array_values($replace), $text);
    179.   }
    180.  
    181. }
    ----------
    Runtime Error 6D at 417A:32CF: Incompetent User