From c048e4f9331133f615b88938bd131106c07dc1a9 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Tue, 25 Jan 2005 06:13:36 +0000 Subject: [PATCH] Merged from MOODLE_14_STABLE -- pending merges of shorttag fixes and SC#10 --- lib/ipatlas/ip-atlas_prefs.php | 34 +++++++++++++++++++----- lib/ipatlas/languages/messages.blank.inc | 2 +- lib/ipatlas/languages/messages.it.inc | 2 +- lib/ipatlas/plot.inc | 3 ++- lib/ipatlas/plotconf.inc | 2 +- lib/ipatlas/translate.inc | 2 +- 6 files changed, 33 insertions(+), 12 deletions(-) diff --git a/lib/ipatlas/ip-atlas_prefs.php b/lib/ipatlas/ip-atlas_prefs.php index 139f5cbce6..8c752ae0aa 100644 --- a/lib/ipatlas/ip-atlas_prefs.php +++ b/lib/ipatlas/ip-atlas_prefs.php @@ -3,10 +3,14 @@ include("plotconf.inc"); include("plot.inc"); -if($warnings == "1") { -error_reporting(E_ALL); +if($CFG->debug > 1) { + error_reporting(E_ALL); } else { -error_reporting(E_ERROR); + error_reporting(E_ERROR); +} + +if (isset($HTTP_GET_VARS["lastquery"])){ + $HTTP_GET_VARS["lastquery"] = clean_param($HTTP_GET_VARS["lastquery"], PARAM_HOST); } ?> @@ -19,17 +23,33 @@ error_reporting(E_ERROR); } if(isset($HTTP_POST_VARS["button"])) { + +// cleanup post data +$HTTP_POST_VARS["shape"] = clean_param($HTTP_POST_VARS["shape"], PARAM_ALPHA); +$HTTP_POST_VARS["color"] = clean_param($HTTP_POST_VARS["color"], PARAM_ALPHA); +$HTTP_POST_VARS["color"] = clean_param($HTTP_POST_VARS["size"], PARAM_INT); +$HTTP_POST_VARS["earthimage"] = clean_param($HTTP_POST_VARS["earthimage"], PARAM_FILE); +$HTTP_POST_VARS["cssdot"] = clean_param($HTTP_POST_VARS["cssdot"], PARAM_FILE); +$HTTP_POST_VARS["seldrawmode"] = clean_param($HTTP_POST_VARS["seldrawmode"],PARAM_ALPHA); +// unset the earth image if we don't have it in our list + if (!in_array($HTTP_POST_VARS["earthimage"],$earthimages)) { + unset($HTTP_POST_VARS["earthimage"]); + } + + // save data from the POST setcookie ("atlasprefs", "", time() - 36000000); setcookie ("atlasprefs", "$HTTP_POST_VARS[shape]:$HTTP_POST_VARS[color]:$HTTP_POST_VARS[size]:$HTTP_POST_VARS[earthimage]:$HTTP_POST_VARS[cssdot]:$HTTP_POST_VARS[seldrawmode]", time() + 36000000, $cookiepath); -$setshape = $HTTP_POST_VARS["shape"]; -$setcolor = $HTTP_POST_VARS["color"]; -$setsize = $HTTP_POST_VARS["size"]; +$setshape = $HTTP_POST_VARS["shape"]; +$setcolor = $HTTP_POST_VARS["color"]; +$setsize = $HTTP_POST_VARS["size"]; $setearthimage = $HTTP_POST_VARS["earthimage"]; -$setcssdot = $HTTP_POST_VARS["cssdot"]; +$setcssdot = $HTTP_POST_VARS["cssdot"]; $setseldrawmode = $HTTP_POST_VARS["seldrawmode"]; + + if($setseldrawmode == "1") { $drawmode = "GD"; } else { diff --git a/lib/ipatlas/languages/messages.blank.inc b/lib/ipatlas/languages/messages.blank.inc index 90032c390e..11a5f78b55 100644 --- a/lib/ipatlas/languages/messages.blank.inc +++ b/lib/ipatlas/languages/messages.blank.inc @@ -1,4 +1,4 @@ -