Complete rewrite of and , wrapper functions added, see bug #101
[mailer.git] / inc / modules / admin / what-usage.php
index 09da0a61ee5b991fc1c2a9ca447fe2d6f92f20ea..f211bde553b183cea2eb3b8fd52bc1e6c13235a1 100644 (file)
@@ -43,19 +43,19 @@ ADD_DESCR("admin", __FILE__);
 // Base directory (should be moved to database)
 $usage = getConfig('usage_base')."/";
 
-if (!empty($_GET['image'])) {
-       if ($_GET['type'] == "usage") {
+if (REQUEST_ISSET_GET(('image'))) {
+       if (REQUEST_GET('type') == "usage") {
                $FQFN = sprintf("%s%s/usage.png",
                        constant('PATH'),
                        getConfig('usage_base')
                );
        } else {
-               if (strpos($_GET['image'], "\\") > 0) $_GET['image'] = substr($_GET['image'], 0, strpos($_GET['image'], "\\"));
+               if (strpos(REQUEST_GET('image'), "\\") > 0) REQUEST_SET_GET('image', substr(REQUEST_GET('image'), 0, strpos(REQUEST_GET('image'), "\\")));
                $FQFN = sprintf("%s%s/%s_usage_%s.png",
                        constant('PATH'),
                        getConfig('usage_base'),
-                       SQL_ESCAPE($_GET['type']),
-                       SQL_ESCAPE($_GET['image'])
+                       SQL_ESCAPE(REQUEST_GET('type')),
+                       SQL_ESCAPE(REQUEST_GET('image'))
                );
        }
 
@@ -66,7 +66,7 @@ if (!empty($_GET['image'])) {
                imagedestroy($image);
        }
        exit();
-} elseif (empty($_GET['usage'])) {
+} elseif (!REQUEST_ISSET_GET(('usage'))) {
        $FQFN = sprintf("%s%s/index.html",
                constant('PATH'),
                getConfig('usage_base')
@@ -75,7 +75,7 @@ if (!empty($_GET['image'])) {
        $FQFN = sprintf("%s%s/usage_%s.html",
                constant('PATH'),
                getConfig('usage_base'),
-               SQL_ESCAPE($_GET['usage'])
+               SQL_ESCAPE(REQUEST_GET('usage'))
        );
 }