Hi. I am pretty new to this site and I am impressed with the work of Smoge. Great job
. I recently downloaded a fully functional 30 day trial of Zend Suite (www.zend.com). Now I am no PHP expert, but I am trying to learn it as much as possible. I used the Code Analyzer to take a look at some of the coding for this software and here is what I found for global_settings.php:
Code Analyzer Output:
Unsafe use of variable in call include()/require() (line 14)
Unsafe use of variable in call include()/require() (line 15)
Unsafe use of variable in call include()/require() (line 16)
Unsafe use of variable in call include()/require() (line 17)
Unsafe use of variable in call include()/require() (line 1
Unsafe use of variable in call include()/require() (line 19)
First argument for define() is not a string (line 45)
First argument for define() is not a string (line 47)
First argument for define() is not a string (line 4
First argument for define() is not a string (line 49)
First argument for define() is not a string (line 50)
First argument for define() is not a string (line 51)
Assignment in condition (line 175)
Assignment in condition (line 243)
Variable $p_arr appears only once (line 317)
The value of variable $p_arr was never used (line 317)
Assignment in condition (line 47
Assignment in condition (line 517)
Assignment in condition (line 596)
Assignment in condition (line 743)
Bad escape sequence: \d (line 79
Assignment in condition (line 851)
Here is a description they gave for "Unsafe use of variable in call include()/require() (line 14)":
Catagory:Security
include() or analogous function is used with variable arguement. This can be dangerous since variables are in many cases controllable by remote users, and may also be altered or overwritten by mistake. This may lead to undesired behavior, and execution of arbitrary code. It is advisable to use constants instead, in such cases.
EXAMPLE:
Dangerous - $script_path = "/htdocs";
include($script_path."/foo.inc");
Recommended - define('SCRIPT_PATH', "/htdocs");
include(SCRIPT_PATH."/foo.inc");
My question to Smoge and anyone else viewing this post is: Do you think that modifying this script to conform with what the creators of PHP say is the correct syntax and coding will in some way crash or destroy this poorly written script??? If not, I would like to help Smoge make this script more stable for the people using it. I commend him for helping out with a script that obviously was written to get a quick buck and didn't really have any sound developing. I know that it will take more than some of the suggestions given by Zend to make this script right, but I am willing to try. I welcome any comments or suggestions
Bookmarks