Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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??

 

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
Link to comment
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
Link to comment
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.

Link to comment
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.

Link to comment
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?

Link to comment
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?

Link to comment
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.

Link to comment
Share on other sites

  • 2 weeks later...

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?

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...