Revision: 1165
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1165&view=rev
Author:   cimorrison
Date:     2009-07-21 16:20:10 +0000 (Tue, 21 Jul 2009)

Log Message:
-----------
Fixed problem with the TargetURL being undefined and causing badly formed HTML 
when Notice errors are turned on.   (However the problem still exists that when 
using HTTP sessions MRBS will redirect to the admin page on login, rather than 
the current page.   I haven't tried to fix this.)

Modified Paths:
--------------
    mrbs/trunk/web/session_http.inc

Modified: mrbs/trunk/web/session_http.inc
===================================================================
--- mrbs/trunk/web/session_http.inc     2009-07-21 15:02:24 UTC (rev 1164)
+++ mrbs/trunk/web/session_http.inc     2009-07-21 16:20:10 UTC (rev 1165)
@@ -68,11 +68,19 @@
 // Print the logon entry on the top banner.
 function PrintLogonBox()
 {
-  global $user_list_link;
-  global $day, $month, $year;
+  global $PHP_SELF, $QUERY_STRING, $user_list_link, $day, $month, $year;
   
+  $TargetURL = basename($PHP_SELF);
+  if (isset($url_base) && ($url_base != ""))
+  {
+    $TargetURL = $url_base . '/' . $TargetURL;
+  }
+  if (isset($QUERY_STRING))
+  {
+    $TargetURL = $TargetURL . "?" . $QUERY_STRING;
+  }
+  
   $user = getUserName();
-
   if (isset($user))
   {
     // words 'you are xxxx' becomes a link to the
@@ -96,7 +104,7 @@
     <a name="logonBox" href=""><?php echo get_vocab('unknown_user'); ?></a>
     <form method="post" action="admin.php">
       <div>
-        <input type="hidden" name="TargetURL" value="<?php echo $TargetURL ?>">
+        <input type="hidden" name="TargetURL" value="<?php echo 
htmlspecialchars($TargetURL) ?>">
         <input type="hidden" name="Action" value="QueryName">
         <input type="submit" value=" <?php echo get_vocab('login') ?> ">
       </div>


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to