Merge branch 0.9.17
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 10 Jul 2008 20:36:12 +0000 (22:36 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 10 Jul 2008 20:36:12 +0000 (22:36 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
modules/core.php
plugins/modifier.miniwiki.php

index dad9b02..e9ece2b 100644 (file)
@@ -125,8 +125,20 @@ class CoreModule extends PLModule
     function handler_bug(&$page)
     {
         global $globals;
+
+        if (empty($_SERVER['HTTP_REFERER'])) {
+            // We don't have a valid referer, we need to use the url
+            list($currentPage, $location) = explode('//', $_SERVER['REQUEST_URI'], 2);
+
+            $location = 'http'.(empty($_SERVER['HTTPS']) ? '' : 's').'://'.$_SERVER['SERVER_NAME'].'/'.$location;
+        } else {
+            $location = $_SERVER['HTTP_REFERER'];
+        }
+
         $page->changeTpl('core/bug.tpl', SIMPLE);
+        $page->assign('location', $location);
         $page->addJsLink('close_on_esc.js');
+
         if (Env::has('send') && trim(Env::v('detailed_desc'))) {
             S::assert_xsrf_token();
 
index 9b7418e..d47e221 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-function smarty_modifier_miniwiki($string, $format = 'no_title')
+require_once 'platal.inc.php';
+
+function smarty_modifier_miniwiki($string, $format = 'no_title', $type = 'html')
 {
-    return MiniWiki::wikiToHTML($string, $format == 'title');
+    if ($type == 'html') {
+        return MiniWiki::wikiToHTML($string, $format == 'title');
+    } else {
+        return MiniWiki::wikiToText($string, false, 0, 80, $format == 'title');
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: