From cf4b4cea8fa162b259e40bad4f2f73ff224a3425 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Sun, 28 Dec 2014 19:25:50 +0000
Subject: [PATCH] http: Add http_build_query wrapper

This is necessary so we can sanitize/encode inputs.
---
 include/class.http.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/class.http.php b/include/class.http.php
index 3baea958a..d45218051 100644
--- a/include/class.http.php
+++ b/include/class.http.php
@@ -111,5 +111,10 @@ class Http {
             exit;
         }
     }
+
+    static function build_query($vars, $encode=true, $separator='&amp;') {
+        return http_build_query(
+                ($encode ? Format::htmlchars($vars) : $vars), '', $separator);
+    }
 }
 ?>
-- 
GitLab