2008-06-23 Sancho Lerena <slerena@gmail.com>

*  include/functions.php, 
	agent_disk_conf_editor.php: FINALLY, fixed problem with slashes due
	to MAGIC_QUOTES. Some special input will be processed with new 
	function "unsafe_string" that detect MAGIC_QUOTES status and run
	stripslashes over string. Could be interesting to pass over some
	"safe" inputs (on godmode section only), where possible conflicting
	characters like "\" or "" can be passed as parameters.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@895 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2008-06-23 15:50:19 +00:00
parent 2fdf0e435b
commit 1bd3b7c38a
3 changed files with 21 additions and 3 deletions

View File

@ -1,7 +1,13 @@
2008-06-23 Sancho Lerena <slerena@gmail.com>
* include/functions.php,
agent_disk_conf_editor.php: FINALLY, fixed problem with slashes due
to MAGIC_QUOTES. Some special input will be processed with new
function "unsafe_string" that detect MAGIC_QUOTES status and run
stripslashes over string. Could be interesting to pass over some
"safe" inputs (on godmode section only), where possible conflicting
characters like "\" or "" can be passed as parameters.
* pandoradb.sql: Removed table "tquicksession". Not ever used.
* pandoradb_data.sql: Updated Scheme build.

View File

@ -27,7 +27,7 @@ function display_config () {
// Read configuration file
$file_name = $config["remote_config"] . "/" . $agent_md5 . ".conf";
$file = fopen($file_name, "rb");
$agent_config = fread($file, filesize($file_name));
$agent_config = unsafe_string (fread($file, filesize($file_name)));
fclose($file);
// Display it

View File

@ -1151,4 +1151,16 @@ function return_priority ($priority) {
return lang_string ("All");
}
}
/**
* Avoid magic_quotes protection
*
* @param string Text string to be stripped of magic_quotes protection
*/
function unsafe_string ($string){
if (get_magic_quotes_gpc() == 1)
$string = stripslashes ($string);
return $string;
}
?>