From: Florent Bruneau Date: Thu, 10 Jul 2008 20:36:12 +0000 (+0200) Subject: Merge branch 0.9.17 X-Git-Tag: core/1.0.0~64 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=4d68bcde441a96abbec1d6c776246c8df323a6b0;p=platal.git Merge branch 0.9.17 Signed-off-by: Florent Bruneau --- diff --git a/modules/core.php b/modules/core.php index dad9b02..e9ece2b 100644 --- a/modules/core.php +++ b/modules/core.php @@ -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(); diff --git a/plugins/modifier.miniwiki.php b/plugins/modifier.miniwiki.php index 9b7418e..d47e221 100644 --- a/plugins/modifier.miniwiki.php +++ b/plugins/modifier.miniwiki.php @@ -19,9 +19,15 @@ * 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: