From: <var...@us...> - 2014-11-21 16:51:12
|
Revision: 9362 http://sourceforge.net/p/phpwiki/code/9362 Author: vargenau Date: 2014-11-21 16:51:08 +0000 (Fri, 21 Nov 2014) Log Message: ----------- SUBPAGE_SEPARATOR *must* be "/" Modified Paths: -------------- trunk/config/config-default.ini trunk/config/config-dist.ini trunk/configurator.php trunk/lib/IniConfig.php trunk/lib/InlineParser.php trunk/lib/PageType.php trunk/lib/WikiTheme.php trunk/lib/WikiUser/HttpAuth.php trunk/lib/WikiUser/HttpAuthUpper.php trunk/lib/display.php trunk/lib/plugin/BlogArchives.php trunk/lib/plugin/BlogJournal.php trunk/lib/plugin/Calendar.php trunk/lib/plugin/CalendarList.php trunk/lib/plugin/CreatePage.php trunk/lib/plugin/GraphViz.php trunk/lib/plugin/ListSubpages.php trunk/lib/plugin/TranslateText.php trunk/lib/plugin/UnfoldSubpages.php trunk/lib/plugin/VisualWiki.php trunk/lib/plugin/WikiBlog.php trunk/lib/stdlib.php trunk/tests/unit/lib/TextSearchTest.php trunk/themes/Crao/templates/head.tmpl trunk/themes/Crao/templates/navbar.tmpl trunk/themes/MonoBook/templates/actionbar.tmpl trunk/themes/Sidebar/templates/calendar.tmpl trunk/themes/Wordpress/templates/actionbar.tmpl trunk/themes/blog/templates/sidebar.tmpl trunk/themes/default/templates/head.tmpl trunk/themes/default/templates/homepage.tmpl trunk/themes/default/templates/navbar.tmpl trunk/themes/fusionforge/templates/actionbar.tmpl trunk/themes/wikilens/templates/head.tmpl trunk/themes/wikilens/templates/navbar.tmpl Modified: trunk/config/config-default.ini =================================================================== --- trunk/config/config-default.ini 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/config/config-default.ini 2014-11-21 16:51:08 UTC (rev 9362) @@ -135,7 +135,6 @@ ALLOWED_PROTOCOLS = "http|https|mailto|ftp|news|nntp|ssh|gopher" INLINE_IMAGES = "png|jpg|jpeg|gif|swf" WIKI_NAME_REGEXP = "(?<![[:alnum:]])(?:[[:upper:]][[:lower:][:digit:]]+){2,}(?![[:alnum:]])" -SUBPAGE_SEPARATOR = "/" INTERWIKI_MAP_FILE = lib/interwiki.map WARN_NONPUBLIC_INTERWIKIMAP = false KEYWORDS = "Category* OR Topic*" Modified: trunk/config/config-dist.ini =================================================================== --- trunk/config/config-dist.ini 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/config/config-dist.ini 2014-11-21 16:51:08 UTC (rev 9362) @@ -959,9 +959,6 @@ ; Default old behaviour, no digits as lowerchars. ;WIKI_NAME_REGEXP = "(?<![[:alnum:]])(?:[[:upper:]][[:lower:]]+){2,}(?![[:alnum:]])" -; Defaults to '/', but '.' was also used. -;SUBPAGE_SEPARATOR = / - ; InterWiki linking -- wiki-style links to other wikis on the web ; ; The map will be taken from a page name InterWikiMap. Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/configurator.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -1343,12 +1343,6 @@ Perl regexp for WikiNames (\"bumpy words\") (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well"); -$properties["Subpage Separator"] = - new _define_optional('SUBPAGE_SEPARATOR', '"/"', " -One character which separates pages from subpages. Defaults to '/', but '.' or ':' were also used.", - "onchange=\"validate_ereg('Sorry, \'%s\' must be a single character. Currently only :, / or .', '^[/:.]$', 'SUBPAGE_SEPARATOR', this);\"" - ); - $properties["InterWiki Map File"] = new _define('INTERWIKI_MAP_FILE', 'lib/interwiki.map', " InterWiki linking -- wiki-style links to other wikis on the web Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/IniConfig.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -150,7 +150,7 @@ 'GROUP_METHOD', 'EDITING_POLICY', 'THEME', 'WIKI_PGSRC', 'DEFAULT_WIKI_PGSRC', - 'ALLOWED_PROTOCOLS', 'INLINE_IMAGES', 'SUBPAGE_SEPARATOR', /*'KEYWORDS',*/ + 'ALLOWED_PROTOCOLS', 'INLINE_IMAGES', /*'KEYWORDS',*/ // extra logic: //'DATABASE_PREFIX', 'DATABASE_DSN', 'DATABASE_TYPE', 'DATABASE_DBHANDLER', 'DATABASE_OPTIMISE_FREQUENCY', Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/InlineParser.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -350,14 +350,9 @@ /* Relatives links by Joel Schaubert. * Recognize [../bla] or [/bla] as relative links, without needing http:// - * but [ /link ] only if SUBPAGE_SEPERATOR is not "/". * Normally /Page links to the subpage /Page. */ - if (SUBPAGE_SEPARATOR == '/') { - if (preg_match('/^\.\.\//', $link)) { - return new Cached_ExternalLink($link, $label); - } - } elseif (preg_match('/^(\.\.\/|\/)/', $link)) { + if (preg_match('/^\.\.\//', $link)) { return new Cached_ExternalLink($link, $label); } Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/PageType.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -286,10 +286,10 @@ if (empty($map["Talk"])) { $pagename = $GLOBALS['request']->getArg('pagename'); // against PageName/Discussion/Discussion - if (string_ends_with($pagename, SUBPAGE_SEPARATOR . _("Discussion"))) + if (string_ends_with($pagename, '/' . _("Discussion"))) $map["Talk"] = "%s"; else - $map["Talk"] = "%s" . SUBPAGE_SEPARATOR . _("Discussion"); + $map["Talk"] = "%s" . '/' . _("Discussion"); } foreach (array('Upload', 'User', 'Talk') as $special) { Modified: trunk/lib/WikiTheme.php =================================================================== --- trunk/lib/WikiTheme.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/WikiTheme.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -103,21 +103,21 @@ // Todo: test external ImageLinks http://some/images/next.gif if (is_a($wikipage, 'WikiPageName') and !$label and - strchr(substr($wikipage->shortName, 1), SUBPAGE_SEPARATOR) + strchr(substr($wikipage->shortName, 1), '/') ) { - $parts = explode(SUBPAGE_SEPARATOR, $wikipage->shortName); + $parts = explode('/', $wikipage->shortName); $last_part = array_pop($parts); $sep = ''; $link = HTML::span(); foreach ($parts as $part) { $path[] = $part; - $parent = join(SUBPAGE_SEPARATOR, $path); + $parent = join('/', $path); if ($WikiTheme->_autosplitWikiWords) $part = " " . $part; if ($part) $link->pushContent($WikiTheme->linkExistingWikiWord($parent, $sep . $part)); $sep = $WikiTheme->_autosplitWikiWords - ? ' ' . SUBPAGE_SEPARATOR : SUBPAGE_SEPARATOR; + ? ' ' . '/' : '/'; } if ($exists) $link->pushContent($WikiTheme->linkExistingWikiWord($wikipage, $sep . $last_part, @@ -1549,7 +1549,7 @@ function calendarLink($date = false) { - return $this->calendarBase() . SUBPAGE_SEPARATOR . + return $this->calendarBase() . '/' . strftime("%Y-%m-%d", $date ? $date : time()); } @@ -1560,10 +1560,10 @@ if (!$UserCalPageTitle) $UserCalPageTitle = $request->_user->getId() . - SUBPAGE_SEPARATOR . _("Calendar"); + '/' . _("Calendar"); if (!$UserCalPageTitle) $UserCalPageTitle = (BLOG_EMPTY_DEFAULT_PREFIX ? '' - : ($request->_user->getId() . SUBPAGE_SEPARATOR)) . "Blog"; + : ($request->_user->getId() . '/')) . "Blog"; return $UserCalPageTitle; } @@ -1590,7 +1590,7 @@ // Get existing date entries for the current user require_once 'lib/TextSearchQuery.php'; - $iter = $dbi->titleSearch(new TextSearchQuery("^" . $this->calendarBase() . SUBPAGE_SEPARATOR, true, "auto")); + $iter = $dbi->titleSearch(new TextSearchQuery("^" . $this->calendarBase() . '/', true, "auto")); $existing = array(); while ($page = $iter->next()) { if ($page->exists()) Modified: trunk/lib/WikiUser/HttpAuth.php =================================================================== --- trunk/lib/WikiUser/HttpAuth.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/WikiUser/HttpAuth.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -118,8 +118,8 @@ ) { // allow domain\user, change userid to domain/user $username = str_ireplace("\\\\", "\\", $username); // php bug with _SERVER - $username = str_ireplace("\\", SUBPAGE_SEPARATOR, $username); - $this->_userid = str_ireplace("\\", SUBPAGE_SEPARATOR, $this->_userid); + $username = str_ireplace("\\", '/', $username); + $this->_userid = str_ireplace("\\", '/', $this->_userid); } // FIXME: if AUTH_TYPE = NTLM there's a domain\\name <> domain\name mismatch if (empty($username) Modified: trunk/lib/WikiUser/HttpAuthUpper.php =================================================================== --- trunk/lib/WikiUser/HttpAuthUpper.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/WikiUser/HttpAuthUpper.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -132,8 +132,8 @@ ) { // allow domain\user, change userid to domain/user $username = str_ireplace("\\\\", "\\", $username); // php bug with _SERVER - $username = str_ireplace("\\", SUBPAGE_SEPARATOR, $username); - $this->_userid = str_ireplace("\\", SUBPAGE_SEPARATOR, $this->_userid); + $username = str_ireplace("\\", '/', $username); + $this->_userid = str_ireplace("\\", '/', $this->_userid); } // FIXME: if AUTH_TYPE = NTLM there's a domain\\name <> domain\name mismatch if (empty($username) Modified: trunk/lib/display.php =================================================================== --- trunk/lib/display.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/display.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -265,19 +265,19 @@ } if (isSubPage($pagename)) { - $pages = explode(SUBPAGE_SEPARATOR, $pagename); + $pages = explode('/', $pagename); $last_page = array_pop($pages); // deletes last element from array as side-effect $pageheader = HTML::span(HTML::a(array('href' => WikiURL($pages[0]), 'class' => 'pagetitle' ), - $WikiTheme->maybeSplitWikiWord($pages[0] . SUBPAGE_SEPARATOR))); - $first_pages = $pages[0] . SUBPAGE_SEPARATOR; + $WikiTheme->maybeSplitWikiWord($pages[0] . '/'))); + $first_pages = $pages[0] . '/'; array_shift($pages); foreach ($pages as $p) { $pageheader->pushContent(HTML::a(array('href' => WikiURL($first_pages . $p), 'class' => 'backlinks'), - $WikiTheme->maybeSplitWikiWord($p . SUBPAGE_SEPARATOR))); - $first_pages .= $p . SUBPAGE_SEPARATOR; + $WikiTheme->maybeSplitWikiWord($p . '/'))); + $first_pages .= $p . '/'; } $backlink = HTML::a(array('href' => WikiURL($pagename, array('action' => __("BackLinks"))), Modified: trunk/lib/plugin/BlogArchives.php =================================================================== --- trunk/lib/plugin/BlogArchives.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/plugin/BlogArchives.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -82,7 +82,7 @@ else $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages } - $parent = (empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR); + $parent = (empty($args['user']) ? '' : $args['user'] . '/'); //$info = explode(',', $args['info']); //$pagelist = new PageList($args['info'], $args['exclude'], $args); @@ -90,7 +90,7 @@ // unset($pagelist->_columns['pagename']); if (!empty($args['month'])) { - $prefix = $parent . $this->blogPrefix('wikiblog') . SUBPAGE_SEPARATOR . $args['month']; + $prefix = $parent . $this->blogPrefix('wikiblog') . '/' . $args['month']; $pages = $dbi->titleSearch(new TextSearchQuery("^" . $prefix, true, 'posix')); $html = HTML::ul(); while ($page = $pages->next()) { Modified: trunk/lib/plugin/BlogJournal.php =================================================================== --- trunk/lib/plugin/BlogJournal.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/plugin/BlogJournal.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -79,12 +79,12 @@ $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages } } - $parent = (empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR); + $parent = (empty($args['user']) ? '' : $args['user'] . '/'); $prefix = $base = $parent . $this->blogPrefix('wikiblog'); if ($args['month']) - $prefix .= (SUBPAGE_SEPARATOR . $args['month']); - $pages = $dbi->titleSearch(new TextSearchQuery("^" . $prefix . SUBPAGE_SEPARATOR, true, 'posix')); + $prefix .= ('/' . $args['month']); + $pages = $dbi->titleSearch(new TextSearchQuery("^" . $prefix . '/', true, 'posix')); $html = HTML(); $i = 0; while (($page = $pages->next()) and $i < $args['count']) { Modified: trunk/lib/plugin/Calendar.php =================================================================== --- trunk/lib/plugin/Calendar.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/plugin/Calendar.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -46,7 +46,7 @@ function getDefaultArguments() { - return array('prefix' => '[pagename]' . SUBPAGE_SEPARATOR, + return array('prefix' => '[pagename]' . '/', 'date_format' => '%Y-%m-%d', 'year' => '', 'month' => '', Modified: trunk/lib/plugin/CalendarList.php =================================================================== --- trunk/lib/plugin/CalendarList.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/plugin/CalendarList.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -106,7 +106,7 @@ for ($i = 0; $i <= 180; $i++) { // loop thru 180 days, past or future $date_string = strftime($args['date_format'], $t); - $page_for_date = $args['prefix'] . SUBPAGE_SEPARATOR . $date_string; + $page_for_date = $args['prefix'] . '/' . $date_string; if ($dbi->isWikiPage($page_for_date)) { // if this date has any comments/events $timeTMP = $t; // capture the date of this event for return if ($n-- <= 0) break; // if we reached the limit, return the date @@ -123,7 +123,7 @@ $args = &$this->args; $date_string = strftime($args['date_format'], $time); - $page_for_date = $args['prefix'] . SUBPAGE_SEPARATOR . $date_string; + $page_for_date = $args['prefix'] . '/' . $date_string; if ($dbi->isWikiPage($page_for_date)) { // Extract the page contents for this date Modified: trunk/lib/plugin/CreatePage.php =================================================================== --- trunk/lib/plugin/CreatePage.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/plugin/CreatePage.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -71,7 +71,7 @@ if (!$s) { return $this->error(_("Cannot create page with empty name!")); } - // TODO: javascript warning if "/" or SUBPAGE_SEPARATOR in s + // TODO: javascript warning if "/" in s if ($verify) { $head = _("CreatePage failed"); if ($dbi->isWikiPage($verify)) { Modified: trunk/lib/plugin/GraphViz.php =================================================================== --- trunk/lib/plugin/GraphViz.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/plugin/GraphViz.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -216,7 +216,7 @@ $source = "digraph GraphViz {\n"; // } foreach ($argarray['pages'] as $name) { // support <!plugin-list !> pagelists // allow Page/SubPage - $url = str_replace(urlencode(SUBPAGE_SEPARATOR), SUBPAGE_SEPARATOR, + $url = str_replace(urlencode('/'), '/', rawurlencode($name)); $source .= " \"$name\" [URL=\"$url\"];\n"; } Modified: trunk/lib/plugin/ListSubpages.php =================================================================== --- trunk/lib/plugin/ListSubpages.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/plugin/ListSubpages.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -71,7 +71,7 @@ // FIXME: explodePageList from stdlib doesn't seem to work as // expected when there are no subpages. (see also // UnfoldSubPages plugin) - $subpages = explodePageList($pagename . SUBPAGE_SEPARATOR . '*'); + $subpages = explodePageList($pagename . '/' . '*'); if (!$subpages) { return HTML::p(array('class' => 'warning'), sprintf(_("%s has no subpages defined."), $pagename)); Modified: trunk/lib/plugin/TranslateText.php =================================================================== --- trunk/lib/plugin/TranslateText.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/plugin/TranslateText.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -82,7 +82,7 @@ //save translation in a users subpage $user = $request->getUser(); $homepage = $user->_HomePagehandle; - $transpagename = $homepage->getName() . SUBPAGE_SEPARATOR . _("ContributedTranslations"); + $transpagename = $homepage->getName() . '/' . _("ContributedTranslations"); $page = $dbi->getPage($transpagename); $current = $page->getCurrentRevision(); Modified: trunk/lib/plugin/UnfoldSubpages.php =================================================================== --- trunk/lib/plugin/UnfoldSubpages.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/plugin/UnfoldSubpages.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -82,7 +82,7 @@ $args = $this->getArgs($argstr, $request); extract($args); - $query = new TextSearchQuery($pagename . SUBPAGE_SEPARATOR . '*', true, 'glob'); + $query = new TextSearchQuery($pagename . '/' . '*', true, 'glob'); $subpages = $dbi->titleSearch($query, $sortby, $limit, $exclude); //if ($sortby) // $subpages = $subpages->applyFilters(array('sortby' => $sortby, 'limit' => $limit, 'exclude' => $exclude)); @@ -156,7 +156,7 @@ array_push($included_pages, $cpagename); if ($smalltitle) { - $pname = array_pop(explode(SUBPAGE_SEPARATOR, $cpagename)); // get last subpage name + $pname = array_pop(explode('/', $cpagename)); // get last subpage name // Use _("%s: %s") instead of .": ". for French punctuation $ct = TransformText(sprintf(_("%s: %s"), "[$pname|$cpagename]", $ct), $cpagename); Modified: trunk/lib/plugin/VisualWiki.php =================================================================== --- trunk/lib/plugin/VisualWiki.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/plugin/VisualWiki.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -449,7 +449,7 @@ $url = rawurlencode($name); // patch to allow Page/SubPage - $url = str_replace(urlencode(SUBPAGE_SEPARATOR), SUBPAGE_SEPARATOR, $url); + $url = str_replace(urlencode('/'), '/', $url); $nodename = ($label != 'name' ? $nametonumber[$name] + 1 : $name); $dot .= " \"$nodename\" [URL=\"$url\""; Modified: trunk/lib/plugin/WikiBlog.php =================================================================== --- trunk/lib/plugin/WikiBlog.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/plugin/WikiBlog.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -154,7 +154,7 @@ $prefix = ""; $parent = ''; // 'Forum'; } else { - $prefix = $parent . SUBPAGE_SEPARATOR; + $prefix = $parent . '/'; } //$request->finish(fmt("No pagename specified for %s",$type)); @@ -231,7 +231,7 @@ ); SavePage($request, $pageinfo, '', ''); } - $redirected = $prefix . $pagename . SUBPAGE_SEPARATOR . preg_replace("/T.*/", "", "$time"); + $redirected = $prefix . $pagename . '/' . preg_replace("/T.*/", "", "$time"); if (!$dbi->isWikiPage($redirected)) { if (!$parent) $parent = HOME_PAGE; require_once 'lib/loadsave.php'; @@ -243,8 +243,8 @@ SavePage($request, $pageinfo, '', ''); } - $p = $dbi->getPage($prefix . $pagename . SUBPAGE_SEPARATOR - . str_replace("T", SUBPAGE_SEPARATOR, "$time")); + $p = $dbi->getPage($prefix . $pagename . '/' + . str_replace("T", '/', "$time")); $pr = $p->getCurrentRevision(); // Version should be zero. If not, page already exists @@ -340,7 +340,7 @@ { $prefix = (empty($basepage) ? "" - : $basepage . SUBPAGE_SEPARATOR) . $this->blogPrefix($type); + : $basepage . '/') . $this->blogPrefix($type); $pages = $dbi->titleSearch(new TextSearchQuery('"' . $prefix . '"', true, 'none')); $blogs = array(); Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/lib/stdlib.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -827,7 +827,7 @@ // expand Talk or User, but not to absolute urls! if (strstr($url, '//')) { if ($moniker == 'Talk') - $name = $name . SUBPAGE_SEPARATOR . _("Discussion"); + $name = $name . '/' . _("Discussion"); } else { $name = $url; } @@ -835,7 +835,7 @@ } } // FIXME: We should really fix the cause for "/PageName" in the WikiDB - if ($name == '' or $name[0] == SUBPAGE_SEPARATOR) { + if ($name == '' or $name[0] == '/') { if ($basename) $name = $this->_pagename($basename) . $name; else { @@ -860,7 +860,7 @@ function getParent() { $name = $this->name; - if (!($tail = strrchr($name, SUBPAGE_SEPARATOR))) + if (!($tail = strrchr($name, '/'))) return false; return substr($name, 0, -strlen($tail)); } @@ -906,8 +906,8 @@ global $request; return $request->getArg('pagename'); } - assert($name[0] == SUBPAGE_SEPARATOR); - $this->_errors[] = sprintf(_("Leading %s not allowed"), SUBPAGE_SEPARATOR); + assert($name[0] == '/'); + $this->_errors[] = sprintf(_("Leading %s not allowed"), '/'); return substr($name, 1); } @@ -936,10 +936,10 @@ $pagename = trim($pagename); $orig = $pagename; - while ($pagename and $pagename[0] == SUBPAGE_SEPARATOR) + while ($pagename and $pagename[0] == '/') $pagename = substr($pagename, 1); if ($pagename != $orig) - $this->_errors[] = sprintf(_("Leading %s not allowed"), SUBPAGE_SEPARATOR); + $this->_errors[] = sprintf(_("Leading %s not allowed"), '/'); // ";" is urlencoded, so safe from php arg-delim problems /*if (strstr($pagename, ';')) { @@ -1026,7 +1026,7 @@ $RE[] = '/([[:lower:]])((?<!Mc|Di)[[:upper:]]|\d)/'; break; } - $sep = preg_quote(SUBPAGE_SEPARATOR, '/'); + $sep = preg_quote('/', '/'); // This the single-letter words 'I' and 'A' from any following // capitalized words. switch ($GLOBALS['LANG']) { @@ -1585,12 +1585,12 @@ function isSubPage($pagename) { - return (strstr($pagename, SUBPAGE_SEPARATOR)); + return (strstr($pagename, '/')); } function subPageSlice($pagename, $pos) { - $pages = explode(SUBPAGE_SEPARATOR, $pagename); + $pages = explode('/', $pagename); $pages = array_slice($pages, $pos, 1); return $pages[0]; } Modified: trunk/tests/unit/lib/TextSearchTest.php =================================================================== --- trunk/tests/unit/lib/TextSearchTest.php 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/tests/unit/lib/TextSearchTest.php 2014-11-21 16:51:08 UTC (rev 9362) @@ -9,7 +9,7 @@ global $request; // find subpages $pagename = "PgsrcTranslation"; - $query = new TextSearchQuery($pagename . SUBPAGE_SEPARATOR . '*', true, 'glob'); + $query = new TextSearchQuery($pagename . '/' . '*', true, 'glob'); $sortby = false; $limit = 20; $exclude = ""; $dbi = $request->getDbh(); $subpages = $dbi->titleSearch($query, $sortby, $limit, $exclude); Modified: trunk/themes/Crao/templates/head.tmpl =================================================================== --- trunk/themes/Crao/templates/head.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/Crao/templates/head.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -62,12 +62,12 @@ /* For signed-in users */ ?> <?php /* User's calendar page */ - $UserCalPageTitle = $user->getId() . SUBPAGE_SEPARATOR ._("Calendar"); + $UserCalPageTitle = $user->getId() . '/' ._("Calendar"); $UserCalPageUrl = WikiURL($UserCalPageTitle); ?> <?php /* Today's calendar page for the user if it exists */ - $UserCalPageTodayTitle = $UserCalPageTitle . SUBPAGE_SEPARATOR . strftime("%Y-%m-%d", time()); //FIXME + $UserCalPageTodayTitle = $UserCalPageTitle . '/' . strftime("%Y-%m-%d", time()); //FIXME $dbi = $request->getDbh(); if ($dbi->isWikiPage($UserCalPageTodayTitle)) { $UserCalPageTodayUrl = WikiURL($UserCalPageTodayTitle); Modified: trunk/themes/Crao/templates/navbar.tmpl =================================================================== --- trunk/themes/Crao/templates/navbar.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/Crao/templates/navbar.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -23,7 +23,7 @@ <?php if (!empty($user)) { ?> <?php /* Today's calendar page for the user, if the Calender subpage is defined. */ - $UserCalPageTitle = $user->getId() . SUBPAGE_SEPARATOR . _("Calendar"); + $UserCalPageTitle = $user->getId() . '/' . _("Calendar"); $dbi = $request->getDbh(); if ($dbi->isWikiPage($UserCalPageTitle)) { $UserCalPageTodayTitle = $UserCalPageTitle . SUBPAGE_SEPARATOR . strftime("%Y-%m-%d", time()); Modified: trunk/themes/MonoBook/templates/actionbar.tmpl =================================================================== --- trunk/themes/MonoBook/templates/actionbar.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/MonoBook/templates/actionbar.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -8,7 +8,7 @@ ?> <div class="portlet" id="p-cactions"> <ul> - <?php if (!string_ends_with($pagename, SUBPAGE_SEPARATOR._("Discussion"))) { ?> + <?php if (!string_ends_with($pagename, '/'._("Discussion"))) { ?> <?php $talk = new WikiPageName('Talk:'.$pagename); ?> <?php echo ActionButton(array(), $isActionPage ? _("ActionPage") : _("Article"), Modified: trunk/themes/Sidebar/templates/calendar.tmpl =================================================================== --- trunk/themes/Sidebar/templates/calendar.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/Sidebar/templates/calendar.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -7,7 +7,7 @@ var d = calendar.date.getDate(); // integer, 1..31 m = m < 10 ? "0" + m : m; d = d < 10 ? "0" + d : d; - window.location = "' . WikiUrl($WikiTheme->calendarBase(),0,1) . SUBPAGE_SEPARATOR . '" + y + "-" + m + "-" + d; + window.location = "' . WikiUrl($WikiTheme->calendarBase(),0,1) . '/' . '" + y + "-" + m + "-" + d; } }; Calendar.setup({flat : "calendar", flatCallback : dateChanged, setDateStatusFunc : dateStatusFunc, weekNumbers : false})') ?> Modified: trunk/themes/Wordpress/templates/actionbar.tmpl =================================================================== --- trunk/themes/Wordpress/templates/actionbar.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/Wordpress/templates/actionbar.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -27,10 +27,10 @@ <?php if (!empty($user)) { ?> <?php /* Today's calendar page for the user, if the Calender subpage is defined. */ - $UserCalPageTitle = $user->getId() . SUBPAGE_SEPARATOR . _("Calendar"); + $UserCalPageTitle = $user->getId() . '/' . _("Calendar"); $dbi = $request->getDbh(); if ($dbi->isWikiPage($UserCalPageTitle)) { - $UserCalPageTodayTitle = $UserCalPageTitle . SUBPAGE_SEPARATOR . strftime("%Y-%m-%d", time()); + $UserCalPageTodayTitle = $UserCalPageTitle . '/' . strftime("%Y-%m-%d", time()); ?> <li> <?php echo $SEP?><?php echo WikiLink($UserCalPageTodayTitle, "button", _("Today")) ?> Modified: trunk/themes/blog/templates/sidebar.tmpl =================================================================== --- trunk/themes/blog/templates/sidebar.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/blog/templates/sidebar.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -4,7 +4,7 @@ <div id="<?php echo $id?>"> <?php /* Today's Blogs page for the current or admin user, if the subpage is defined. */ - $UserCalPageTitle = $user->getId() . SUBPAGE_SEPARATOR . _("Blog"); + $UserCalPageTitle = $user->getId() . '/' . _("Blog"); $dbi = $request->getDbh(); // display flat calender dhtml under the clock if (!$dbi->isWikiPage($UserCalPageTitle) and BLOG_DEFAULT_EMPTY_PREFIX) { Modified: trunk/themes/default/templates/head.tmpl =================================================================== --- trunk/themes/default/templates/head.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/default/templates/head.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -68,12 +68,12 @@ /* For signed-in users */ ?> <?php /* User's calendar page */ - $UserCalPageTitle = $user->getId() . SUBPAGE_SEPARATOR ._("Calendar"); + $UserCalPageTitle = $user->getId() . '/' ._("Calendar"); $UserCalPageUrl = WikiURL($UserCalPageTitle); ?> <?php /* Today's calendar page for the user if it exists */ - $UserCalPageTodayTitle = $UserCalPageTitle . SUBPAGE_SEPARATOR . strftime("%Y-%m-%d", time()); //FIXME + $UserCalPageTodayTitle = $UserCalPageTitle . '/' . strftime("%Y-%m-%d", time()); //FIXME $dbi = $request->getDbh(); if ($dbi->isWikiPage($UserCalPageTodayTitle)) { $UserCalPageTodayUrl = WikiURL($UserCalPageTodayTitle); Modified: trunk/themes/default/templates/homepage.tmpl =================================================================== --- trunk/themes/default/templates/homepage.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/default/templates/homepage.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -11,7 +11,7 @@ $UserPreferencesMessage[1] = _("(Your preferences are stored as hidden data within this page.)"); -$CalendarSubpage = sprintf('[%s]', SUBPAGE_SEPARATOR . _("Calendar")); +$CalendarSubpage = sprintf('[%s]', '/' . _("Calendar")); $calendarMessage = sprintf(_("The %s subpage enables simple weblogging."), $CalendarSubpage); Modified: trunk/themes/default/templates/navbar.tmpl =================================================================== --- trunk/themes/default/templates/navbar.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/default/templates/navbar.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -2,7 +2,7 @@ <div id="navbuttons"> <?php if (ENABLE_DISCUSSION_LINK) { ?> <?php // This requires Talk: map to end in "/Discussion" - if (!string_ends_with($page->getName(), SUBPAGE_SEPARATOR._("Discussion"))) { ?> + if (!string_ends_with($page->getName(), '/'._("Discussion"))) { ?> <?php echo $SEP?><?php echo WikiLink(new WikiPagename('Talk:'.$page->getName(), $page->getName()), 'button', _("Discussion")) ?> <?php } else { ?> Modified: trunk/themes/fusionforge/templates/actionbar.tmpl =================================================================== --- trunk/themes/fusionforge/templates/actionbar.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/fusionforge/templates/actionbar.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -9,7 +9,7 @@ <nav id="actionbuttons"> <ul> - <?php if (!string_ends_with($pagename, SUBPAGE_SEPARATOR._("Discussion"))) { ?> + <?php if (!string_ends_with($pagename, '/'._("Discussion"))) { ?> <?php $talk = new WikiPageName('Talk:'.$pagename); ?> <li class="bold"> <?php echo Button(array(), $isActionPage ? _("Action Page") : _("Page"), $talk->getParent()) ?> Modified: trunk/themes/wikilens/templates/head.tmpl =================================================================== --- trunk/themes/wikilens/templates/head.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/wikilens/templates/head.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -61,12 +61,12 @@ /* For signed-in users */ ?> <?php /* User's calendar page */ - $UserCalPageTitle = $user->getId() . SUBPAGE_SEPARATOR ._("Calendar"); + $UserCalPageTitle = $user->getId() . '/' ._("Calendar"); $UserCalPageUrl = WikiURL($UserCalPageTitle); ?> <?php /* Today's calendar page for the user if it exists */ - $UserCalPageTodayTitle = $UserCalPageTitle . SUBPAGE_SEPARATOR . strftime("%Y-%m-%d", time()); //FIXME + $UserCalPageTodayTitle = $UserCalPageTitle . '/' . strftime("%Y-%m-%d", time()); //FIXME $dbi = $request->getDbh(); if ($dbi->isWikiPage($UserCalPageTodayTitle)) { $UserCalPageTodayUrl = WikiURL($UserCalPageTodayTitle); Modified: trunk/themes/wikilens/templates/navbar.tmpl =================================================================== --- trunk/themes/wikilens/templates/navbar.tmpl 2014-11-21 16:27:17 UTC (rev 9361) +++ trunk/themes/wikilens/templates/navbar.tmpl 2014-11-21 16:51:08 UTC (rev 9362) @@ -5,7 +5,7 @@ <div id="navbuttons"> <?php if (ENABLE_DISCUSSION_LINK) { ?> <?php // This requires Talk: map to end in "/Discussion" - if (!string_ends_with($page->getName(), SUBPAGE_SEPARATOR._("Discussion"))) { ?> + if (!string_ends_with($page->getName(), '/'._("Discussion"))) { ?> <?php echo $NSEP?><?php echo WikiLink(new WikiPagename('Talk:'.$page->getName(), $page->getName()), 'button', _("Discussion")) ?> <?php } else { ?> @@ -21,10 +21,10 @@ ?><?php echo $NSEP?><?php echo $WikiTheme->makeLinkButton($revision,_("BackLinks"),_("BackLinks")) ?><?php echo $NSEP?><?php echo WikiLink(_("UserPreferences"), 'button',_("Preferences")) ?><?php /* Today's calendar page for the user, if the Calender subpage is defined. */ - $UserCalPageTitle = $user->getId() . SUBPAGE_SEPARATOR . _("Calendar"); + $UserCalPageTitle = $user->getId() . '/' . _("Calendar"); $dbi = $request->getDbh(); if ($dbi->isWikiPage($UserCalPageTitle)) { - $UserCalPageTodayTitle = $UserCalPageTitle . SUBPAGE_SEPARATOR . strftime("%Y-%m-%d", time()); + $UserCalPageTodayTitle = $UserCalPageTitle . '/' . strftime("%Y-%m-%d", time()); //$UserCalPageTodayUrl = WikiURL($UserCalPageTodayTitle); ?><?php echo $NSEP?><?php echo WikiLink($UserCalPageTodayTitle, "button", _("Today")) ?> <?php }} ?><?php if (!empty($user) && $user->isAdmin()) { ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |