Changeset:
6960bb033647
https://sourceforge.net/p/mrbs/hg-code/ci/6960bb03364720a843f41e4ffffb405e1f0564f8
Author:
Campbell Morrison <[email protected]>
Date:
Tue Mar 28 17:24:39 2017 +0100
Log message:
Rewrote the code for getting $returl - see SF Bugs #383
diffstat:
web/edit_entry_handler.php | 32 ++++++++++++++++++++------------
1 files changed, 20 insertions(+), 12 deletions(-)
diffs (50 lines):
diff -r 53347eb130d1 -r 6960bb033647 web/edit_entry_handler.php
--- a/web/edit_entry_handler.php Tue Mar 21 10:28:36 2017 +0000
+++ b/web/edit_entry_handler.php Tue Mar 28 17:24:39 2017 +0100
@@ -575,26 +575,34 @@
// (2) Avoid an endless loop. It shouldn't happen, but just in case ...
// (3) If you've come from search, you probably don't want to go back there
(and if you did we'd
// have to preserve the search parameter in the query string)
-$returl_base = explode('?', basename($returl));
-if (empty($returl) || ($returl_base[0] == "edit_entry.php") ||
($returl_base[0] == "edit_entry_handler.php")
- || ($returl_base[0] == "search.php"))
+if (isset($returl) && ($returl !== ''))
+{
+ $returl = parse_url($returl, PHP_URL_PATH);
+ if ($returl !== false)
+ {
+ $returl = explode('/', $returl);
+ $returl = end($returl);
+ }
+}
+
+if (empty($returl) ||
+ in_array($returl, array('edit_entry.php',
+ 'edit_entry_handler.php',
+ 'search.php')))
{
switch ($default_view)
{
- case "month":
- $returl = "month.php";
+ case 'month':
+ $returl = 'month.php';
break;
- case "week":
- $returl = "week.php";
+ case 'week':
+ $returl = 'week.php';
break;
default:
- $returl = "day.php";
+ $returl = 'day.php';
+ break;
}
}
-else
-{
- $returl = $returl_base[0];
-}
// If we haven't been given a sensible date then get out of here and don't try
and make a booking
------------------------------------------------------------------------------
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