Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
nextgen
Worker
Worker



Joined: Sep 28, 2006
Posts: 233
Location: Maryland

PostPosted: Tue Nov 24, 2020 5:28 pm Reply with quote

Friends i am getting this warning from an old add on i am trying to revive and use


Warning: preg_match(): Delimiter must not be alphanumeric or backslash

I used the preg_match to replace the deprecated eregi which got me rolling but when i debug i get the preg_match warmings

Here is the line where the code pops up..

if (preg_match(".cmd.php", $file)) {

Any help ?

_________________
alterednuke.com Your source for Ravennuke themes. 
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1643

PostPosted: Wed Nov 25, 2020 2:35 pm Reply with quote

Try this.

php Code:
if (preg_match('/.cmd.php/', $file))

_________________
Github: RavenNuke 
View user's profile Send private message
neralex







PostPosted: Thu Nov 26, 2020 3:00 pm Reply with quote

There are some other ways to prevent running a file directy.

Block-files in RN:

php Code:
if ( !defined('BLOCK_FILE') ) {

Header('Location: ../index.php');
die();
}


Module-files in RN:

php Code:
if(!defined('MODULE_FILE')) die('You can\'t access this file directly...');


Admin-files in RN:

php Code:
if ( !defined('ADMIN_FILE') ) {

die ('Access Denied');
}


based on the realpath:

php Code:
if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) {exit('Access Denied');}
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©