summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/config.inc.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-01-31 16:09:35 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-01-31 16:09:35 +0000
commitd07f777ed2cf0103ed550166f9b0e783db064255 (patch)
treefb331ae19aff60bdf2cea11bd99e34a99f45bc1d /frontends/php/include/config.inc.php
parent78776cf62621df9e12f0b791753174e638440efe (diff)
Getting rid of addslashes.
git-svn-id: svn://svn.zabbix.com/trunk@2592 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/config.inc.php')
-rw-r--r--frontends/php/include/config.inc.php43
1 files changed, 26 insertions, 17 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 85e0077d..437c8b4f 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -690,10 +690,24 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
return $config;
}
+ function show_infomsg()
+ {
+ global $INFO_MSG;
+
+ if(is_array($INFO_MSG))
+ {
+ echo "<p align=center class=\"info\">";
+ while(list($key, $val)=each($INFO_MSG))
+ {
+ echo $val."<br>";
+ }
+ echo "</p>";
+ }
+ }
+
function show_messages($bool=TRUE,$msg=NULL,$errmsg=NULL)
{
global $ERROR_MSG;
- global $INFO_MSG;
if(!$bool)
{
@@ -710,23 +724,18 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
$color="#223344";
}
- echo "<p align=center>";
- echo "<font color='$color'>";
- if(isset($msg))
- echo "<b>[$msg]</b>";
- echo "</font>";
- echo "</p>";
- if(is_array($INFO_MSG))
+ if(isset($msg))
{
- echo "<p align=center class=\"info\">";
- while(list($key, $val)=each($INFO_MSG))
- {
- echo $val."<br>";
- }
+ echo "<p align=center>";
+ echo "<font color='$color'>";
+ echo "<b>[$msg]</b>";
+ echo "</font>";
echo "</p>";
}
+ show_infomsg();
+
if(is_array($ERROR_MSG))
{
echo "<p align=center class=\"error\">";
@@ -1458,7 +1467,7 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
if($files["image"]["error"]==0)
if($files["image"]["size"]<1024*1024)
{
- $image=addslashes(fread(fopen($files["image"]["tmp_name"],"r"),filesize($files["image"]["tmp_name"])));
+ $image=zbx_ads(fread(fopen($files["image"]["tmp_name"],"r"),filesize($files["image"]["tmp_name"])));
$sql="insert into images (name,imagetype,image) values ('$name',$imagetype,'$image')";
return DBexecute($sql);
}
@@ -1482,7 +1491,7 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
if($files["image"]["error"]==0)
if($files["image"]["size"]<1024*1024)
{
- $image=addslashes(fread(fopen($files["image"]["tmp_name"],"r"),filesize($files["image"]["tmp_name"])));
+ $image=zbx_ads(fread(fopen($files["image"]["tmp_name"],"r"),filesize($files["image"]["tmp_name"])));
$sql="update images set name='$name',imagetype='$imagetype',image='$image' where imageid='$imageid'";
return DBexecute($sql);
}
@@ -1797,7 +1806,7 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
{
$ret = 0;
- $description=addslashes($description);
+ $description=zbx_ads($description);
$sql="select * from media_type where description='$description' and mediatypeid!=$mediatypeid";
$result=DBexecute($sql);
if(DBnum_rows($result)>0)
@@ -1823,7 +1832,7 @@ function SDI($msg) { echo "DEBUG INFO: $msg ".BR; } # DEBUG INFO!!!
return 0;
}
- $description=addslashes($description);
+ $description=zbx_ads($description);
$sql="select * from media_type where description='$description'";
$result=DBexecute($sql);
if(DBnum_rows($result)>0)