From: <var...@us...> - 2010-06-04 14:45:28
|
Revision: 7464 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7464&view=rev Author: vargenau Date: 2010-06-04 14:45:22 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Check illegal characters in page names Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2010-06-04 14:15:43 UTC (rev 7463) +++ trunk/lib/main.php 2010-06-04 14:45:22 UTC (rev 7464) @@ -757,6 +757,17 @@ // [574ms] mainly template:printexpansion: 393ms and template::expandsubtemplate [100+70+60ms] function handleAction () { + // Check illegal characters in page names: <>[]{}|" + require_once("lib/Template.php"); + $page = $this->getPage(); + $pagename = $page->getName(); + if (preg_match("/[<\[\{\|\"\}\]>]/", $pagename, $matches) > 0) { + $CONTENT = HTML::div( + array('class' => 'error'), + _("Illegal character '"). $matches[0] . _("' in page name.")); + GeneratePage($CONTENT, $pagename); + $this->finish(); + } $action = $this->getArg('action'); if ($this->isPost() and !$this->_user->isAdmin() @@ -764,7 +775,6 @@ and $action != 'wikitohtml' ) { - $page = $this->getPage(); if ( $page->get('moderation') ) { require_once("lib/WikiPlugin.php"); $loader = new WikiPluginLoader(); @@ -784,7 +794,6 @@ _("You must wait for moderator approval.")); else $plugin->_tokens['CONTENT'] = $CONTENT; - require_once("lib/Template.php"); $title = WikiLink($page->getName()); $title->pushContent(' : ', WikiLink(_("ModeratedPage"))); GeneratePage(Template('browse', $plugin->_tokens), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |