From: <ru...@us...> - 2009-06-04 11:46:18
|
Revision: 6877 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6877&view=rev Author: rurban Date: 2009-06-04 11:45:17 +0000 (Thu, 04 Jun 2009) Log Message: ----------- use verify to do some beginner error checks on new pagenames Modified Paths: -------------- trunk/lib/plugin/CreatePage.php Modified: trunk/lib/plugin/CreatePage.php =================================================================== --- trunk/lib/plugin/CreatePage.php 2009-06-04 11:44:33 UTC (rev 6876) +++ trunk/lib/plugin/CreatePage.php 2009-06-04 11:45:17 UTC (rev 6877) @@ -57,6 +57,7 @@ 'template' => false, 'vars' => false, 'overwrite' => false, + 'verify' => false, // true or a pagename //'buttontext' => false, //'method' => 'POST' ); @@ -70,6 +71,28 @@ return $this->error(_("Cannot create page with empty name!")); } // TODO: javascript warning if "/" or SUBPAGE_SEPARATOR in s + if ($verify) { + $head = _("CreatePage failed"); + if ($dbi->isWikiPage($verify)) { + $msg = _("Do you really want to create the page '%s'?"); + } else { + $msg = _("Do you really want to create the page '%s'?"); + } + if (isSubPage($s)) { + $main = subPageSlice(0); + if (!$dbi->isWikiPage(subPageSlice(0))) { + $msg .= "\n" . _("The new page you want to create will be a subpage.") + . "\n" . _("Subpages cannot be created unless the parent page exists."); + return alert($head, $msg); + } else { + $msg .= "\n" . _("The new page you want to create will be a subpage."); + } + } + if (strpos($s, " \/")) { + $msg .= "\n" . _("Subpages with ending space are not allowed as directory name on Windows."); + return alert($head, $msg); + } + } $param = array('action' => 'edit'); if ($template and $dbi->isWikiPage($template)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-07-16 09:45:28
|
Revision: 10354 http://sourceforge.net/p/phpwiki/code/10354 Author: vargenau Date: 2021-07-16 09:45:27 +0000 (Fri, 16 Jul 2021) Log Message: ----------- lib/plugin/CreatePage.php: remove undocumented argument verify Modified Paths: -------------- trunk/lib/plugin/CreatePage.php Modified: trunk/lib/plugin/CreatePage.php =================================================================== --- trunk/lib/plugin/CreatePage.php 2021-07-16 09:21:32 UTC (rev 10353) +++ trunk/lib/plugin/CreatePage.php 2021-07-16 09:45:27 UTC (rev 10354) @@ -51,8 +51,7 @@ 'initial_content' => '', 'template' => false, 'vars' => false, - 'overwrite' => false, - 'verify' => false, // true or a pagename + 'overwrite' => false ); } @@ -84,28 +83,6 @@ if (strlen($s) > MAX_PAGENAME_LENGTH) { return $this->error(_("Page name too long")); } - // TODO: javascript warning if "/" in s - if ($verify) { - $head = _("CreatePage failed"); - if ($dbi->isWikiPage($verify)) { - $msg = _("Do you really want to create the page “%s”?"); - } else { - $msg = _("Do you really want to create the page “%s”?"); - } - if (isSubPage($s)) { - if (!$dbi->isWikiPage(subPageSlice(0))) { - $msg .= "\n" . _("The new page you want to create will be a subpage.") - . "\n" . _("Subpages cannot be created unless the parent page exists."); - return alert($head, $msg); - } else { - $msg .= "\n" . _("The new page you want to create will be a subpage."); - } - } - if (strpos($s, " \/")) { - $msg .= "\n" . _("Subpages with ending space are not allowed as directory name on Windows."); - return alert($head, $msg); - } - } $param = array('action' => 'edit'); if ($template and $dbi->isWikiPage($template)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |