Deprecated: preg_replace

Started by Lynx on 2014-11-13 19:15 — 4 replies, 1421 views

#1
Версия TorrentPier II: 2.1.3 [ALPHA]
Движок без модов на демо-сервере.
Версия PHP: 5.5.18-1

При загрузке торрента лезет ошибка:

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/demo/data/www/***/library/attach_mod/posting_attachments.php on line 975

975 строка posting_attachments.php:

$this->attach_filename = preg_replace("/([\xC2\xC3])([\x80-\xBF])/e", "chr(ord('\\1')<<6&0xC0|ord('\\2')&0x3F)", $this->attach_filename);
#2
Закомментируйте или удалите строку. Версия php > 5.4 такое вызывает. Ничего критичного в строке особенно нет, замена будет.
#3
Можно заменить на это.
$this->attach_filename = preg_replace('#([\xC2\xC3])([\x80-\xBF])#', 'chr(ord(\'$1\')<<6&0xC0|ord(\'$2\')&0x3F)', $this->attach_filename);
#4
Sprinx, помогло. Спасибо.
#5
Исправлено в новой ревизии.
https://github.com/torrentpier/torr...cfabdd7a24e649a1f049b336e7b0487ebb?diff=split

Скачать 2.1.4 можно в центре загрузки: https://get.torrentpier.com/