Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
remove legacy mysql_ dependence, remove mysql_close() on non-existant…
… $database_id
  • Loading branch information
DavidGoodwin committed Mar 7, 2014
1 parent 4284458 commit 8ff5105
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions website_code/php/properties/properties_default_engine.php
Expand Up @@ -19,7 +19,7 @@

if(is_numeric($_POST['template_id'])){

$template_id = mysql_real_escape_string($_POST['template_id']);
$template_id = (int) $_POST['template_id'];
$engine = mysql_real_escape_string($_POST['engine']);

if ($engine != 'flash' && $engine!='javascript')
Expand All @@ -46,12 +46,14 @@
{
$extra_flags[] = "engine=" . $engine;
}
$db_entry = join(";", $extra_flags);

$query = "update " . $xerte_toolkits_site->database_table_prefix . "templatedetails SET extra_flags =\"" . str_replace(" ", "_", mysql_real_escape_string($db_entry)) . "\" WHERE template_id =\"" . $template_id . "\"";
$db_entry = str_replace(" ", "_", join(";", $extra_flags)); /* curious as to why we do a str_replace here, but don't seem to 'undo' it when reading above. */

if(mysql_query($query)){
$query = "UPDATE {$xerte_toolkits_site->database_table_prefix}templatedetails SET extra_flags = ? WHERE template_id = ?";
$params = array($db_entry, $template_id);
$ok = db_query($query, $params);

if($ok) {
if ($_REQUEST['page']=='properties')
{
properties_display($xerte_toolkits_site,$template_id,true,"engine");
Expand All @@ -64,8 +66,4 @@
}else{

}

mysql_close($database_id);

}
?>

0 comments on commit 8ff5105

Please sign in to comment.