Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem po aktualizacji
KR2615
post
Post #1





Grupa: Zarejestrowani
Postów: 311
Pomógł: 13
Dołączył: 7.05.2007

Ostrzeżenie: (0%)
-----


Wykonałem aktualizację Debiana z 7.8 do 8.1. Przy okazji PHP poszło do 5.6.9-0+deb8u1. Mam na nim LMSa. Dostaję teraz błędy w stylu:
Cytat
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/lms/lib/common.php

Przykładowe fragmenty kodu sprawiające problemy:
  1. function docnumber($number=NULL, $template=NULL, $time=NULL, $ext_num='')
  2. {
  3. <------>$number = $number ? $number : 1;
  4. <------>$template = $template ? $template : DEFAULT_NUMBER_TEMPLATE;
  5. <------>$time = $time ? $time : time();
  6. <------>
  7. <------>// extended number part
  8. <------>$result = str_replace('%I', $ext_num, $template);
  9.  
  10. <------>// main document number
  11. [b]<------>$result = preg_replace('/%(\\d*)N/e', "sprintf('%0\\1d', $number)", $result);[/b]
  12. <------>
  13. <------>// time conversion specifiers
  14. <------>return strftime($result, $time);
  15. }
  16. ]


  1. function smarty_modifier_striphtml($args)
  2. {
  3. $search = array ("'<script[^>]*?>.*?</script>'si", // Strip out javascript
  4. "'<[\/\!]*?[^<>]*?>'si", // Strip out html tags
  5. "'([\r\n])[\s]+'", // Strip out white space
  6. "'&(quot|#34);'i", // Replace html entities
  7. "'&(amp|#38);'i",
  8. "'&(lt|#60);'i",
  9. "'&(gt|#62);'i",
  10. "'&(nbsp|#160);'i",
  11. "'&(iexcl|#161);'i",
  12. "'&(cent|#162);'i",
  13. "'&(pound|#163);'i",
  14. "'&(copy|#169);'i",
  15. [b]"'&#(\d+);'e"); // evaluate as php[/b]
  16.  
  17.  
  18. $replace = array ("",
  19. "\\1",
  20. "\"",
  21. "&",
  22. "<",
  23. ">",
  24. " ",
  25. chr(161),
  26. chr(162),
  27. chr(163),
  28. chr(169),
  29. "chr(\\1)");
  30.  
  31. return preg_replace ($search, $replace, $args);
  32.  
  33. }


Niestety moje umiejętności programowania w PHP są zbyt ubogie aby przerobić ten kod. Prosiłbym o pomoc
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 29.09.2025 - 07:44