From 4871414204799044c31aa2764c4b4ca020e2331d Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Fri, 26 Nov 2010 16:54:51 +0100 Subject: Fix for $conf['breadcrumbs'] < 0, FS#2107 This fixes an infinite loop in breadcrumbs() and makes the behaviors in all places where breadcrumbs are used consistent so that non-numeric values, values < 0 and 0 are treated the same way. --- inc/common.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index 18f782788..667846804 100644 --- a/inc/common.php +++ b/inc/common.php @@ -268,6 +268,9 @@ function breadcrumbs(){ global $ACT; global $conf; + // Prevent infinite loop later in this function + if (!is_numeric($conf['breadcrumbs']) || $conf['breadcrumbs'] <= 0) return array(); + //first visit? $crumbs = isset($_SESSION[DOKU_COOKIE]['bc']) ? $_SESSION[DOKU_COOKIE]['bc'] : array(); //we only save on show and existing wiki documents -- cgit v1.2.3 From e3776c06c37cc197709dac60892604dfea894ac2 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Mon, 29 Nov 2010 01:34:36 +0100 Subject: Remove enc=utf-8 in VIM modeline as it is not allowed in VIM 7.3 As of VIM 7.3 it is no longer possible to specify the encoding in the modeline. This gives an error message whenever such a file is opened, thus this commit removes the enc setting from the modeline. --- inc/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index 667846804..b6048825b 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1541,4 +1541,4 @@ function valid_input_set($param, $valid_values, $array, $exc = '') { } } -//Setup VIM: ex: et ts=2 enc=utf-8 : +//Setup VIM: ex: et ts=2 : -- cgit v1.2.3 From 359fab8b2f7d0847ef0cf9b669e6c8ffb0687525 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Tue, 30 Nov 2010 18:34:10 +0100 Subject: Revert "Fix for $conf['breadcrumbs'] < 0, FS#2107", new fix This reverts commit 4871414204799044c31aa2764c4b4ca020e2331d. Additionally there is a new fix for FS#2107 that doesn't introduce a lot of checks but instead ensures that the configuration option can't be set to negative values when the configuration manager is used. --- inc/common.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index b6048825b..a1c4580a6 100644 --- a/inc/common.php +++ b/inc/common.php @@ -268,9 +268,6 @@ function breadcrumbs(){ global $ACT; global $conf; - // Prevent infinite loop later in this function - if (!is_numeric($conf['breadcrumbs']) || $conf['breadcrumbs'] <= 0) return array(); - //first visit? $crumbs = isset($_SESSION[DOKU_COOKIE]['bc']) ? $_SESSION[DOKU_COOKIE]['bc'] : array(); //we only save on show and existing wiki documents -- cgit v1.2.3 From 5526795c71a703486ddd19bf986e6a0cf7309945 Mon Sep 17 00:00:00 2001 From: Guy Brand Date: Fri, 31 Dec 2010 15:46:43 +0100 Subject: Allow a prefix for subject of sent mails (Close FS#2021) --- inc/common.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index a1c4580a6..6ea6d56d8 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1128,12 +1128,15 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ $diff = rawWiki($id); } $text = str_replace('@DIFF@',$diff,$text); - if(utf8_strlen($conf['title']) < 20) { - $subject = '['.$conf['title'].'] '.$subject; + if(empty($conf['mailprefix'])) { + if(utf8_strlen($conf['title']) < 20) { + $subject = '['.$conf['title'].'] '.$subject; + }else{ + $subject = '['.utf8_substr($conf['title'], 0, 20).'...] '.$subject; + } }else{ - $subject = '['.utf8_substr($conf['title'], 0, 20).'...] '.$subject; + $subject = '['.$conf['mailprefix'].'] '.$subject; } - mail_send($to,$subject,$text,$conf['mailfrom'],'',$bcc); } -- cgit v1.2.3 From 9063ec149f164f26e583c635f4fa29dcba23eb90 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Wed, 12 Jan 2011 13:09:23 +0100 Subject: Remove trailing whitespace in buildAttributes output --- inc/common.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index 6ea6d56d8..b4866bccf 100644 --- a/inc/common.php +++ b/inc/common.php @@ -242,13 +242,16 @@ function buildURLparams($params, $sep='&'){ */ function buildAttributes($params,$skipempty=false){ $url = ''; + $white = false; foreach($params as $key => $val){ if($key{0} == '_') continue; if($val === '' && $skipempty) continue; + if($white) $url .= ' '; $url .= $key.'="'; $url .= htmlspecialchars ($val); - $url .= '" '; + $url .= '"'; + $white = true; } return $url; } -- cgit v1.2.3