Изкачащи редове с грешки

themes , модове , проблеми , инсталация
Post Reply
User avatar
canon1d1v
Нов
Нов
Posts: 67
Joined: Fri Nov 13, 2009 1:10 am
Contact:

Изкачащи редове с грешки

Post by canon1d1v » Fri Oct 19, 2018 4:13 am

Смених хоста на сайта и сега ми излиза това съобщение:

Image

Ето го и като текст и код:

Deprecated: Function eregi() is deprecated in /home/siriusdc/public_html/greencard.photony-bg.com/maincore.php on line 35

Deprecated: Function eregi() is deprecated in /home/siriusdc/public_html/greencard.photony-bg.com/maincore.php on line 35

Deprecated: Function eregi() is deprecated in /home/siriusdc/public_html/greencard.photony-bg.com/maincore.php on line 36

Deprecated: Function eregi() is deprecated in /home/siriusdc/public_html/greencard.photony-bg.com/maincore.php on line 36

Deprecated: Function eregi() is deprecated in /home/siriusdc/public_html/greencard.photony-bg.com/maincore.php on line 37

Deprecated: Function eregi() is deprecated in /home/siriusdc/public_html/greencard.photony-bg.com/maincore.php on line 37

Deprecated: Function eregi() is deprecated in /home/siriusdc/public_html/greencard.photony-bg.com/maincore.php on line 38

Deprecated: Function eregi() is deprecated in /home/siriusdc/public_html/greencard.photony-bg.com/maincore.php on line 38

Deprecated: Function eregi() is deprecated in /home/siriusdc/public_html/greencard.photony-bg.com/maincore.php on line 39

[html]// Prevent any possible XSS attacks via $_GET.
foreach ($_GET as $check_url) {
if (!is_array($check_url)) {
$check_url = str_replace("\"", "", $check_url);
if ((eregi("<[^>]*script*\"?[^>]*>", $check_url)) || (eregi("<[^>]*object*\"?[^>]*>", $check_url)) ||
(eregi("<[^>]*iframe*\"?[^>]*>", $check_url)) || (eregi("<[^>]*applet*\"?[^>]*>", $check_url)) ||
(eregi("<[^>]*meta*\"?[^>]*>", $check_url)) || (eregi("<[^>]*style*\"?[^>]*>", $check_url)) ||
(eregi("<[^>]*form*\"?[^>]*>", $check_url)) || (eregi("\([^>]*\"?[^)]*\)", $check_url)) ||
(eregi("\"", $check_url))) {
die ();
}
}
}
unset($check_url);
[/html]

Някакви идеи, как да се оправи???

raiden
Гуру
Гуру
Posts: 2182
Joined: Fri Dec 08, 2006 8:13 am
Answers: 190
Location: Варна

Post by raiden » Fri Oct 19, 2018 5:53 am

На новия хост имаш по-висока версия на PHP (>=5.3.0), в която функцията е deprecated и ще бъде премахната (вече е в PHP 7).
Можеш да я замениш с preg_match:
eregi("<[^>]*script*\"?[^>]*>", $check_url)
става
preg_match("/<[^>]*script*\"?[^>]*>/i", $check_url)

User avatar
canon1d1v
Нов
Нов
Posts: 67
Joined: Fri Nov 13, 2009 1:10 am
Contact:

Останаха само два реда?

Post by canon1d1v » Fri Oct 19, 2018 10:58 am

Промених кода, но остана съобщението за два реда, а имено 38 и 39, те са:

[html](eregi("\([^>]*\"?[^)]*\)", $check_url)) ||
(eregi("\"", $check_url))) [/html]

User avatar
anonimen
Много Редовен
Много Редовен
Posts: 1523
Joined: Mon Jun 11, 2012 6:07 pm
Answers: 162
Location: Parse error: unexpected "}" in /home/index.php on line 26

Re: Останаха само два реда?

Post by anonimen » Fri Oct 19, 2018 3:03 pm

canon1d1v wrote:Промених кода, но остана съобщението за два реда, а имено 38 и 39, те са:

[html](eregi("\([^>]*"?[^)]*\)", $check_url)) ||
(eregi(""", $check_url))) [/html]
Е просто прилагаш същите промени и върху тях?

User avatar
canon1d1v
Нов
Нов
Posts: 67
Joined: Fri Nov 13, 2009 1:10 am
Contact:

Всичко се оправи!

Post by canon1d1v » Tue Oct 23, 2018 4:21 pm

Здравейте!

За всички, които имат същия проблем, нещата ги промених и всичко се оправи!
Ето новия код:
[html] if ((preg_match("/<[^>]*script*\"?[^>]*>/i", $check_url)) || (preg_match("/<[^>]*object*\"?[^>]*>/i", $check_url)) ||
(preg_match("/<[^>]*iframe*\"?[^>]*>/i", $check_url)) || (preg_match("/<[^>]*applet*\"?[^>]*>/i", $check_url)) ||
(preg_match("/<[^>]*meta*\"?[^>]*>/i", $check_url)) || (preg_match("/<[^>]*style*\"?[^>]*>/i", $check_url)) ||
(preg_match("/<[^>]*form*\"?[^>]*>/i", $check_url)) || (preg_match("/<[^>]*\"?[^)]*>/i", $check_url)) ||
(preg_match("/<\">/i", $check_url))) {
[/html]

Post Reply