Subversion Repositories prepend

Rev

Rev 7 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. $xxx_directories_need_ereg = array(
  4.         '/home/villariva' // Gästebuch arbeitet noch mit ereg... (/home/villariva/public_html/includes/misc_functions.php)
  5. );
  6.  
  7. // ---
  8.  
  9. $xxx_go = false;
  10. foreach ($xxx_directories_need_ereg as $xxx_directory_need_ereg) {
  11.         if (strpos($_SERVER['SCRIPT_FILENAME'], $xxx_directory_need_ereg) === 0) {
  12.                 $xxx_go = true;
  13.         }
  14. }
  15. unset($xxx_directories_need_ereg);
  16. unset($xxx_directory_need_ereg);
  17. if ($xxx_go) {
  18.         if (function_exists('ereg') !== true) {
  19.                 function ereg($pattern, $string, &$regs) {
  20.                         return preg_match('~' . addcslashes($pattern, '~') . '~', $string, $regs);
  21.                 }
  22.         }
  23.  
  24.         if (function_exists('eregi') !== true) {
  25.                 function eregi($pattern, $string, &$regs) {
  26.                         return preg_match('~' . addcslashes($pattern, '~') . '~i', $string, $regs);
  27.                 }
  28.         }
  29.  
  30.         if (function_exists('ereg_replace') !== true) {
  31.                 function ereg_replace($pattern, $string, $replace) {
  32.                         return preg_replace('~' . addcslashes($pattern, '~') . '~', $string, $replace);
  33.                 }
  34.         }
  35.  
  36.         if (function_exists('eregi_replace') !== true) {
  37.                 function eregi_replace($pattern, $string, $replace) {
  38.                         return preg_replace('~' . addcslashes($pattern, '~') . '~i', $string, $replace);
  39.                 }
  40.         }
  41.  
  42.         if (function_exists('split') !== true) {
  43.                 function split($pattern, $string, $limit=-1) {
  44.                         return preg_split('~' . addcslashes($pattern, '~') . '~', $string, $limit);
  45.                 }
  46.         }
  47.  
  48.         if (function_exists('spliti') !== true) {
  49.                 function spliti($pattern, $string, $limit=-1) {
  50.                         return preg_split('~' . addcslashes($pattern, '~') . '~i', $string, $limit);
  51.                 }
  52.         }
  53.  
  54.         if (function_exists('sql_regcase') !== true) {
  55.                 function sql_regcase($string) {
  56.                         $out = '';
  57.                         for ($i=0; $i<strlen($string); $i++) {
  58.                                 $char = $string[$i];
  59.                                 $up = strtoupper($char);
  60.                                 $low = strtolower($char);
  61.                                 if ($up != $low) {
  62.                                         $out .= "[${up}${low}]";
  63.                                 } else {
  64.                                         $out .= $char;
  65.                                 }
  66.                         }
  67.                         return $out;
  68.                 }
  69.         }
  70. }
  71. unset($xxx_go);
  72.