summaryrefslogtreecommitdiff
path: root/inc/pageutils.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-11-30 12:30:40 +0100
committerAndreas Gohr <andi@splitbrain.org>2012-11-30 12:30:40 +0100
commitd14415e37072dbe16077efd700aee5bd33707b54 (patch)
tree062c3c190039ac9490f56598b0ee116de18c2480 /inc/pageutils.php
parent2ed38036a53a489d2fcadc46ce601f8c876fca31 (diff)
parent38479cbba628ee76a92ff5f3c974cfa8e6ce9e61 (diff)
downloadrpg-d14415e37072dbe16077efd700aee5bd33707b54.tar.gz
rpg-d14415e37072dbe16077efd700aee5bd33707b54.tar.bz2
Merge branch 'master' into subscription
* master: (175 commits) some coding style improvements added .idea project folder to gitignore use correct setUp method and parent calls. Correct German plugin manager translation (download != install) correct return in sendDigest() Fix case-insensitive match in ACL checking GeSHi update to 1.0.8.11 ignore empty header on mail sending remove empty BCC/CC mail headers Galician language update some welcome page changes Combine subsequent calls to strtr into a single transformation changed semicolon to colon in link to welcome page to make it less confusing fixed wrong sidebar showing in namespaces when sidebar is disabled Typo fix for TL;DR removed a bunch of outdated and irrelevant networking acronyms added another place to look for logo to make it more consistent (FS#2656) French language update Czech language update compat js findPosX/y more closely mimic historical function ... Conflicts: inc/auth.php inc/common.php inc/subscription.php lib/exe/indexer.php
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r--inc/pageutils.php29
1 files changed, 20 insertions, 9 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php
index d6abff894..ca4936a82 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -115,11 +115,10 @@ function cleanID($raw_id,$ascii=false,$media=false){
$id = utf8_strtolower($id);
//alternative namespace seperator
- $id = strtr($id,';',':');
if($conf['useslash']){
- $id = strtr($id,'/',':');
+ $id = strtr($id,';/','::');
}else{
- $id = strtr($id,'/',$sepchar);
+ $id = strtr($id,';/',':'.$sepchar);
}
if($conf['deaccent'] == 2 || $ascii) $id = utf8_romanize($id);
@@ -199,7 +198,8 @@ function noNSorNS($id) {
* Creates a XHTML valid linkid from a given headline title
*
* @param string $title The headline title
- * @param array $check Existing IDs (title => number)
+ * @param array|bool $check Existing IDs (title => number)
+ * @return string the title
* @author Andreas Gohr <andi@splitbrain.org>
*/
function sectionID($title,&$check) {
@@ -535,15 +535,25 @@ function getCacheName($data,$ext=''){
* @author Andreas Gohr <gohr@cosmocode.de>
*/
function isHiddenPage($id){
+ $data = array(
+ 'id' => $id,
+ 'hidden' => false
+ );
+ trigger_event('PAGEUTILS_ID_HIDEPAGE', $data, '_isHiddenPage');
+ return $data['hidden'];
+}
+
+function _isHiddenPage(&$data) {
global $conf;
global $ACT;
- if(empty($conf['hidepages'])) return false;
- if($ACT == 'admin') return false;
- if(preg_match('/'.$conf['hidepages'].'/ui',':'.$id)){
- return true;
+ if ($data['hidden']) return;
+ if(empty($conf['hidepages'])) return;
+ if($ACT == 'admin') return;
+
+ if(preg_match('/'.$conf['hidepages'].'/ui',':'.$data['id'])){
+ $data['hidden'] = true;
}
- return false;
}
/**
@@ -634,6 +644,7 @@ function utf8_decodeFN($file){
* @return string|false the full page id of the found page, false if any
*/
function page_findnearest($page){
+ if (!$page) return false;
global $ID;
$ns = $ID;