Fix Bustage in List Manager, when editing existing item, categories are lost.

This commit is contained in:
psychoticwolf%carolina.rr.com 2004-12-21 11:07:42 +00:00
parent e4fc9508e6
commit 2b7389a5e2
2 changed files with 7 additions and 4 deletions

View File

@ -58,13 +58,15 @@ function escape_string($value)
//Attempt to fix Bug 246743 (strip_tags) and Bug 248242 (htmlentities)
//Remove HTML tags and escape enities from GET/POST vars.
foreach ($_GET as $key => $val) {
$_GET["$key"] = htmlentities(str_replace("\\","",strip_tags($_GET["$key"])));
$_GET["$key"] = htmlentities(str_replace("\\","",strip_tags($_GET["$key"])));
}
foreach ($_POST as $key => $val) {
$_POST["$key"] = htmlentities(str_replace("\\","",strip_tags($_POST["$key"])));
if (!is_array($_POST["$key"])) {
$_POST["$key"] = htmlentities(str_replace("\\","",strip_tags($_POST["$key"])));
}
}
// Bug 250596 Fixes for incoming $_GET variables.

View File

@ -267,6 +267,7 @@ ORDER BY `Type` , `Name` ASC ";
$authors[$v] = $row["UserEmail"];
}
unset($v);
if (!$guid) { $guid = "None"; }
//Make Authors E-Mail Array into a Nice String
$num_authors = count($authors);
@ -298,11 +299,11 @@ ORDER BY `CatName` ASC ";
$categories[$n] = $catid;
}
unset($n);
if (!$categories) {$categories = array(); }
//Get the Category Table Data for the Select Box
$sql = "SELECT `CategoryID`, `CatName` FROM `categories` WHERE `CatType` = '$type' ORDER BY `CatName` ASC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
// $sqlnum = mysql_num_rows($sql_result);
?>
<TD ROWSPAN=8 VALIGN=TOP><SPAN class="global">Categories:</SPAN><BR>&nbsp;&nbsp;&nbsp;&nbsp;<SELECT NAME="categories[]" MULTIPLE="YES" SIZE="10">
<?php