Перейти к контенту
  • 0

[PHP 7] Директивы php нормальной работы работы с IPB 1.3


dimitry

Вопрос

Думаю, что наступает пора заняться модернизацией кода для IPB 1.3 под PHP 7 для тех, кто до сих пор пользуется версией IPB 1.3 и не хочет с ней расставаться.
В функционале PHP 7, по-быстрому говоря, теперь не признают бывшие стандартные функции, содержащие в  своем названии mysql , - теперь все функции должны идти как mysqli: это касается абсолютно всех функций будь-то mysql_query() -> mysqli_query() , mysql_fetch_row() -> mysqli_fetch_row() и даже mysql_error() -> mysql_error(). Причем, ко всему прочему, данные функции i требуют обязательного указаниия, как минимум 2-х параметров, а где-то что-то должно быть целым итд. И это только начало. Далее по порядку, попытался насколько мог подправить код, но, все равно, хочется попросить еще помощи и от участников форума.
Также необходимо, чтобы были установлены все патчи для PHP 5 (Включая PHP 5.4.x и выше из этой темы http://forums.ibresource.ru/topic/19364-php-5-direktivy-php-dlia-normalnoj-raboty-s-ipb-13/)и MySQL 5.
1)
Файл: mySQL.php - тут правок полно.
В частности, было:

 /*========================================================================*/
    // Connect to the database                 
    /*========================================================================*/  
                   
    function connect() {
    //--------------------------
     	// Done SQL prefix yet?
     	//--------------------------
     	
     	if ( ! defined( 'SQL_PREFIX' ) )
     	{
     		$this->obj['sql_tbl_prefix'] = $this->obj['sql_tbl_prefix'] ? $this->obj['sql_tbl_prefix'] : 'ibf_';
     		
     		define( 'SQL_PREFIX', $this->obj['sql_tbl_prefix'] );
     	}
    	if ($this->obj['persistent'])
    	{
    	    $this->connection_id = mysql_pconnect( $this->obj['sql_host'] ,
												   $this->obj['sql_user'] ,
												   $this->obj['sql_pass'] 
												);
        }
        else
        {
			$this->connection_id = mysql_connect( $this->obj['sql_host'] ,
												  $this->obj['sql_user'] ,
												  $this->obj['sql_pass'] 
												);
		}
		
        if ( !mysql_select_db($this->obj['sql_database'], $this->connection_id) )
        {
            echo ("ERROR: Cannot find database ".$this->obj['sql_database']);
        }
		mysql_query("SET NAMES 'cp1251'");
		mysql_query("SET COLLATION_CONNECTION=CP1251_GENERAL_CI");
    }

Сделал так:
 

  /*========================================================================*/
    // Connect to the database                 
    /*========================================================================*/  
                   
    function connect() {
    //--------------------------
     	// Done SQL prefix yet?
     	//--------------------------
     	
     	if ( ! defined( 'SQL_PREFIX' ) )
     	{
     		$this->obj['sql_tbl_prefix'] = $this->obj['sql_tbl_prefix'] ? $this->obj['sql_tbl_prefix'] : 'ibf_';
     		
     		define( 'SQL_PREFIX', $this->obj['sql_tbl_prefix'] );
     	}
    	if ($this->obj['persistent'])
    	{
    	    $this->connection_id = mysqli_pconnect( $this->obj['sql_host'] ,
												   $this->obj['sql_user'] ,
												   $this->obj['sql_pass'] ,
												  $this->obj['sql_database']
												);
        }
        else
        {
			$this->connection_id = mysqli_connect( $this->obj['sql_host'] ,
												  $this->obj['sql_user'] ,
												  $this->obj['sql_pass'] ,
												  $this->obj['sql_database']
												);
		}
		
        if ( !$this->connection_id) 
        {
            echo ("ERROR: Cannot find database ".$this->obj['sql_database']);
        }
		mysqli_query($this->connection_id, "SET NAMES 'cp1251'");
		mysqli_query($this->connection_id, "SET COLLATION_CONNECTION=CP1251_GENERAL_CI");
    }
    

далее в файле:
 
 $this->query_id = mysql_query($the_query, $this->connection_id);
 
заменено на:
 
 $this->query_id = mysqli_query($this->connection_id, $the_query);
 
Т.е. параметры просто меняются местами.
 
далее:
 
$this->record_row = mysql_fetch_array($query_id, MYSQL_ASSOC);
 
заменено на:
 
$this->record_row = mysqli_fetch_array($query_id, MYSQLI_ASSOC);
 
итд по всему файлу, включая выводы ошибок. Подробно расписывать не буду - прикреплю лучше файл mySQL.php к посту, а там сами посмотрите.
mySQL.php

2)
index.php:
 
Там было вот такое:
 

class info {

	var $member     = array();
	var $input      = array();
	var $session_id = "";
	var $base_url   = "";
	var $vars       = "";
	var $skin_id    = "0";     // Skin Dir name
	var $skin_rid   = "";      // Real skin id (numerical only)
	var $lang_id    = "en";
	var $skin       = "";
	var $lang       = "";
	var $server_load = 0;
	var $version    = "v1.3";
	var $lastclick  = "";
	var $location   = "";
	var $debug_html = "";
	var $perm_id    = "";
	var $forum_read = array();
	var $topic_cache = "";
	var $session_type = "";

	function _info () {
		global $sess, $std, $DB, $INFO;
		
		$this->vars = $INFO;
		
		$this->vars['TEAM_ICON_URL']   = $INFO['html_url'] . '/team_icons';
		$this->vars['AVATARS_URL']     = $INFO['html_url'] . '/avatars';
		$this->vars['EMOTICONS_URL']   = $INFO['html_url'] . '/emoticons';
		$this->vars['mime_img']        = $INFO['html_url'] . '/mime_types';
	}
}

в PHP 7 это приводит к постоянному ворнингу на всех страницах:
 

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP

 
необходимо в этом классе function _info () заменить на: function __construct ()
То же самое нужно произвести практически в 85% файлах форума, где функция в классе имеет то же имя, что и сам класс (заменить функцию на function __construct ()) - проверил - работает и на версиях PHP 5.2.х и выше.
3)
 
index.php
 
Если у кого-то был установлен мод типа cookie IP ban, то
 

$usersip = getenv("REMOTE_ADDR"); 
		if(!$_COOKIE["CookieIp"]) {
			// Mmmm cookie
			setcookie("CookieIp", $usersip, time() + 99*99*99*99);
		}

99*99*99*99 - вот это дело уже приводит к ворнингу
 

parameter 3 to be integer

 
сделал так:
 

setcookie("CookieIp", $usersip, time() + 9999999);

4)
admin.php:
 
Если у кого установлен мод учета поисковиков mod_spider, то получаем ошибку:
 

Fatal error: 'break' not in the 'loop' or 'switch' context in

//-- mod_spider begin
    if ($IN['act'] == "op" && $IN['code'] == "spider") {
        if (file_exists(ROOT_PATH."sources/mods/spider/mod_spider_ad_func.php")) {
            require ROOT_PATH."sources/mods/spider/mod_spider_ad_func.php";
        } else {
            die("Could not call required function from file 'sources/mods/spider/mod_spider_ad_func.php'<br>Does it exist?");
        }
       break;
    }
//-- mod_spider end

убираем из этого участка:
 

break;

5)
 
ipchat.php:
 

$DB = @mysql_connect( $db_info['host'], $db_info['user'], $db_info['pass'] );

if ( ! @mysql_select_db( $db_info['database'] ) )
{
	die_nice();
	
	//-- script exits --//
}

заменен на:
 

$DB = @mysqli_connect( $db_info['host'], $db_info['user'], $db_info['pass'], $db_info['database'] );

if ( ! $DB )
{
	die_nice();
	
	//-- script exits --//
}
if ( ! $member = @mysql_fetch_array( $query_id, MYSQL_ASSOC ) )

на:
 

if ( ! $member = @mysqli_fetch_array( $query_id, MYSQLI_ASSOC ) )

вот такое:
 

$query_id = @mysql_query("SELECT m.mgroup, m.password, m.name, m.id  FROM {$db_info['tbl_prefix']}members m
						  WHERE m.name='".addslashes($username)."' LIMIT 1"
						 ,$DB);

заменил на такое:
 

$query_id = @mysqli_query($DB, "SELECT m.mgroup, m.password, m.name, m.id  FROM {$db_info['tbl_prefix']}members m
						  WHERE m.name='".addslashes($username)."' LIMIT 1"
						 );

это:
 

@mysql_close();

на это:
 

@mysqli_close($access);

прикреплю файл, т.к. еще там есть участки
ipchat.php
 
6)
jcounter.php (это файл, по-моему из мода статистики, в оригинальном IPB его нет, файл лежит в корне (где index.php)
 
вот такого там до черта:
 

mysql_query($DB, "SELECT ...)

переставил:
 

mysqli_query($DB, "SELECT ...

опять же, прикрепляю:
jcounter.php
 
7)
 
postwarn.php (это файл, по-моему из мода предупреждений или защиты от перебора пароля Secure login - уже не помню, в оригинальном IPB его нет, файл лежит в \sources\misc\
 
Файл мизерный. Вот его весь старый код:
 

<?php
/*
+---------------------------------------------------------------------------
|
|   > : Advanced Warn
|
+--------------------------------------------------------------------------
*/

	require('../../conf_global.php');

	$connection_id = mysql_connect($INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass']);

	mysql_select_db($INFO['sql_database'], $connection_id);

	mysql_query("UPDATE ".$INFO['sql_tbl_prefix']."members SET `set_warn` = 0 WHERE `warn_exp` < ".time());

	mysql_close($connection_id);

переделал так:
 

<?php
/*
+---------------------------------------------------------------------------
|
|   > : Advanced Warn
|
+--------------------------------------------------------------------------
*/

	require('../../conf_global.php');

	$connection_id = mysqli_connect($INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass'], $INFO['sql_database']);

	mysqli_query($connection_id, "UPDATE ".$INFO['sql_tbl_prefix']."members SET `set_warn` = 0 WHERE `warn_exp` < ".time());

	mysqli_close($connection_id);

?>

8)
А вот это уже серьезно и из оригинального кода IPB:
 
functions.php:
 
Найти:
 

	foreach ($user_raw_permissions AS $data)
		{
			$new_data = split(':', $data);

			$this->member['forum_perms'][ $new_data[0] ] = $new_data[1];

		}

это приводит к ошибке, поэтому заменил split() на explode()
 
вот так:
 

	foreach ($user_raw_permissions AS $data)
		{
			$new_data = explode(':', $data);

			$this->member['forum_perms'][ $new_data[0] ] = $new_data[1];

		}

то же для ad_member.php:

 

это

$user_raw_permissions = split(';', $mem['forum_access']);

		foreach ($user_raw_permissions AS $data)
		{
			$new_data = split(':', $data);

			$user_permissions[ $new_data[0] ] = $new_data[1];

		}

заменить на:

$user_raw_permissions = explode(';', $mem['forum_access']);

		foreach ($user_raw_permissions AS $data)
		{
			$new_data = explode(':', $data);

			$user_permissions[ $new_data[0] ] = $new_data[1];

		}

modules\mod_banka.php:

 

это:

$banarr = split(":", $val);

на:

$banarr = explode(":", $val);

sources\Portal.php:

 

это:

function do_welcomepanel() {
       global $DB, $ibforums, $std;
       if ( $ibforums->vars['portal_welcomepanel'] ) 
       {
                    if ($ibforums->member['id']) {
                            $DB->query("SELECT * FROM ibf_members WHERE id='".$ibforums->member['id']."'"); 
                            $member = $DB->fetch_row();
                            $avatar_size = $member['avatar_size'];
                            list($w,$h) = split("x","$avatar_size",2);

на это:

function do_welcomepanel() {
       global $DB, $ibforums, $std;
       if ( $ibforums->vars['portal_welcomepanel'] ) 
       {
                    if ($ibforums->member['id']) {
                            $DB->query("SELECT * FROM ibf_members WHERE id='".$ibforums->member['id']."'"); 
                            $member = $DB->fetch_row();
                            $avatar_size = $member['avatar_size'];
                            list($w,$h) = explode("x","$avatar_size",2);

9)
У кого установлен мод наград (Award mod) в Topics.php есть участок в конце функции:

  
 

 // Parse the member info
    //--------------------------------------------------------------
    
    function parse_member($member=array()) {

, относящийся в данному моду:
 

	$n = mysql_num_rows(mysql_query("SELECT * FROM ibf_awards WHERE mid='{$member['id']}'"));
		if ($n > 0)
		{
		        $member['awards'] = "Награды:  <a href='{$ibforums->vars['board_url']}/index.php?act=Awards&id={$member['id']}'>$n</a>";
    	}
    	else
    	{
    			$member['awards']  = "Награды: <i>Нет</i>";

вот это хозяйство:
 

$n = mysql_num_rows(mysql_query("SELECT * FROM ibf_awards WHERE mid='{$member['id']}'"));
if ($n > 0)
        {
                $member['awards'] = "Награды:  <a href='{$ibforums->vars['board_url']}/index.php?act=Awards&id={$member['id']}'>$n</a>";
        }
        else
        {
                $member['awards']  = "Награды: <i>Нет</i>";
        }

в PHP 7 приводит к фатальной ошибке и для mysqli_query требуется задать еще параметры, поэтому удалил этот код:

 

10)
 
У тех, у кого установлены моды BB-кодов, Secure login (Для тех, кто не в курсе поясню, что пока (на момент написания этого поста есть сайт https://www1.rwb-essen.de/ibforen/index.php?ind=downloads&op=section_view&idev=1, где еще чего-то там кумекают по версии IPB 1.3
Прикреплю к данному посту еще файлы оттуда:
Mod_mySQL5_1_0_2.zip - коррекция под MySQL 5.x .
Mod_sec_update_131_2_8_0.zip - это обновление безопасности от немцев (последняя правка 14.06.2015), включающая навероты по безопасности, тот самый антибрут и пр. - ставить или не ставить - решайте сами.
Update_IPB_13_131.zip - Это Обновление с IPB 1.3 до IPB 1.3.1)
 
Так вот, если уставолены указанные выше моды, в т.ч. мод enhanced_topics, то в файлах типа mod_enhanced_topics_install.php
 
найти:
 

 $query_id = mysql_query($the_query);
 if ($query_id) { mysql_free_result( $query_id ); };

заменить на:
 

 $query_id = mysqli_query($this->connection_id, $the_query);
 if ($query_id) { mysqli_free_result( $query_id ); };

итп.

11)
Кстати, при тестировании на MySQL 5.7 на OpenServer необходимо в C:\OpenServer\userdata\config\MySQL-5.7_my.ini
установить хотя бы:
 

sql-mode=""

т.е., убрать все между кавычками, иначе это будет приводить к ошибкам MySQL 5.7:

MySQL 5.7 (Apache 2.4, PHP 5.6 (еще даже!)). Так при тесте на локалке с условным именем БД ddd на индексной странице получил подарок:

mySQL query error: SELECT g.*, m.* FROM ibf_members m LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup) WHERE m.last_activity >= '1471640400' AND m.mgroup <> '2' GROUP BY m.name ORDER BY m.last_activity DESC

mySQL error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ddd.g.g_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
mySQL error code: 

На showtopic получил:

mySQL query error: SELECT p.*,
                        m.id,m.name,m.mgroup,m.email,m.joined,m.avatar,m.avatar_size,m.posts,m.aim_name,m.icq_number,
                        m.signature, m.website,m.yahoo,m.integ_msg,m.title,m.hide_email,m.msnname, m.warn_level, m.warn_lastwarn,
                        g.g_id, g.g_title, g.g_icon, g.g_dohtml, s.login_type, s.running_time, g.g_hide_from_list, g.g_can_view_on_off
                        FROM ibf_posts p
                          LEFT JOIN ibf_members m ON (p.author_id=m.id)
                          LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup)
                          LEFT JOIN ibf_sessions s ON (s.member_id=p.author_id AND s.member_id<>0 AND s.member_id IS NOT NULL)
                          LEFT JOIN ibf_pfields_content pc ON (pc.member_id=p.author_id)
                        WHERE p.topic_id=473 and p.queued != 1
                        GROUP BY pid ORDER BY p.post_date asc LIMIT 0, 30

mySQL error: Expression #48 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ddd.s.login_type' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

на showforum получил ошибку неявной записи:

mySQL query error: UPDATE ibf_sessions SET member_name='',member_id='0',member_group='2',login_type='0', running_time='1471718686', in_forum='332', in_topic='', location='SF,,' WHERE id='a85128f6bfeb1d83f6d48b296562257d'

mySQL error: Incorrect integer value: '' for column 'in_topic' at row 1
mySQL error code: 

Постинговые, вроде, открываются. Например, вот такое: index.php?act=Post&CODE=06&f=332&t=473&p=714
При этом предпросмотр работает, а при отправке данных - ошибка БД абсолютно без информации в окне.

admin.php и индексная там - открываются. При этом страницы многих пунктов меню открываются, а, например, Настройка языков выдает ошибку:

mySQL query error: select ibf_languages.*, count(ibf_members.id) as mcount from ibf_languages left join ibf_members on(ibf_members.language=ibf_languages.ldir) where (ibf_members.language is not null or ibf_members.language = 'en') group by ibf_languages.ldir order by ibf_languages.lname

mySQL error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ddd.ibf_languages.lid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

В MySQL 5.6 все работает. Как видно, в 5.7 надо решать вопросы нововведений, из-за которых идут ошибки

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column

https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html

Изменено пользователем dimitry
Ссылка на комментарий
Поделиться на других сайтах

Рекомендуемые сообщения

  • 0

12)
У кого установлен мод Репутации, то любое обращение к странице репутации:
так:
index.php?act=rep&CODE=totals
или, например, так:
index.php?act=rep&CODE=01&mid=3&t=p
приводит к белой странице (на PHP 5.6.3 - все нормально)
Единственное, что было ненормально у меня на 5.6.3 так это то, что не обновилось количество баллов репутации по участнику (их уже давно 0, а пишет 1) и при просмотре репутации отдано index.php?act=rep&CODE=04&mid=1 получаю аж фатальную ошибку:
Fatal error: Call to a member function ShowNone() on null in C:\OpenServer\domains\ddd.ru\forums\sources\Reputation.php on line 842

вот этот кусок кода файла Reputation.php:

$DB->query("SELECT r.*, m.name, t.title FROM ibf_reputation r
					LEFT JOIN ibf_members m ON (m.id=r.member_id)
					LEFT JOIN ibf_topics t ON (r.topic_id=t.tid)
					WHERE r.from_id='".$memid. "'". $pfix. "ORDER BY r.msg_date DESC
					LIMIT ".$ibforums->input['st'].", ".$ibforums->vars['rep_per_page']);
		
	[size=4][color=#ff0000]842 строка	[/color][/size]if (! $DB->get_num_rows() ) $output .= $rep_html->ShowNone();
		
		while (	$i = $DB->fetch_row() )
		{
			switch ($i['CODE'])
			{
				case '01':
					$i['img'] = $ibforums->vars['img_url']."/r_up.gif";
					break;
				case '02':
					$i['img'] = $ibforums->vars['img_url']."/r_down.gif";
					break;
			}
			
			$i['date'] = $std->get_date($i['msg_date'], 'LONG');

Если кто знает, как это все исправить, то помогите это сделать:
вот весь файл Reputation.php из \sources\, требующий правки:
Reputation.php

13)

Капча GD, которая работала, как, скажем, арифметический пример сложения 2-х двузначных чисел с вводом суммы в окне, - не работает, отображается только

loading image

в PHP 5.6.3 работает нормально. Более того в \sources\libcaptcha.php есть участок в самом конце, приводящий к ошибке вывода заголовков (headers already sent):
 

if(function_exists("imagejpeg"))
		{
			header("Content-Type: image/jpeg");
			imagejpeg($img2, null, $jpeg_quality);
		}
		else if(function_exists("imagegif"))
		{
			header("Content-Type: image/gif");
			imagegif($img2);
		}
		else if(function_exists("imagepng"))
		{
			header("Content-Type: image/x-png");
			imagepng($img2);
		}

пока сделал так, но, возможно это некорректно, поэтому, кто знает правильнее, - подправьте:

if(function_exists("imagejpeg"))
		{
			
			imagejpeg($img2, null, $jpeg_quality);
		}
		else if(function_exists("imagegif"))
		{
			
			imagegif($img2);
		}
		else if(function_exists("imagepng"))
		{
			
			imagepng($img2);
		}

Опять же, если кто знает, как правильно подправить captcha.php или участок в Register.php, отзовитесь.
captcha.php
Register.php

14)

Далее:

Достаточно тяжелая и неприятная вещь:

в IPB в некоторых файлах, связанных с отправкой сообщений есть такая вещь как preg_replace(). Так вот, если в параметрах этой функции содержится символ
 

e

, особенно идущий как, например:


 

 $message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e"                         , "(FLASH MOVIE)" , $message );

или
 

eis

или
 

\e

, то и тут эти наши уважаемые разработчики-оптимизаторы PHP нам ТАК нагадили. Теперь это приводит к ворнингам типа:

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in

теперь подобные конструкции надо аккуратно переделывать, используя теперь preg_replace_callback(), не запутываясь в символах и кавычках. Особенно, если была установлена панель BB-кодов того самого IgorekM

Прошу Вашей помощи по переделке выражений!

Что нужно переделывать:

а)
emailer.php


 

  $this->message = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->message );
	$message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e"                         , "(FLASH MOVIE)" , $message );

б)

Profile.php

//---------------------------------------------------
    	// Is this our profile?
    	//---------------------------------------------------
    	
    	if ($member['id'] == $this->member['id'])
    	{
    		$this->output = preg_replace( "/<!--MEM OPTIONS-->/e", "\$this->html->user_edit(\$info)", $this->output );
    	}

в)

post_parser.php - вообще, тьма:
в разных функциях

		$txt = preg_replace( "#\[img\](.+?)\[/img\]#ie" , "\$this->regex_check_image('\\1')", $txt );
		$txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie"                                       , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt );
		$txt = preg_replace( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
		$txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie"                       , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
		$txt = preg_replace( "#(\?|&|;|&)s=([0-9a-zA-Z]){32}(&|;|&|$)?#e", "\$this->regex_bash_session('\\1', '\\3')", $txt );
		$txt = preg_replace( "/<br>|<br \/>/", "\n", $txt );
	    	$txt = preg_replace( "#\[mod\](.+?)\[/mod\]#ies", "\$this->regex_exclaim_tags(1, '\\1', ".$ibforums->vars['post_mod_html'].")", $txt );
	      $txt = preg_replace( "#\[ex\](.+?)\[/ex\]#ies", "\$this->regex_exclaim_tags(2, '\\1', ".$ibforums->vars['post_ex_html'].")", $txt );
			$txt = preg_replace($_exclaim_pattern, "",	$txt);
			$txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt );
             $txt = preg_replace( "#\[hide\](.+?)\[/hide\]#ies", "\$this->regex_hide_tag('\\1')", $txt );
			$txt = preg_replace( "#(^|\s)((http|https|news|ftp)://\w+[^\s\[\]]+)#ie"  , "\$this->regex_build_url(array('html' => '\\2', 'show' => '\\2', 'st' => '\\1'))", $txt );
			$txt = preg_replace( "#(\[quote(.+?)?\].*\[/quote\])#ies" , "\$this->regex_parse_quotes('\\1')"  , $txt );
$txt = preg_replace( "#(\[w].*\[/w\])#ies" , "\$this->regex_parse_w('\\1')"  , $txt );
$txt = preg_replace( "#(\[w].*\[/w\])#ies" , "\$this->regex_parse_w('\\1')"  , $txt );
$txt = preg_replace( "#(\[w].*\[/w\])#ies" , "\$this->regex_parse_w('\\1')"  , $txt );
			$txt = preg_replace( "#(\[spoiler].*\[/spoiler\])#ies" , "\$this->regex_parse_spoiler('\\1')"  , $txt );
				$txt = preg_replace( "#\[sql\](.+?)\[/sql\]#ies"    , "\$this->regex_sql_tag('\\1')"    , $txt );
				$txt = preg_replace( "#\[html\](.+?)\[/html\]#ies"  , "\$this->regex_html_tag('\\1')"   , $txt );
					$txt = preg_replace( "#\n?\[list\](.+?)\[/list\]\n?#ies", "\$this->regex_list('\\1')" , $txt );
					$txt = preg_replace( "#\n?\[list=(a|A|i|I|1)\](.+?)\[/list\]\n?#ies", "\$this->regex_list('\\2','\\1')" , $txt );
				$txt = preg_replace( "#\[img\](.+?)\[/img\]#ie"                             , "\$this->regex_check_image('\\1')"          , $txt );
				$txt = preg_replace( "#(\[flash=)(\S+?)(\,)(\S+?)(\])(\S+?)(\[\/flash\])#ie", "\$this->regex_check_flash('\\2','\\4','\\6')", $txt );
            $txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie"                                       , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt );
            $txt = preg_replace( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
            $txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie"                       , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
$txt = preg_replace( "#\[size=([0-9]+)\](.+?)\[/size\]#ies"    , "\$this->regex_font_attr(array('s'=>'size','1'=>'\\1','2'=>'\\2'))", $txt );
$txt = preg_replace( "#\[font=([a-zA-Z]+)\](.*?)\[/font\]#ies"    , "\$this->regex_font_attr(array('s'=>'font','1'=>'\\1','2'=>'\\2'))", $txt );
$txt = preg_replace( "#\[color=([a-zA-Z]+)\](.+?)\[/color\]#ies"  , "\$this->regex_font_attr(array('s'=>'col' ,'1'=>'\\1','2'=>'\\2'))", $txt );
                $txt = preg_replace( "#\[private=([^\]]+)\](.+?)\[/private\]#ies", "\$this->regex_private(array('name'=>'\\1','line'=>'\\2'))", $txt );

       
            $txt = preg_replace( "#\[mod\](.+?)\[/mod\]#ies", "\$this->regex_mod_tag('\\1')", $txt );
            $txt = preg_replace( "#\[ex\](.+?)\[/ex\]#ies", "\$this->regex_exclaime_tag('\\1')", $txt );
     
                    $txt = preg_replace( "!(?<=[^\w&;/])$code(?=.\W|\W.|\W$)!ei", "\$this->convert_emoticon('$code', '$image')", $txt );

      $txt = preg_replace( "#\[checklink\](\S+?)\[/checklink\]#ie", "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\1', 'checklink' => true))", $txt );

 
[/code]
 
 
[code=auto:0]function post_db_parse($t="", $use_html=0)
	{
		global $ibforums, $DB;
		
		if ( $use_html )
		{
			$t = preg_replace( "#\[dohtml\](.+?)\[/dohtml\]#ies", "\$this->parse_html('\\1')", $t );
		}
		else
		{
			$t = preg_replace( "#(\[dohtml\])(.+?)(\[/dohtml\])#ies", "\$this->my_strip_tags('\\2')", $t );
		}
		
		return $t;
	} 
[/code]
 
[code=auto:0]$txt = preg_replace( 
"#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#eis"
    , "\$this->unconvert_sql(\"\\2\")", $txt);
			$txt = preg_replace( 
"#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#e",
 "\$this->unconvert_htm(\"\\2\")", $txt);
		
			$txt = preg_replace( "#<!--Flash (.+?)-->.+?<!--End 
Flash-->#e"  , "\$this->unconvert_flash('\\1')", $txt );
[/code]
 
[code=auto:0]$txt = preg_replace( "#<!--me&(.+?)-->(.+?)<!--e--me-->#e" , "\$this->unconvert_me('\\1', '\\2')", $txt );
            
            $txt = preg_replace( "#<span style=['\"]font-size:(.+?)pt;line-height:100%['\"]>(.+?)</span>#se" , "\$this->unconvert_size('\\1', '\\2')", $txt );[/code][/code]
Да и, откровенно говоря,
[code=auto:0]
 $txt = preg_replace( "#\[video\](\S+?)\[/video\]#ies", "\$this->regex_build_src('\\1', 'video')", $txt );
$txt = preg_replace( "#\[sound\](\S+?)\[/sound\]#ies", "\$this->regex_build_src('\\1', 'sound')", $txt );
[/code]
[/code]
 
с выводом тегов [sound] и [video] тоже не работает (еще в PHP 5.6.3 отметил)
далее, парсинг цитат:
[code=auto:0]
 $this->quote_html = $this->wrap_style( array( 'STYLE' => 
'QUOTE' ) );
        
        $txt = preg_replace( "#\[quote\]#ie"                        , 
"\$this->regex_simple_quote_tag()"    , $txt );
        $txt = preg_replace( "#\[quote=([^\]]+?),([^\]]+?)\]#ie"    , 
"\$this->regex_quote_tag('\\1', '\\2')"  , $txt );
        $txt = preg_replace( "#\[quote=([^\]]+?)\]#ie"              , 
"\$this->regex_quote_tag('\\1', '')"  , $txt );
        $txt = preg_replace( "#\[/quote\]#ie"                       , 
"\$this->regex_close_quote()"          , $txt );
        //-- mod_bbcode begin
        $txt = str_replace( "\n", "<br />", $txt );
//-- mod_bbcode end
        $txt = preg_replace( "/\n/", "<br>", $txt );
        
        if ( ($this->quote_open == $this->quote_closed) and 
($this->quote_error == 0) )
        {
            $txt = preg_replace( 
"#(<!--QuoteEBegin-->.+?<!--QuoteEnd-->)#es", 
"\$this->regex_preserve_spacing('\\1')", trim($txt) );
            
            return $txt;
        }
        else
        {
            return $the_txt;
        }
[/code]
 
тег [w]:
[code=auto:0]
 

 function regex_parse_w($the_txt="") {
		
		if ($the_txt == "") return;
		
		$txt = $the_txt;
		
		$this->w_html = $this->wrap_style( array( 'STYLE' => 'w' ) );
		
		$txt = preg_replace( "#\[w\]#ie"                , 
"\$this->regex_simple_w_tag()"    , $txt );
		$txt = preg_replace( "#\[/w\]#ie"               , 
"\$this->regex_close_w()"          , $txt );
		
		$txt = preg_replace( "/\n/", "<br>", $txt );
		
		if ( ($this->w_open == $this->w_closed) ) {
			// Preserve spacing
			$txt = preg_replace( 
"#(<!--wEBegin-->.+?<!--wEnd-->)#es", 
"\$this->regex_preserve_spacing('\\1')", trim($txt) );
			return $txt;
		} else {
			return $the_txt;
		}
		
	}
[/code]
 
 
спойлер:
 
[code=auto:0]


[/code]
 
 
[code=auto:0]function regex_parse_spoiler($the_txt="") {
		
		if ($the_txt == "") return;
		
		$txt = $the_txt;
		
		$this->spoiler_html = $this->wrap_style( array( 'STYLE' => 'SPOILER' ) );
		
		$txt = preg_replace( "#\[spoiler\]#ie"                , "\$this->regex_simple_spoiler_tag()"    , $txt );
		$txt = preg_replace( "#\[/spoiler\]#ie"               , "\$this->regex_close_spoiler()"          , $txt );
		
		$txt = preg_replace( "/\n/", "<br>", $txt );
		
		if ( ($this->spoiler_open == $this->spoiler_closed) ) {
			// Preserve spacing
			$txt = preg_replace( "#(<!--SpoilerEBegin-->.+?<!--SpoilerEnd-->)#es", "\$this->regex_preserve_spacing('\\1')", trim($txt) );
			return $txt;
		} else {
			return $the_txt;
		}
		
	}
[/code]
 
 
г) Post.php если уставнолен мод склейки сообщений:
 
[code=auto:0]$row['post'] = preg_replace( "#\[mergetime\](\d+)\[/mergetime\]#ies", "\$std->get_date( '\\1', 'MERGE' )", $row['post'] );

[/code]
 
д) ad_forums.php:
 
[code=auto:0] $cat =    preg_replace( "/^c_(\d+).*$/e", "\\1", $IN['MOVE_ID'] );
       [/code]
 
 
е) у кого установлен мод магазина Lightshop: файл: \sources\Admin\ad_lightshop.php
 
 
 
[code=auto:0]$this->text->mail[$IN['status']] = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->mail[$IN['status']] );
				$this->text->subj[$IN['status']] = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->subj[$IN['status']] );
        		    	$mailm = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->mail[$IN['status'].'_author'] );
						$subjm = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->subj[$IN['status'].'_author'] );
				$this->text->mail[$IN['status']] = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->mail[$IN['status']] );
				$this->text->subj[$IN['status']] = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->subj[$IN['status']] );
        		    	$mailm = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->mail[$IN['status'].'_author'] );
						$subjm = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->text->subj[$IN['status'].'_author'] );
[/code]
 
ё) у кого установлен мод магазина Lightshop: файл: \sources\Lightshop.php в разных функциях:
 
[code=auto:0]
 
$this->text->mail['confirm'] = preg_replace( "/<#(.+?)#>/e",
 "\$words[\\1]", $this->text->mail['confirm'] );
    Line 3297:                 $this->text->subj['confirm'] = 
preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", 
$this->text->subj['confirm'] );
    Line 3299:                 $this->text->mail['confirm_manag'] =
 preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", 
$this->text->mail['confirm_manag'] );
     Line 3344:                 $mailm = preg_replace( 
"/<#(.+?)#>/e", "\$words[\\1]", 
$this->text->mail['confirm_author'] );
    Line 3346:                 $subjm = preg_replace( 
"/<#(.+?)#>/e", "\$words[\\1]", 
$this->text->subj['confirm_author'] 
);s->text->mail['confirm_author'] );
[/code]
 
ж) post_poll.php
 
[code=auto:0]
 $this->poll_choices = preg_replace( "/<br>/e"    , "\$this->regex_count_choices()" , $this->poll_choices );
[/code][/code]
 
з) post_poll_after.php
 
[code=auto:0]$this->poll_choices = preg_replace( "/<br>/e"    , "\$this->regex_count_choices()" , $this->poll_choices );
[/code]
 
и) print_page.php
 
[code=auto:0]$message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e"                         , "(FLASH MOVIE)" , $message );
		//$message = preg_replace( "#<img src=[\"'](\S+?)['\"].+"."?".">#"                            , "(IMAGE: \\1)"   , $message );
		$message = preg_replace( "#<a href=[\"'](http|https|ftp|news)://(\S+?)['\"].+?".">(.+?)</a>#"  , "\\1://\\2"     , $message );
		//$message = preg_replace( "#<a href=[\"']mailto:(.+?)['\"]>(.+?)</a>#"                       , "(EMAIL: \\2)"   , $message );
		//$message = preg_replace( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#e"    , "\n\n--------------- SQL -----------\n\\2\n----------------\n\n", $message);
		//$message = preg_replace( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#e", "\n\n-------------- HTML -----------\n\\2\n----------------\n\n", $message);
[/code]
 
й) Если установлен мод BB-кодов:
 
\sources\mods\bbcode\CodeChange.php
 
[code=auto:0]Line 237:             $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt );
	Line 249:             $txt = preg_replace( "#\[code\](.+?)\[/code\]#ies", "\$this->regex_code_tag('\\1')", $txt );
[/code]
[/code]
 
 
\sources\mods\bbcode\mod_bbcode_func.php
 
 
 
[code=auto:0]$txt = preg_replace("`<base64_encode\((.*?)\)>`ies", "\$this->base64_encode('\\1')", $txt);[/code]
 
 
к) если установлено немецкое, указанное выше, обновление безопасности: \sources\mods\sec_update_131_A\CodeChange.php
 
[code=auto:0]

Line 1471:          $ibforums->input['username'] = 
preg_replace("/([0-9]+);/ie", 
"\$this->convert_html_char('\\1')", $ibforums->input['username'] 
);
	Line 1483:         $ibforums->input['UserName'] = 
preg_replace("/([0-9]+);/ie", 
"\$this->convert_html_char('\\1')", $ibforums->input['UserName'] 
);

[/code]
 
 
\sources\mods\sec_update_131_B\CodeChange.php
 
[code=auto:0]
Line 378:             $cat =    preg_replace( "/^c_(\d+).*$/e", "\\1", $IN['MOVE_ID'] );
	Line 379:             $parent = preg_replace( "/^c.*_/e", "", $IN['MOVE_ID'] );
[/code]
 
 
л) Register.php
 
 
[code=auto:0]
Line 180:          $ibforums->input['username'] = preg_replace("/([0-9]+);/ie", "\$this->convert_html_char('\\1')", $ibforums->input['username'] );
	Line 743:         $ibforums->input['UserName'] = preg_replace("/([0-9]+);/ie", "\$this->convert_html_char('\\1')", $ibforums->input['UserName'] );
[/code]
 
м) Reputation.php Если установлен мод репутации
 
 
[code=auto:0]
 
[code=auto:0]Line 721: 				$i['comment'] = preg_replace('/#DAT_(.+?)_#EDAT/e', "\$std->get_date('\\1', 'LONG')", $i['comment']);

 
[/code]
 
н)
Search.php
[code=auto:0]                $ibforums->input['end_day'] = preg_replace( "/e/", "", $ibforums->input['end_day']);

 
[/code]
о)
 
xChat.php (если установлен чат) в \sources\xChat.php
  
 
[code=auto:0]$txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie"                                       , "\$this->parser->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt );
        $txt = preg_replace( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#ie" , "\$this->parser->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
        $txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie"                       , "\$this->parser->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
            $txt = preg_replace( "#\[size=([^\]]+)\](.+?)\[/size\]#ies"    , "\$this->parser->regex_font_attr(array('s'=>'size','1'=>'\\1','2'=>'\\2'))", $txt );
            $txt = preg_replace( "#\[font=([^\]]+)\](.*?)\[/font\]#ies"    , "\$this->parser->regex_font_attr(array('s'=>'font','1'=>'\\1','2'=>'\\2'))", $txt );
            $txt = preg_replace( "#\[color=([^\]]+)\](.+?)\[/color\]#ies"  , "\$this->parser->regex_font_attr(array('s'=>'col' ,'1'=>'\\1','2'=>'\\2'))", $txt );[/code]
п)
xShoutbox.php (если установлен чат) в \sources\\xShoutbox_functions.php
 
переделать везде, где есть это
 
[code=auto:0][b]e[/b][/code]
[code=auto:0]		$txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie"                                       , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt );
		$txt = preg_replace( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
		$txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie"                       , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
				$txt = preg_replace( "!(?<=[^\w&;/])$code(?=.\W|\W.|\W$)!ei", "\$this->convert_emoticon('$code', '$image')", $txt );
				//$txt = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1" , $txt );
			$txt = preg_replace( "#\[size=([^\]]+)\](.+?)\[/size\]#ies"    , "\$this->regex_font_attr(array('s'=>'size','1'=>'\\1','2'=>'\\2'))", $txt );
			$txt = preg_replace( "#\[font=([^\]]+)\](.*?)\[/font\]#ies"    , "\$this->regex_font_attr(array('s'=>'font','1'=>'\\1','2'=>'\\2'))", $txt );
			$txt = preg_replace( "#\[color=([^\]]+)\](.+?)\[/color\]#ies"  , "\$this->regex_font_attr(array('s'=>'col' ,'1'=>'\\1','2'=>'\\2'))", $txt );
			$url['html'] = preg_replace( "/([\.,\?]|!)$/", "", $url['html'] );
			$url['show'] = preg_replace( "/([\.,\?]|!)$/", "", $url['show'] );
		$url['html'] = preg_replace( "/&/" , "&" , $url['html'] );
		$url['html'] = preg_replace( "/javascript:/i", "java script: ", $url['html'] );
		$url['show'] = preg_replace( "/&/" , "&" , $url['show'] );
		$url['show'] = preg_replace( "/javascript:/i", "javascript: ", $url['show'] );
			$stripped = preg_replace( "#^(http|ftp|https|news)://(\S+)$#i", "\\2", $url['show'] );
			$uri_type = preg_replace( "#^(http|ftp|https|news)://(\S+)$#i", "\\1", $url['show'] );
		$IN['1'] = preg_replace( "/[&\(\)\.\%]/", "", $IN['1'] );
		$txt = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1" , $txt );
			$txt = preg_replace( "#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#eis"    , "\$this->unconvert_sql(\"\\2\")", $txt);
			$txt = preg_replace( "#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#e", "\$this->unconvert_htm(\"\\2\")", $txt);
			$txt = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#e"  , "\$this->unconvert_flash('\\1')", $txt );
			$txt = preg_replace( "#<img src=[\"'](\S+?)['\"].+?".">#"           , "\[IMG\]\\1\[/IMG\]"            , $txt );
			$txt = preg_replace( "#<a href=[\"']mailto:(.+?)['\"]>(.+?)</a>#"                         , "\[EMAIL=\\1\]\\2\[/EMAIL\]"   , $txt );
			$txt = preg_replace( "#<a href=[\"'](http://|https://|ftp://|news://)?(\S+?)['\"].+?".">(.+?)</a>#" , "\[URL=\\1\\2\]\\3\[/URL\]"  , $txt );
			$txt = preg_replace( "#<!--QuoteBegin-->(.+?)<!--QuoteEBegin-->#"                , '[QUOTE]'         , $txt );
			$txt = preg_replace( "#<!--QuoteBegin-{1,2}([^>]+?)\+([^>]+?)-->(.+?)<!--QuoteEBegin-->#"  , "[QUOTE=\\1,\\2]" , $txt );
			$txt = preg_replace( "#<!--QuoteBegin-{1,2}([^>]+?)\+-->(.+?)<!--QuoteEBegin-->#"       , "[QUOTE=\\1]" , $txt );
			$txt = preg_replace( "#<!--QuoteEnd-->(.+?)<!--QuoteEEnd-->#"                    , '[/QUOTE]'        , $txt );
			$txt = preg_replace( "#<!--c1-->(.+?)<!--ec1-->#", '[CODE]'   , $txt );
			$txt = preg_replace( "#<!--c2-->(.+?)<!--ec2-->#", '[/CODE]'  , $txt );
			$txt = preg_replace( "#<i>(.+?)</i>#is"  , "\[i\]\\1\[/i\]"  , $txt );
			$txt = preg_replace( "#<b>(.+?)</b>#is"  , "\[b\]\\1\[/b\]"  , $txt );
			$txt = preg_replace( "#<s>(.+?)</s>#is"  , "\[s\]\\1\[/s\]"  , $txt );
			$txt = preg_replace( "#<u>(.+?)</u>#is"  , "\[u\]\\1\[/u\]"  , $txt );
			$txt = preg_replace( "#(\n){0,}<ul>#" , "\\1\[LIST\]"  , $txt );
			$txt = preg_replace( "#(\n){0,}<ol type='(a|A|i|I|1)'>#" , "\\1\[LIST=\\2\]\n"  , $txt );
			$txt = preg_replace( "#(\n){0,}<li>#" , "\n\[*\]"     , $txt );
			$txt = preg_replace( "#(\n){0,}</ul>(\n){0,}#", "\n\[/LIST\]\\2" , $txt );
			$txt = preg_replace( "#(\n){0,}</ol>(\n){0,}#", "\n\[/LIST\]\\2" , $txt );
			$txt = preg_replace( "#<!--me&(.+?)-->(.+?)<!--e--me-->#e" , "\$this->unconvert_me('\\1', '\\2')", $txt );
			$txt = preg_replace( "#<span style=['\"]font-size:(.+?)pt;line-height:100%['\"]>(.+?)</span>#se" , "\$this->unconvert_size('\\1', '\\2')", $txt );
				$txt = preg_replace( "#<span style=['\"]color:(.+?)['\"]>(.+?)</span>#is"    , "\[color=\\1\]\\2\[/color\]", $txt );
			$txt = preg_replace( "#<span style=['\"]font-family:(.+?)['\"]>(.+?)</span>#is", "\[font=\\1\]\\2\[/font\]", $txt );
			$txt = preg_replace( "#(\[/QUOTE\])\s*?<br>\s*#si", "\\1\n", $txt );
			$txt = preg_replace( "#<!--EDIT\|.+?\|.+?-->#" , "" , $txt );
		$txt = preg_replace( "#<br>#", "\n", $txt );
					$text = preg_replace( "/(^|\b)".$r['type']."(\b|!|\?|\.|,|$)/i", "$replace", $text );
					$text = preg_replace( "/".$r['type']."/i", "$replace", $text );

15)
Опять по mysqli:

ad_templates.php

это:
 //+-------------------------------
  // Update the DB
  //+-------------------------------
  
  $string = $DB->compile_db_update_string( array (
               'section_content' => str_replace("\'","'",mysql_escape_string($text)),
               'updated'         => time(),
              )       );
на это:

 //+-------------------------------
  // Update the DB
  //+-------------------------------
  
  $string = $DB->compile_db_update_string( array (
               'section_content' => str_replace("\'","'",mysqli_escape_string($text)),
               'updated'         => time(),
              )       );
Ссылка на комментарий
Поделиться на других сайтах

  • 0

а с глобальными переменными что делали? они же уже давно deprecated

Да, если вставить код в начало

// Включение протоколирования ошибок
error_reporting(1);

// Включать в отчет простые описания ошибок
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Включать в отчет E_NOTICE сообщения (добавятся сообщения о 
//непроинициализированных переменных или ошибках в именах переменных)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Добавлять в отчет все PHP ошибки (см. список изменений)
error_reporting(E_ALL);

// Добавлять в отчет все PHP ошибки
error_reporting(-1);

// То же, что и error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
error_reporting( E_ALL );
ini_set( 'display_errors', 1 );

в, например, выдающий белую страницу в PHP 7, файл Reputation.php и просмотреть даже под PHP 5.6, то

 

выдаст:

Notice: Undefined index: leave_out in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 936

Notice: Use of undefined constant NAV - assumed 'NAV' in C:\OpenServer\domains\ddd.ru\forums\sources\Reputation.php on line 148

Notice: Undefined index: ipscheck in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 2266

Notice: Undefined index: ipb_reg_number in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 2407

Notice: Undefined index: ips_cp_purchase in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 2429

Notice: Use of undefined constant img_url - assumed 'img_url' in C:\OpenServer\domains\ddd.ru\forums\Skin\s1\skin_global.php on line 283

Notice: Use of undefined constant ls_download - assumed 'ls_download' in C:\OpenServer\domains\ddd.ru\forums\Skin\s1\skin_global.php on line 283

Notice: Undefined index: shop_cart in C:\OpenServer\domains\ddd.ru\forums\Skin\s1\skin_global.php on line 398

Notice: Use of undefined constant TEXT - assumed 'TEXT' in C:\OpenServer\domains\ddd.ru\forums\Skin\s1\skin_global.php on line 413

Notice: Undefined index: chat_account_no in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 2548

Notice: Undefined index: top_site_list_integrate in C:\OpenServer\domains\ddd.ru\forums\sources\functions.php on line 2564

Если вставить в Forums.php, то там ошибок, вообще, тьма. Если не вставлять текст, то ошибки не отображаются и все работает. А что вы посоветуете с deprecated глобальными переменными?

Изменено пользователем dimitry
Ссылка на комментарий
Поделиться на других сайтах

  • 0

А что вы посоветуете с deprecated глобальными переменными?

ну логично, что отключать вывод ошибок это не выход. тут надо перелопачивать весь код и избавляться от них.

либо посомтреть в сторону 2.*, они все подобные переменные сунули в $this->ipsclass и передавали ее по ссылке каждому классу в конструкторе

либо использовать какой-то готовый DI контейнер

 

в любом случае, работы тут много

Ссылка на комментарий
Поделиться на других сайтах

  • 0

Откорректировал ошибки preg_replace, связанные с e

Прикладываю откорректированные файлы, сами смотрите и сравнивайте.

Откорректированные файлы.zip

 

В частности, примеры по отдельным файлам и сложные конструкции:

 

1)

emailer.php:

//$this->message = preg_replace( "/<#(.+?)#>/e", "\$words[\\1]", $this->message );
		$this->message = preg_replace_callback( "/<#(.+?)#>/", function ($match) use ($words) {
						return $words[$match[1]];
		}, $this->message);

2)

post_parser.php:

//$txt = preg_replace( "#\[img\](.+?)\[/img\]#ie" , "\$this->regex_check_image('\\1')", $txt );
		$txt = preg_replace_callback( "#\[img\](.+?)\[/img\]#i" , function ($match) {
						return $this-regex_check_image($match[1]);
					} , $txt);
		//$txt = preg_replace( "#\[url\](\S+?)\[/url\]#ie"                                       , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\1'))", $txt );
		$txt = preg_replace_callback( "#\[url\](\S+?)\[/url\]#i"                                       , function ($match) {
						return $this-regex_build_url(array('html' => $match[1], 'show' => $match[1]));
					} , $txt);
		//$txt = preg_replace( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#ie" , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
		$txt = preg_replace_callback( "#\[url\s*=\s*\&quot\;\s*(\S+?)\s*\&quot\;\s*\](.*?)\[\/url\]#i" , function ($match) {
						return $this-regex_build_url(array('html' => $match[1], 'show' => $match[2]));
					} , $txt);
		//$txt = preg_replace( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#ie"                       , "\$this->regex_build_url(array('html' => '\\1', 'show' => '\\2'))", $txt );
		$txt = preg_replace_callback( "#\[url\s*=\s*(\S+?)\s*\](.*?)\[\/url\]#i"                       ,function ($match) {
						return $this-regex_build_url(array('html' => $match[1], 'show' => $match[2]));
					} , $txt);
//$txt = preg_replace( "#\[spoiler\]#ie"                , "\$this->regex_simple_spoiler_tag()"    , $txt );
		$txt = preg_replace_callback( "#\[spoiler\]#i"                , function () {
						return $this->regex_simple_spoiler_tag();
					} , $txt);
		//$txt = preg_replace( "#\[/spoiler\]#ie"               , "\$this->regex_close_spoiler()"          , $txt );
		$txt = preg_replace_callback( "#\[/spoiler\]#i"               , function () {
						return $this->regex_close_spoiler();
					} , $txt);
//$txt = preg_replace( "#(<!--SpoilerEBegin-->.+?<!--SpoilerEnd-->)#es", "\$this->regex_preserve_spacing('\\1')", trim($txt) );
			$txt = preg_replace_callback( "#(<!--SpoilerEBegin-->.+?<!--SpoilerEnd-->)#s", function ($match) {
						return $this->regex_preserve_spacing($match[1]);
					} , trim($txt));
			return $txt;

3)

 

Profile.php:

 

Посложнее:

//---------------------------------------------------
    	// Is this our profile?
    	//---------------------------------------------------
    	
    	if ($member['id'] == $this->member['id'])
    	{
    		//$this->output = preg_replace( "/<!--MEM OPTIONS-->/", "'.\$this->html->user_edit(\$info).'", $this->output );
			$this->output = preg_replace_callback( "/<!--MEM OPTIONS-->/", function () use ($info) {
						return $this->html->user_edit($info);
					}, $this->output);
    	}

4)

 

Post.php:

 

Если есть склейка сообщений:

//$row['post'] = preg_replace( "#\[mergetime\](\d+)\[/mergetime\]#ies", "\$std->get_date( '\\1', 'MERGE' )", $row['post'] );
			$row['post'] = preg_replace_callback( "#\[mergetime\](\d+)\[/mergetime\]#is", function ($match) {
						return $std->get_date($match[1], 'MERGE' );
					}, $row['post']);

5)

 

post_poll.php и post_poll_after.php:

$this->poll_choices = preg_replace( "/<br><br>/" , ""                              , $this->poll_choices );
		
		//$this->poll_choices = preg_replace( "/<br>/e"    , "\$this->regex_count_choices()" , $this->poll_choices );
		$this->poll_choices = preg_replace_callback( "/<br>/"  , function () {
						return $this->regex_count_choices();
					} ,$this->poll_choices);

6)

 

print_page.php

//$message = preg_replace( "#<!--Flash (.+?)-->.+?<!--End Flash-->#"                         , "(FLASH MOVIE)" , $message );
        $message = preg_replace_callback( "#<!--Flash (.+?)-->.+?<!--End Flash-->#" , function () {
                        return '(FLASH MOVIE)';
                    }, $message);

7)

 

Search.php

//$ibforums->input['end_day'] = preg_replace( "/e/", "", $ibforums->input['end_day']);
				$ibforums->input['end_day'] = preg_replace( "//",  function () {
						return ;
					} ,$ibforums->input['end_day']);
Изменено пользователем dimitry
Ссылка на комментарий
Поделиться на других сайтах

  • 0

Dimitry, are you still transitioning to PHP7 or did you stop?

Unfortunately, I stopped, no longer doing it, because progress is taking leaps and bounds and everything is becoming obsolete. // К сожалению, остановился, больше не занимаюсь, ибо прогресс идет семимильными шагами и всё устаревает.

Ссылка на комментарий
Поделиться на других сайтах

  • 0

очень хороший форум вот тока жалко нельзя создавать таблицу!

Изменено пользователем glaz321
Ссылка на комментарий
Поделиться на других сайтах

Присоединиться к обсуждению

Вы можете ответить сейчас, а зарегистрироваться позже. Если у вас уже есть аккаунт, войдите, чтобы ответить от своего имени.

Гость
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Ответить на вопрос...

×   Вы вставили отформатированный текст.   Удалить форматирование

  Допустимо не более 75 смайлов.

×   Ваша ссылка была автоматически заменена на медиа-контент.   Отображать как ссылку

×   Ваши публикации восстановлены.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.

Зарузка...
×
×
  • Создать...

Важная информация

Находясь на нашем сайте, вы соглашаетесь на использование файлов cookie, а также с нашим положением о конфиденциальности Политика конфиденциальности и пользовательским соглашением Условия использования.