[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] prefixalias: Fix prefix alias where the alias has a non-alpha character...
"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a3135596232e_381962fc376c5@gitlab-sidekiq-low-urgency-cpu-bound-v2-7d87cb8569-lprvs.mail> |
Jonny Bradley pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
7bc6093c by Jonny Bradley at 2026-06-16T11:18:59+00:00
[FIX] prefixalias: Fix prefix alias where the alias has a non-alpha character...
---
* [FIX] prefixalias: Fix prefix alias where the alias has a non-alpha character separating the page name and the item id, as in "product-42-title-in-slug-format"
Missed in !10253 and !10367 recently
See merge request tikiwiki/tiki!10530
- - - - -
3 changed files:
- lib/core/Sections.php
- lib/smarty_tiki/Modifier/Sefurl.php
- tiki-index.php
Changes:
=====================================
lib/core/Sections.php
=====================================
@@ -393,6 +393,13 @@ class Sections
$k = $request[$info['key']];
// when using wiki_url_scheme the page request var is the page slug, not the page/object name
if ($prefs['wiki_url_scheme'] !== 'urlencode' && $info['objectType'] === 'wiki page') {
+ global $jitRequest;
+ if ($prefs["feature_sefurl_tracker_prefixalias"] == 'y') {
+ $referencedPages = TikiLib::lib('wiki')->get_pages_by_alias($k);
+ if ($referencedPages) {
+ $k = $referencedPages[0];
+ }
+ }
$k = TikiLib::lib('wiki')->get_page_by_slug($k);
}
}
=====================================
lib/smarty_tiki/Modifier/Sefurl.php
=====================================
@@ -130,6 +130,11 @@ class Sefurl
if ($replacementpage) {
$href = \TikiLib::tikiUrlOpt($wikilib->sefurl($replacementpage, $with_next, $all_langs));
if ($prefs['feature_sefurl'] === 'y') {
+ if (preg_match('/' . preg_quote($href) . '[\W]/', $replacementpage)) {
+ // you can use "product-" with a trailing hyphen, for example, as your alias,
+ // so the url would be: pagenme-id-title-as-slug
+ $href = $replacementpage;
+ }
$href .= $source;
} else {
$href .= "&itemId=$source";
=====================================
tiki-index.php
=====================================
@@ -392,6 +392,8 @@ if (empty($info) && ! ($user && $prefs['feature_wiki_userpage'] == 'y' && strcas
$_REQUEST['page'] = $newPage;
$_GET['itemId'] = $suffix; // \ParserLib::parse_wiki_argvariable uses $_GET
$_GET['page'] = $newPage;
+ $jitGet = new JitFilter($_GET);
+ $jitRequest = new JitFilter($_REQUEST);
$smarty->assign('canonical_ending', urlencode(trim(substr($page, strlen($newPage)))));
$page = $newPage;
$info = $tikilib->get_page_info($_REQUEST['page']);
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/7bc6093cfac219e44463159fbc7b33bfde3e093f
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/7bc6093cfac219e44463159fbc7b33bfde3e093f
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs