Jump to content
Sign in to follow this  
altermate

Syntax error with Security Pro

Recommended Posts

I install Securitypro and there was a syntax error as follows

Parse error: syntax error, unexpected T_BOOLEAN_AND in /home/sharingy/public_html/includes/application_top.php on line 75

any ideas??

Share this post


Link to post
Share on other sites

I install Securitypro and there was a syntax error as follows

Parse error: syntax error, unexpected T_BOOLEAN_AND in /home/sharingy/public_html/includes/application_top.php on line 75

any ideas??

 

You should post in the support threads of contributions as opposed to general support.

 

But .. security pro is an easy install you have simply added the application_top code incorrectly. Take it out and try again.

Edited by FWR Media

Share this post


Link to post
Share on other sites

I did and now it says line 76 error... I'll keep tryin.

 

// FWR Media Security Proif ( defined('FWR_SECURITY_PRO_ON') && FWR_SECURITY_PRO_ON === 'true' ) {$fwr_security_excludes = array();if ( defined('FWR_SECURITY_PRO_FILE_EXCLUSIONS_ON') && FWR_SECURITY_PRO_FILE_EXCLUSIONS_ON === 'true' )$fwr_security_excludes = explode(',', FWR_SECURITY_PRO_FILE_EXCLUSIONS);if ( !in_array(basename($_SERVER['PHP_SELF']), $fwr_security_excludes) )include('includes/functions/security.php');}if ( function_exists('tep_clean_get__recursive') ) {// Recursively clean $HTTP_GET_VARS and $_GET// There is no legitimate reason for these to contain anything but ..// A-Z a-z 0-9 -(hyphen).(dot)_(underscore) {} space$HTTP_GET_VARS = tep_clean_get__recursive($HTTP_GET_VARS);$_GET = tep_clean_get__recursive($_GET);$_REQUEST = $_GET + $_POST; // $_REQUEST now holds the cleaned $_GET and std $_POST. $_COOKIE has been removed.fwr_clean_global($_GET); // Change the $GLOBALS value to the cleaned value}// END - FWR Media Security Pro

 

thats what i entered

Edited by altermate

Share this post


Link to post
Share on other sites

I did and now it says line 76 error... I'll keep tryin.

 

// FWR Media Security Proif ( defined('FWR_SECURITY_PRO_ON') && FWR_SECURITY_PRO_ON === 'true' ) {$fwr_security_excludes = array();if ( defined('FWR_SECURITY_PRO_FILE_EXCLUSIONS_ON') && FWR_SECURITY_PRO_FILE_EXCLUSIONS_ON === 'true' )$fwr_security_excludes = explode(',', FWR_SECURITY_PRO_FILE_EXCLUSIONS);if ( !in_array(basename($_SERVER['PHP_SELF']), $fwr_security_excludes) )include('includes/functions/security.php');}if ( function_exists('tep_clean_get__recursive') ) {// Recursively clean $HTTP_GET_VARS and $_GET// There is no legitimate reason for these to contain anything but ..// A-Z a-z 0-9 -(hyphen).(dot)_(underscore) {} space$HTTP_GET_VARS = tep_clean_get__recursive($HTTP_GET_VARS);$_GET = tep_clean_get__recursive($_GET);$_REQUEST = $_GET + $_POST; // $_REQUEST now holds the cleaned $_GET and std $_POST. $_COOKIE has been removed.fwr_clean_global($_GET); // Change the $GLOBALS value to the cleaned value}// END - FWR Media Security Pro

 

thats what i entered

 

Are you using a decent flat file editor or something horrible like dreamweaver?

 

If you are at a loss try something like notepad++. Back to your problem .. revert to your backup of the file and just add the code again .. the code is correct.

Share this post


Link to post
Share on other sites

Start by using [ code ] tags when you post code. What you posted is unreadable. If I untangled it correctly, it's:

// FWR Media Security Pro
 if ( defined('FWR_SECURITY_PRO_ON') && FWR_SECURITY_PRO_ON === 'true' ) {
   $fwr_security_excludes = array();
   if ( defined('FWR_SECURITY_PRO_FILE_EXCLUSIONS_ON') && FWR_SECURITY_PRO_FILE_EXCLUSIONS_ON === 'true')
     $fwr_security_excludes = explode(',', FWR_SECURITY_PRO_FILE_EXCLUSIONS);
   if ( !in_array(basename($_SERVER['PHP_SELF']), $fwr_security_excludes) )
     include('includes/functions/security.php');
 }
 if ( function_exists('tep_clean_get__recursive') ) {
   // Recursively clean $HTTP_GET_VARS and $_GET
   // There is no legitimate reason for these to contain anything but ..
   // A-Z a-z 0-9 -(hyphen).(dot)_(underscore) {} space
   $HTTP_GET_VARS = tep_clean_get__recursive($HTTP_GET_VARS);
   $_GET = tep_clean_get__recursive($_GET);
   $_REQUEST = $_GET + $_POST; 
   // $_REQUEST now holds the cleaned $_GET and std $_POST. $_COOKIE has been removed.
   fwr_clean_global($_GET); // Change the $GLOBALS value to the cleaned value
 }
// END - FWR Media Security Pro

I have to wonder about the line $_REQUEST = $_GET + $_POST; -- is that legit? I've never seen two arrays added together like that. I have seen array_merge() used.

 

Which line is 76?

 

Does this add-on specify a certain minimum level of PHP? Are you running at least that level? What level of osC? Recent levels of PHP don't by default define $HTTP_GET_VARS -- recent versions of osC have a compatibility layer to create it from the contents of $_GET.

Share this post


Link to post
Share on other sites

I'm using Osc 2.2 and I only copied and pasted it into the correct .php.... I'm an extreme amatuer at this and It's all a hit and miss.

Thanx

Share this post


Link to post
Share on other sites

Which osC 2.2? 2.2 has been out for at least 7 or 8 years and has gone through many iterations -- MS1, MS2, RC1, RC2, RC2a. Where did you get the osC install package from? What is the latest copyright date in the files? For example, includes/application_top.php should say Copyright © 2008 osCommerce.

 

It looks like your code is what is posted in the add-on (assuming you put it in the right place), but I'm still worried about that line I mentioned. Anyone know if that's legit? ($_GET + $_POST) Does that require a certain minimum level of PHP?

 

What error are you getting now, and what is the line it's happening on?

Share this post


Link to post
Share on other sites

It's 2008 osCommerce... ($_GET + $_POST) Does that require a certain minimum level of PHP?

I'm unsure what that line above means... Ummm... I just copied and pasted what you entered above and it seems to be working. I have turned security pro turned on in the admin and so far theres no error... thanx.. fingers crossed.

A big THANK YOU... Oh, is there a way I can tell it's working?

Share this post


Link to post
Share on other sites

I have to wonder about the line $_REQUEST = $_GET + $_POST; -- is that legit? I've never seen two arrays added together like that. I have seen array_merge() used.

 

No it's perfectly valid, the addition operator behaves differently when its operands are arrays, it creates a union of its two operands. It has a few "gotchas" though it doesn't necessarily behave the same as array_merge();

 

+= can also be used as well as equivalence and identity operators.

Share this post


Link to post
Share on other sites

Hi!

 

I've also got a problem with Security Pro. Following the instructions. Uploaded the SecurityPro_installer.php to my website (I don't have a /catalog directory, so uploaded it to root.

 

Your instructions say to run the installer and THEN upload the security.php file, and THEN make the page changes.

 

However, on navigating to /(mywebsite)/securitypro_installer.php, I get the following error:

 

Fatal error: Call to a member function add_current_page() on a non-object in C:\Domains\ariadnetheweaver.org\wwwroot\includes\application_top.php on line 313

 

can you help please?

Share this post


Link to post
Share on other sites

Hi!

 

I've also got a problem with Security Pro. Following the instructions. Uploaded the SecurityPro_installer.php to my website (I don't have a /catalog directory, so uploaded it to root.

 

Your instructions say to run the installer and THEN upload the security.php file, and THEN make the page changes.

 

However, on navigating to /(mywebsite)/securitypro_installer.php, I get the following error:

 

Fatal error: Call to a member function add_current_page() on a non-object in C:\Domains\ariadnetheweaver.org\wwwroot\includes\application_top.php on line 313

 

can you help please?

 

That is not a security pro issue it is a well known osCommerce issue. Close ALL your browser windows and try again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×