Changeset:
        3bb3e398e659
        
https://sourceforge.net/p/mrbs/hg-code/ci/3bb3e398e65978a60a23b83caf85348e9994cdf2
Author:
        Campbell Morrison <[email protected]>
Date:
        Sat Oct 22 10:23:53 2016 +0100
Log message:

Tidied up a couple more instances of HTTP_REFERER parsing

diffstat:

 web/js/edit_users.js.php |  5 +----
 web/js/search.js.php     |  2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diffs (27 lines):

diff -r 2960172fd950 -r 3bb3e398e659 web/js/edit_users.js.php
--- a/web/js/edit_users.js.php  Sat Oct 22 09:41:10 2016 +0100
+++ b/web/js/edit_users.js.php  Sat Oct 22 10:23:53 2016 +0100
@@ -29,10 +29,7 @@
   // Use an Ajax source if we can - gives much better performance for large 
tables
   if (function_exists('json_encode'))
   {
-    if (strpos($HTTP_REFERER, '?') !== FALSE)
-    {
-      list( ,$query_string) = explode('?', $HTTP_REFERER, 2);
-    }
+    $query_string = parse_url($HTTP_REFERER, PHP_URL_QUERY);
     $ajax_url = "edit_users.php?" . (empty($query_string) ? '' : 
"$query_string&") . "ajax=1";
     ?>
     tableOptions.ajax = "<?php echo $ajax_url ?>";
diff -r 2960172fd950 -r 3bb3e398e659 web/js/search.js.php
--- a/web/js/search.js.php      Sat Oct 22 09:41:10 2016 +0100
+++ b/web/js/search.js.php      Sat Oct 22 10:23:53 2016 +0100
@@ -55,7 +55,7 @@
     var tableOptions = {};
     <?php
     // Use an Ajax source - gives much better performance for large tables
-    list( ,$query_string) = explode('?', $HTTP_REFERER, 2);
+    $query_string = parse_url($HTTP_REFERER, PHP_URL_QUERY);
     $ajax_url = "search.php?" . (empty($query_string) ? '' : "$query_string&") 
. "ajax=1";
     ?>
     tableOptions.ajax = "<?php echo $ajax_url ?>";

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to