Revision: 887
http://cs-project.svn.sourceforge.net/cs-project/?rev=887&view=rev
Author: crazedsanity
Date: 2008-05-05 17:05:37 -0700 (Mon, 05 May 2008)
Log Message:
-----------
Fix for broken redirect on helpdesk search (#183).
AFFECTS ISSUES:
#183: Search on helpdesk broken?
Redirects broken, probably when AJAX was added (since it POSTs). Precheck that
the ID is numeric before setting $urlExtrasArr... also, if the urlSection is
"view", and ID isn't set, call conditional_header() to go back to the main
helpdesk page.
Modified Paths:
--------------
trunk/1.2/includes/content/helpdesk.inc
Modified: trunk/1.2/includes/content/helpdesk.inc
===================================================================
--- trunk/1.2/includes/content/helpdesk.inc 2008-05-05 16:14:13 UTC (rev 886)
+++ trunk/1.2/includes/content/helpdesk.inc 2008-05-06 00:05:37 UTC (rev 887)
@@ -16,9 +16,11 @@
$helpdeskId = $_POST['id'];
$baseUrl = "/content/helpdesk";
$urlSection = "view";
- $urlExtrasArr = array(
- "ID" => $helpdeskId
- );
+ if(is_numeric($helpdeskId)) {
+ $urlExtrasArr = array(
+ "ID" => $helpdeskId
+ );
+ }
$byPassUrlExtras = FALSE;
if($action) {
@@ -180,8 +182,10 @@
$url = $baseUrl;
//don't bother redirecting to the "view" page if the ID isn't valid.
- if(preg_match('/view/', $urlSection) && !is_numeric($urlExtrasArr['ID']) && $byPassUrlExtras === FALSE) {
+ if(preg_match('/view/', $urlSection) && !is_numeric($urlExtrasArr['ID'])) {
unset($urlSection);
+ conditional_header('/content/helpdesk');
+ exit;
}
else {
if(isset($urlSection) && !preg_match('/\?/', $url)) {
@@ -199,6 +203,7 @@
conditional_header($url);
exit;
}
+ exit;
}
else {
$helpdeskId = $_GET['ID'];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|