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: 241

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
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

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');}
 
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Thu Mar 04, 2021 9:08 pm Reply with quote

Hi Neralex, I noticed this while comparing the latest version (left) with my installation of RN 2.5.1 (right). I may have modified this, but wondered if you were aware of Montego's code change highlighted on the right. It combines multiple SQL statements into a single execution, rather than having a different SQL connection for each.
Image

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
neralex







PostPosted: Thu Mar 04, 2021 10:31 pm Reply with quote

kguske, hmm yes I know but Montego's code has never worked for me on this point in RN251. The counter always had the same value, no matter how many messages were stored. So I tried to fixed it as single SQL statements.

This is the original file/line-number in 251: [ Only registered users can see links on this board! Get registered or login! ]
 
kguske







PostPosted: Fri Mar 05, 2021 7:58 pm Reply with quote

Thank you, sir. Wasn't sure if you had seen it.
 
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 ©