pluck-cms / pluck

Central repo for pluck cms
http://www.pluck-cms.org
55 stars 37 forks source link

problem with ereg() #68

Closed Manuel2195 closed 5 years ago

Manuel2195 commented 5 years ago

if((!ereg('index.php', $_SERVER['SCRIPT_FILENAME'])) && (!ereg('admin.php', $_SERVER['SCRIPT_FILENAME'])) && (!ereg('install.php', $_SERVER['SCRIPT_FILENAME'])) && (!ereg('login.php', $_SERVER['SCRIPT_FILENAME'])) && (!ereg('update.php', $_SERVER['SCRIPT_FILENAME']))){ //Give out an "access denied" error. echo 'access denied'; //Block all other code. exit();

Hello, I use this type of function quite often. Since my website provider updated to PHP 7.2 the website doesn't work anymore. The output is "access denied". Thanks you in advance!

BSteelooper commented 5 years ago

Try the following:

` //Make sure the file isn't accessed directly.

defined('IN_PLUCK') or exit('Access denied!'); `

billcreswell commented 5 years ago

Ereg is deprecated in favor of preg, so that all ereg functions need to be updated

On Sat, Dec 15, 2018, 5:15 AM Manuel2195 <notifications@github.com wrote:

if((!ereg('index.php', $_SERVER['SCRIPT_FILENAME'])) && (!ereg('admin.php', $_SERVER['SCRIPT_FILENAME'])) && (!ereg('install.php', $_SERVER['SCRIPT_FILENAME'])) && (!ereg('login.php', $_SERVER['SCRIPT_FILENAME'])) && (!ereg('update.php', $_SERVER['SCRIPT_FILENAME']))){ //Give out an "access denied" error. echo 'access denied'; //Block all other code. exit();

Hello, I use this type of function quite often. Since my website provider updated to PHP 7.2 the website doesn't work anymore. The output is "access denied". Thanks you in advance!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pluck-cms/pluck/issues/68, or mute the thread https://github.com/notifications/unsubscribe-auth/ABfAPhYTLKEDNFZqfSaiQk1EDQ1ATz0hks5u5MvGgaJpZM4ZUq1B .