[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][FIX]: Tiki wiki page rename: if page name is not changed, there is a false...
"Baraka Kinywa \(@bkinywa24\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <694589d54735b_2a17fca0710f5@gitlab-sidekiq-low-urgency-cpu-bound-v2-756f9bf6d4-s6bn7.mail> |
Baraka Kinywa pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki
Commits:
03b748f3 by Grace Nshokano at 2025-12-19T19:14:44+02:00
[BP][FIX]: Tiki wiki page rename: if page name is not changed, there is a false...
---
* [FIX]: Tiki wiki page rename: if page name is not changed, there is a false...
---
* [FIX] tiki wiki page rename: if page name is not changed, there is a false report: success: page renamed
See merge request tikiwiki/tiki!9183
(cherry picked from commit 4e97f735fe430a012602a8f0f67974f482ce0818)
See merge request tikiwiki/tiki!9253
- - - - -
2 changed files:
- lib/wiki/wikilib.php
- tiki-rename_page.php
Changes:
=====================================
lib/wiki/wikilib.php
=====================================
@@ -244,6 +244,12 @@ class WikiLib extends TikiLib
$tikilib = TikiLib::lib('tiki');
// if page already exists, stop here
$newName = trim($newName);
+ $oldName = trim($oldName);
+
+ // Check if trying to rename to the same name
+ if ($oldName === $newName) {
+ throw new Exception("Cannot rename page to the same name", 3);
+ }
if ($this->get_page_info($newName, false, true)) {
// if it is a case change of same page: allow it, else stop here
if (strcasecmp(trim($oldName), $newName) <> 0) {
=====================================
tiki-rename_page.php
=====================================
@@ -83,6 +83,9 @@ if ((isset($_REQUEST["rename"]) || isset($_REQUEST["confirm"])) && $access->chec
case 2:
Feedback::error(tr('Page already exists'));
break;
+ case 3:
+ Feedback::error(tr('Cannot rename page to the same name'));
+ break;
default:
throw $e;
}
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/03b748f3575bb8abde2764b971eb51668011cc65
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/03b748f3575bb8abde2764b971eb51668011cc65
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs