From: <var...@us...> - 2009-03-21 19:18:42
|
Revision: 6680 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6680&view=rev Author: vargenau Date: 2009-03-21 19:18:38 +0000 (Sat, 21 Mar 2009) Log Message: ----------- Much simpler function _isActionPage Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2009-03-21 19:17:51 UTC (rev 6679) +++ trunk/lib/main.php 2009-03-21 19:18:38 UTC (rev 6680) @@ -979,16 +979,10 @@ } function _isActionPage ($pagename, $verbose = true) { - $dbi = $this->getDbh(); - $page = $dbi->getPage($pagename); - if (!$page) return false; - $rev = $page->getCurrentRevision(); - // FIXME: more restrictive check for sane plugin? - if (strstr($rev->getPackedContent(), '<?plugin')) - return true; - if ($verbose and !$rev->hasDefaultContents()) - trigger_error("$pagename: Does not appear to be an 'action page'", E_USER_NOTICE); - return false; + + global $AllActionPages; + + return (in_array($pagename, $AllActionPages)); } function findActionPage ($action) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-07-14 07:29:51
|
Revision: 7030 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7030&view=rev Author: rurban Date: 2009-07-14 07:29:48 +0000 (Tue, 14 Jul 2009) Log Message: ----------- Performance: Speedup SetupWiki by setting the action loadfile Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2009-07-14 07:27:43 UTC (rev 7029) +++ trunk/lib/main.php 2009-07-14 07:29:48 UTC (rev 7030) @@ -161,6 +161,7 @@ update_locale($user_lang); FindLocalizedButtonFile(".",'missing_ok','reinit'); } + //if (empty($_lang->lang) and $GLOBALS['LANG'] != $_lang->default_value) ; } function initializeTheme ($when = 'default') { @@ -745,6 +746,7 @@ return; // Homepage exists. include_once('lib/loadsave.php'); + $this->setArg('action', 'loadfile'); SetupWiki($this); $this->finish(); // NORETURN } @@ -1363,10 +1365,6 @@ $_PEAR_destructor_object_list = array(); $request->possiblyDeflowerVirginWiki(); -// hack! define proper actions for these. -//if (defined('WIKI_XMLRPC') and WIKI_XMLRPC) return; -//if (defined('WIKI_SOAP') and WIKI_SOAP) return; - $validators = array('wikiname' => WIKI_NAME, 'args' => wikihash($request->getArgs()), 'prefs' => wikihash($request->getPrefs())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-09-17 10:26:46
|
Revision: 7141 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7141&view=rev Author: rurban Date: 2009-09-17 10:26:37 +0000 (Thu, 17 Sep 2009) Log Message: ----------- * stabilize RPC2.php usage on wrong mime types * support action=rename&to=newpagename Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2009-09-17 10:15:21 UTC (rev 7140) +++ trunk/lib/main.php 2009-09-17 10:26:37 UTC (rev 7141) @@ -898,9 +898,10 @@ return 'soap'; // Detect XML-RPC requests. if ($this->isPost() - && ($this->get('CONTENT_TYPE') == 'text/xml' - or $this->get('CONTENT_TYPE') == 'application/xml') - && strstr($GLOBALS['HTTP_RAW_POST_DATA'], '<methodCall>') + && ((defined("WIKI_XMLRPC") and WIKI_XMLRPC) + or ($this->get('CONTENT_TYPE') == 'text/xml' + or $this->get('CONTENT_TYPE') == 'application/xml') + && strstr($GLOBALS['HTTP_RAW_POST_DATA'], '<methodCall>')) ) { return 'xmlrpc'; @@ -1057,9 +1058,15 @@ if ($action) { if (!$this->getArg('s')) $this->setArg('s', $this->getArg('pagename')); - $this->setArg('verify',1); + $this->setArg('verify', 1); // only for POST if ($this->getArg('action') != 'rename') $this->setArg('action', $action); + elseif($this->getArg('to') && empty($this->args['admin_rename'])) { + $this->args['admin_rename'] + = array('from' => $this->getArg('s'), + 'to' => $this->getArg('to'), + 'action' => 'select'); + } $this->actionpage($action); } else { trigger_error($page.": Cannot find action page", E_USER_WARNING); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-09-20 15:03:43
|
Revision: 7144 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7144&view=rev Author: vargenau Date: 2009-09-20 15:03:32 +0000 (Sun, 20 Sep 2009) Log Message: ----------- Wikicreole syntax Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2009-09-17 14:12:58 UTC (rev 7143) +++ trunk/lib/main.php 2009-09-20 15:03:32 UTC (rev 7144) @@ -1347,7 +1347,7 @@ * Allow for disabling of markup cache. * (Mostly for debugging ... hopefully.) * - * See also <?plugin WikiAdminUtils action=purge-cache ?> + * See also <<WikiAdminUtils action=purge-cache>> */ if (!defined('WIKIDB_NOCACHE_MARKUP')) { if ($request->getArg('nocache')) // 1 or purge This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-04-01 09:15:42
|
Revision: 7316 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7316&view=rev Author: vargenau Date: 2010-04-01 09:15:31 +0000 (Thu, 01 Apr 2010) Log Message: ----------- Add class gforgepassuser Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2010-04-01 08:17:24 UTC (rev 7315) +++ trunk/lib/main.php 2010-04-01 09:15:31 UTC (rev 7316) @@ -114,7 +114,8 @@ // revive db handle, because these don't survive sessions if (isset($this->_user) and ( ! isa($this->_user, WikiUserClassname()) - or (strtolower(get_class($this->_user)) == '_passuser'))) + or (strtolower(get_class($this->_user)) == '_passuser') + or (strtolower(get_class($this->_user)) == '_gforgepassuser'))) { $this->_user = WikiUser($userid, $this->_user->_prefs); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <ru...@us...> - 2010-06-07 11:42:51
|
Revision: 7475 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7475&view=rev Author: rurban Date: 2010-06-07 11:42:44 +0000 (Mon, 07 Jun 2010) Log Message: ----------- READONLY might be deferred Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2010-06-07 11:00:26 UTC (rev 7474) +++ trunk/lib/main.php 2010-06-07 11:42:44 UTC (rev 7475) @@ -79,7 +79,7 @@ if (USE_DB_SESSION) { include_once('lib/DbSession.php'); $dbi =& $this->_dbi; - if (!READONLY) + if (defined('READONLY') and !READONLY) // READONLY might be set later $this->_dbsession = new DbSession($dbi, $dbi->getParam('prefix') . $dbi->getParam('db_session_table')); } @@ -201,7 +201,8 @@ } if (empty($WikiTheme) and $user_theme) { if (strcspn($user_theme,"./\x00]") != strlen($user_theme)) { - trigger_error(sprintf("invalid theme '%s': Invalid characters detected", $user_theme), + trigger_error(sprintf("invalid theme '%s': Invalid characters detected", + $user_theme), E_USER_WARNING); $user_theme = "default"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-06-10 12:59:13
|
Revision: 7518 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7518&view=rev Author: vargenau Date: 2010-06-10 12:59:06 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Special _deduceUsername for Gforge Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2010-06-10 07:10:56 UTC (rev 7517) +++ trunk/lib/main.php 2010-06-10 12:59:06 UTC (rev 7518) @@ -953,7 +953,11 @@ // Switched auth between sessions. // Note: There's no way to demandload a missing class-definition // afterwards! Stupid php. - if (isa($user, WikiUserClassname())) { + if (defined('GFORGE') and GFORGE) { + if (empty($HTTP_SERVER_VARS['PHP_AUTH_USER'])) { + return false; + } + } else if (isa($user, WikiUserClassname())) { $this->_user = $user; $this->_user->_authhow = 'session'; return ENABLE_USER_NEW ? $user->UserName() : $this->_user; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-06-17 10:15:54
|
Revision: 7540 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7540&view=rev Author: vargenau Date: 2010-06-17 10:15:47 +0000 (Thu, 17 Jun 2010) Log Message: ----------- Check that PHP version is at least 4.3.10 Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2010-06-17 09:36:41 UTC (rev 7539) +++ trunk/lib/main.php 2010-06-17 10:15:47 UTC (rev 7540) @@ -1321,6 +1321,11 @@ } function main () { + + if (version_compare(PHP_VERSION, '4.3.10', '<')) { + exit(_("Your PHP version is too old. You must have at least PHP 4.3.10")); + } + if ( !USE_DB_SESSION ) validateSessionPath(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-06-17 15:05:25
|
Revision: 7547 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7547&view=rev Author: vargenau Date: 2010-06-17 15:05:18 +0000 (Thu, 17 Jun 2010) Log Message: ----------- Update copyright year; whitespace Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2010-06-17 14:09:32 UTC (rev 7546) +++ trunk/lib/main.php 2010-06-17 15:05:18 UTC (rev 7547) @@ -2,7 +2,7 @@ // rcs_id('$Id$'); /* * Copyright 1999-2008 $ThePhpWikiProgrammingTeam - * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent + * Copyright (C) 2008-2010 Marc-Etienne Vargenau, Alcatel-Lucent * Copyright (C) 2009 Roger Guignard, Alcatel-Lucent * * This file is part of PhpWiki. @@ -53,7 +53,7 @@ function WikiRequest () { $this->_dbi = WikiDB::open($GLOBALS['DBParams']); // first mysql request costs [958ms]! [670ms] is mysql_connect() - + if (in_array('File', $this->_dbi->getAuthParam('USER_AUTH_ORDER'))) { // force our local copy, until the pear version is fixed. include_once(dirname(__FILE__)."/pear/File_Passwd.php"); @@ -80,7 +80,7 @@ include_once('lib/DbSession.php'); $dbi =& $this->_dbi; if (defined('READONLY') and !READONLY) // READONLY might be set later - $this->_dbsession = new DbSession($dbi, $dbi->getParam('prefix') + $this->_dbsession = new DbSession($dbi, $dbi->getParam('prefix') . $dbi->getParam('db_session_table')); } @@ -95,24 +95,24 @@ $this->setArg('action', $this->_deduceAction()); if ((DEBUG & _DEBUG_SQL) - or (DATABASE_OPTIMISE_FREQUENCY > 0 and + or (DATABASE_OPTIMISE_FREQUENCY > 0 and (time() % DATABASE_OPTIMISE_FREQUENCY == 0))) { if ($this->_dbi->_backend->optimize()) trigger_error(_("Optimizing database"), E_USER_NOTICE); } // Restore auth state. This doesn't check for proper authorization! - $userid = $this->_deduceUsername(); + $userid = $this->_deduceUsername(); if (ENABLE_USER_NEW) { - if (isset($this->_user) and - !empty($this->_user->_authhow) and + if (isset($this->_user) and + !empty($this->_user->_authhow) and $this->_user->_authhow == 'session') { // users might switch in a session between the two objects. // restore old auth level here or in updateAuthAndPrefs? //$user = $this->getSessionVar('wiki_user'); // revive db handle, because these don't survive sessions - if (isset($this->_user) and + if (isset($this->_user) and ( ! isa($this->_user, WikiUserClassname()) or (strtolower(get_class($this->_user)) == '_passuser') or (strtolower(get_class($this->_user)) == '_gforgepassuser'))) @@ -121,21 +121,21 @@ } // revive other db handle if (isset($this->_user->_prefs->_method) - and ($this->_user->_prefs->_method == 'SQL' - or $this->_user->_prefs->_method == 'ADODB' - or $this->_user->_prefs->_method == 'PDO' + and ($this->_user->_prefs->_method == 'SQL' + or $this->_user->_prefs->_method == 'ADODB' + or $this->_user->_prefs->_method == 'PDO' or $this->_user->_prefs->_method == 'HomePage')) { $this->_user->_HomePagehandle = $this->getPage($userid); } // need to update the lockfile filehandle - if ( isa($this->_user, '_FilePassUser') - and $this->_user->_file->lockfile + if ( isa($this->_user, '_FilePassUser') + and $this->_user->_file->lockfile and !$this->_user->_file->fplock ) { //$level = $this->_user->_level; - $this->_user = UpgradeUser($this->_user, - new _FilePassUser($userid, - $this->_user->_prefs, + $this->_user = UpgradeUser($this->_user, + new _FilePassUser($userid, + $this->_user->_prefs, $this->_user->_file->filename)); //$this->_user->_level = $level; } @@ -158,7 +158,7 @@ $_lang = $this->_prefs->_prefs['lang']; if (isset($_lang->lang) and $_lang->lang != $GLOBALS['LANG']) { $user_lang = $_lang->lang; - //check changed LANG and THEME inside a session. + //check changed LANG and THEME inside a session. // (e.g. by using another baseurl) if (isset($this->_user->_authhow) and $this->_user->_authhow == 'session') $user_lang = $GLOBALS['LANG']; @@ -186,15 +186,15 @@ else $user_theme = ''; } - else + else $user_theme = $this->getPref('theme'); - //check changed LANG and THEME inside a session. + //check changed LANG and THEME inside a session. // (e.g. by using another baseurl) - if (isset($this->_user->_authhow) - and $this->_user->_authhow == 'session' - and !isset($_theme->theme) - and defined('THEME') + if (isset($this->_user->_authhow) + and $this->_user->_authhow == 'session' + and !isset($_theme->theme) + and defined('THEME') and $user_theme != THEME) { include_once("themes/" . THEME . "/themeinfo.php"); @@ -202,7 +202,7 @@ if (empty($WikiTheme) and $user_theme) { if (strcspn($user_theme,"./\x00]") != strlen($user_theme)) { trigger_error(sprintf("invalid theme '%s': Invalid characters detected", - $user_theme), + $user_theme), E_USER_WARNING); $user_theme = "default"; } @@ -245,22 +245,22 @@ function updateAuthAndPrefs () { if (isset($this->_user) and (!isa($this->_user, WikiUserClassname()))) { - $this->_user = false; + $this->_user = false; } // Handle authentication request, if any. if ($auth_args = $this->getArg('auth')) { $this->setArg('auth', false); $this->_handleAuthRequest($auth_args); // possible NORETURN } - elseif ( ! $this->_user - or (isa($this->_user, WikiUserClassname()) + elseif ( ! $this->_user + or (isa($this->_user, WikiUserClassname()) and ! $this->_user->isSignedIn())) { // If not auth request, try to sign in as saved user. if (($saved_user = $this->getPref('userid')) != false) { $this->_signIn($saved_user); } } - + $action = $this->getArg('action'); // Save preferences in session and cookie @@ -276,7 +276,7 @@ } // Ensure user has permissions for action - // HACK ALERT: We may not set the request arg to create, + // HACK ALERT: We may not set the request arg to create, // since the pageeditor has an ugly logic for action == create. if ($action == 'edit' or $action == 'create') { $page = $this->getPage(); @@ -291,7 +291,7 @@ $this->_notAuthorized($require_level); // NORETURN } else { // novatrope patch to let only _AUTHENTICATED view pages. - // If there's not enough authority or forbidden, ask for a password, + // If there's not enough authority or forbidden, ask for a password, // unless it's explicitly unobtainable. Some bad magic though. if ($this->requiredAuthorityForAction($action) == WIKIAUTH_UNOBTAINABLE) { $require_level = $this->requiredAuthority($action); @@ -306,7 +306,7 @@ else return $GLOBALS['ForbiddenUser']; } - + function & getGroup () { if (isset($this->_user) and isset($this->_user->_group)) return $this->_user->_group; @@ -342,7 +342,7 @@ */ function getPage ($pagename = false) { //if (!isset($this->_dbi)) $this->getDbh(); - if (!$pagename) + if (!$pagename) $pagename = $this->getArg('pagename'); return $this->_dbi->getPage($pagename); } @@ -373,7 +373,7 @@ else return WikiURL($pagename, array('action' => $action)); } - + function _handleAuthRequest ($auth_args) { if (!is_array($auth_args)) return; @@ -393,9 +393,9 @@ $fail_message = ''; // If no password was submitted, it's not really // a failure --- just need to prompt for password... - if (!ALLOW_USER_PASSWORDS - and ALLOW_BOGO_LOGIN - and !isset($auth_args['passwd'])) + if (!ALLOW_USER_PASSWORDS + and ALLOW_BOGO_LOGIN + and !isset($auth_args['passwd'])) { $fail_message = false; } @@ -424,7 +424,7 @@ if (! $this->_user ) $this->_user = new _BogoUser($userid); // FIXME: is this always false? shouldn't we try passuser first? - if (! $this->_user ) + if (! $this->_user ) $this->_user = new _PassUser($userid); } else { if (! $this->_user ) @@ -483,7 +483,7 @@ else return _("ANON"); } - + function _notAuthorized ($require_level) { // Display the authority message in the Wiki's default // language, in case it is not english. @@ -536,7 +536,7 @@ $msg = ""; /*if (!ALLOW_ANON_USER) $msg = fmt("You must log in first to %s", $what); - else + else $msg = fmt("You must log in to %s.", $what); */ } elseif ($require_level == WIKIAUTH_ANON) @@ -544,13 +544,13 @@ else $msg = fmt("You must be an administrator to %s.", $what); - $this->_user->PrintLoginForm($this, compact('require_level','pass_required'), + $this->_user->PrintLoginForm($this, compact('require_level','pass_required'), $msg); if (!$GLOBALS['WikiTheme']->DUMP_MODE) $this->finish(); // NORETURN } - // Fixme: for PagePermissions we'll need other strings, + // Fixme: for PagePermissions we'll need other strings, // relevant to the requested page, not just for the action on the whole wiki. function getActionDescription($action) { static $actionDescriptions; @@ -583,7 +583,7 @@ else return _("use")." ".$action; } - + /** TODO: check against these cases: if ($DisabledActions and in_array($action, $DisabledActions)) @@ -591,12 +591,12 @@ if (ENABLE_PAGEPERM and class_exists("PagePermission")) { return requiredAuthorityForPage($action); - + => Browsing pages is disallowed on this wiki for authenticated user 'rurban' (level: BOGO). */ function getDisallowedActionDescription($action) { static $disallowedActionDescriptions; - + if (! $disallowedActionDescriptions) { $disallowedActionDescriptions = array('browse' => _("Browsing pages"), @@ -629,7 +629,7 @@ function requiredAuthority ($action) { $auth = $this->requiredAuthorityForAction($action); if (!ALLOW_ANON_USER) return WIKIAUTH_USER; - + /* * This is a hook for plugins to require authority * for posting to them. @@ -646,17 +646,17 @@ } return $auth; } - + function requiredAuthorityForAction ($action) { global $DisabledActions; - + if ($DisabledActions and in_array($action, $DisabledActions)) return WIKIAUTH_UNOBTAINABLE; - + if (ENABLE_PAGEPERM and class_exists("PagePermission")) { return requiredAuthorityForPage($action); } else { - // FIXME: clean up. + // FIXME: clean up. switch ($action) { case 'browse': case 'viewsource': @@ -755,7 +755,7 @@ SetupWiki($this); $this->finish(); // NORETURN } - + // [574ms] mainly template:printexpansion: 393ms and template::expandsubtemplate [100+70+60ms] function handleAction () { // Check illegal characters in page names: <>[]{}|" @@ -770,10 +770,10 @@ $this->finish(); } $action = $this->getArg('action'); - if ($this->isPost() + if ($this->isPost() and !$this->_user->isAdmin() - and $action != 'browse' - and $action != 'wikitohtml' + and $action != 'browse' + and $action != 'wikitohtml' ) { if ( $page->get('moderation') ) { @@ -784,8 +784,8 @@ $CONTENT = HTML::div ( array('class' => 'wiki-edithelp'), - fmt("%s: action forwarded to a moderator.", - $action), + fmt("%s: action forwarded to a moderator.", + $action), HTML::br(), _("This action requires moderator approval. Please be patient.")); if (!empty($plugin->_tokens['CONTENT'])) @@ -797,7 +797,7 @@ $plugin->_tokens['CONTENT'] = $CONTENT; $title = WikiLink($page->getName()); $title->pushContent(' : ', WikiLink(_("ModeratedPage"))); - GeneratePage(Template('browse', $plugin->_tokens), + GeneratePage(Template('browse', $plugin->_tokens), $title, $page->getCurrentRevision()); $this->finish(); @@ -815,7 +815,7 @@ $this->finish(fmt("%s: Bad action", $action)); } } - + function finish ($errormsg = false) { static $in_exit = 0; @@ -848,7 +848,7 @@ /** * Generally pagename is rawurlencoded for older browsers or mozilla. - * Typing a pagename into the IE bar will utf-8 encode it, so we have to + * Typing a pagename into the IE bar will utf-8 encode it, so we have to * fix that with fixTitleEncoding(). * If USE_PATH_INFO = true, the pagename is stripped from the "/DATA_PATH/PageName&arg=value" line. * If false, we support either "/index.php?pagename=PageName&arg=value", @@ -886,7 +886,7 @@ * QUERY_ARGS (HTTP_GET_VARS). */ global $HTTP_GET_VARS; - if (isset($HTTP_GET_VARS['pagename']) and trim($HTTP_GET_VARS['pagename'])) { + if (isset($HTTP_GET_VARS['pagename']) and trim($HTTP_GET_VARS['pagename'])) { return fixTitleEncoding(rawurldecode($HTTP_GET_VARS['pagename'])); } } @@ -905,14 +905,14 @@ function _deduceAction () { if (!($action = $this->getArg('action'))) { - // TODO: improve this SOAP.php hack by letting SOAP use index.php + // TODO: improve this SOAP.php hack by letting SOAP use index.php // or any other virtual url as with xmlrpc if (defined('WIKI_SOAP') and WIKI_SOAP) return 'soap'; // Detect XML-RPC requests. if ($this->isPost() && ((defined("WIKI_XMLRPC") and WIKI_XMLRPC) - or ($this->get('CONTENT_TYPE') == 'text/xml' + or ($this->get('CONTENT_TYPE') == 'text/xml' or $this->get('CONTENT_TYPE') == 'application/xml') && strstr($GLOBALS['HTTP_RAW_POST_DATA'], '<methodCall>')) ) @@ -950,8 +950,8 @@ return $this->args['auth']['userid']; if ($user = $this->getSessionVar('wiki_user')) { - // Switched auth between sessions. - // Note: There's no way to demandload a missing class-definition + // Switched auth between sessions. + // Note: There's no way to demandload a missing class-definition // afterwards! Stupid php. if (defined('GFORGE') and GFORGE) { if (empty($HTTP_SERVER_VARS['PHP_AUTH_USER'])) { @@ -998,7 +998,7 @@ return false; } - + function findActionPage ($action) { static $cache; if (!$action) return false; @@ -1031,7 +1031,7 @@ } else { $default = $translation; } - + // check for english version if ($action != $translation and $action != $default) { if (isActionPage($action)) @@ -1041,7 +1041,7 @@ trigger_error("$action: Cannot find action page", E_USER_NOTICE); return $cache[$action] = false; } - + function action_browse () { $this->buffer_output(); include_once("lib/display.php"); @@ -1111,8 +1111,8 @@ // Decide between title or fulltextsearch (e.g. both buttons available). // Reformulate URL and redirect. $searchtype = $this->getArg('searchtype'); - $args = array('s' => $this->getArg('searchterm') - ? $this->getArg('searchterm') + $args = array('s' => $this->getArg('searchterm') + ? $this->getArg('searchterm') : $this->getArg('s')); if ($searchtype == 'full' or $searchtype == 'fulltext') { $search_page = _("FullTextSearch"); @@ -1139,7 +1139,7 @@ function action_create () { $this->action_edit(); } - + function action_viewsource () { $this->buffer_output(); include "lib/editpage.php"; @@ -1157,7 +1157,7 @@ $plugin = WikiPluginLoader::getPlugin("ModeratedPage"); if ($retval = $plugin->lock_check($this, $page, $moderated)) $this->setArg('errormsg', $retval); - } + } // check if a link to ModeratedPage exists elseif ($action_page = $page->existLink(_("ModeratedPage"))) { require_once("lib/WikiPlugin.php"); @@ -1202,7 +1202,7 @@ $xmlrpc = new XmlRpcServer($this); $xmlrpc->service(); } - + function action_soap () { if (defined("WIKI_SOAP") and WIKI_SOAP) // already loaded return; @@ -1264,9 +1264,9 @@ function action_captcha () { include_once "lib/Captcha.php"; $captcha = new Captcha(); - $captcha->image ( $captcha->captchaword() ); + $captcha->image ( $captcha->captchaword() ); } - + function action_wikitohtml () { include_once("lib/WysiwygEdit/Wikiwyg.php"); $wikitohtml = new WikiToHtml( $this->getArg("content") , $this); @@ -1330,7 +1330,7 @@ validateSessionPath(); global $request; - if ((DEBUG & _DEBUG_APD) and extension_loaded("apd")) { + if ((DEBUG & _DEBUG_APD) and extension_loaded("apd")) { //apd_set_session_trace(9); apd_set_pprof_trace(); } @@ -1363,13 +1363,13 @@ else define('WIKIDB_NOCACHE_MARKUP', false); // redundant, but explicit } - + // Initialize with system defaults in case user not logged in. // Should this go into the constructor? $request->initializeTheme('default'); $request->updateAuthAndPrefs(); $request->initializeLang(); - + //FIXME: //if ($user->is_authenticated()) // $LogEntry->user = $user->getId(); @@ -1380,7 +1380,7 @@ if (!empty($_PEAR_destructor_object_list)) $_PEAR_destructor_object_list = array(); $request->possiblyDeflowerVirginWiki(); - + $validators = array('wikiname' => WIKI_NAME, 'args' => wikihash($request->getArgs()), 'prefs' => wikihash($request->getPrefs())); @@ -1396,12 +1396,12 @@ // // (If DEBUG if off, this may be a strong validator, but I'm going // to go the paranoid route here pending further study and testing.) - // access hits and edit stats in the footer violate strong ETags also. + // access hits and edit stats in the footer violate strong ETags also. if (1 or DEBUG) { $validators['%weak'] = true; } $request->setValidators($validators); - + $request->handleAction(); if (DEBUG and DEBUG & _DEBUG_INFO) phpinfo(INFO_VARIABLES | INFO_MODULES); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-08-31 13:42:34
|
Revision: 7658 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7658&view=rev Author: vargenau Date: 2010-08-31 13:42:28 +0000 (Tue, 31 Aug 2010) Log Message: ----------- Special case for Gforge Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2010-08-31 12:07:02 UTC (rev 7657) +++ trunk/lib/main.php 2010-08-31 13:42:28 UTC (rev 7658) @@ -1413,11 +1413,14 @@ $request->finish(); } -//$x = error_reporting(); // DEBUG: why is it 1 here? should be E_ALL -if (defined('E_STRICT') and (E_ALL & E_STRICT)) // strict php5? - error_reporting(E_ALL & ~E_STRICT); // exclude E_STRICT -else - error_reporting(E_ALL); // php4 +if ((!GFORGE) || (forge_get_config('installation_environment') != 'production')) { + if (defined('E_STRICT') and (E_ALL & E_STRICT)) // strict php5? + error_reporting(E_ALL & ~E_STRICT); // exclude E_STRICT + else + error_reporting(E_ALL); // php4 +} else { + error_reporting(E_ERROR); +} // don't run the main loop for special requests (test, getimg, xmlrpc, soap, ...) if (!defined('PHPWIKI_NOMAIN') or !PHPWIKI_NOMAIN) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-11-29 09:22:01
|
Revision: 8189 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8189&view=rev Author: vargenau Date: 2011-11-29 09:21:55 +0000 (Tue, 29 Nov 2011) Log Message: ----------- Use sprintf Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2011-11-29 09:07:58 UTC (rev 8188) +++ trunk/lib/main.php 2011-11-29 09:21:55 UTC (rev 8189) @@ -766,7 +766,8 @@ if (preg_match("/[<\[\{\|\"\}\]>]/", $pagename, $matches) > 0) { $CONTENT = HTML::div( array('class' => 'error'), - _("Illegal character '"). $matches[0] . _("' in page name.")); + sprintf(_("Illegal character '%s' in page name."), + $matches[0])); GeneratePage($CONTENT, $pagename); $this->finish(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-11-30 17:04:07
|
Revision: 8205 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8205&view=rev Author: vargenau Date: 2011-11-30 17:04:01 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Check page name length in URL Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2011-11-29 13:38:06 UTC (rev 8204) +++ trunk/lib/main.php 2011-11-30 17:04:01 UTC (rev 8205) @@ -763,6 +763,13 @@ require_once("lib/Template.php"); $page = $this->getPage(); $pagename = $page->getName(); + if (strlen($pagename) > MAX_PAGENAME_LENGTH) { + $pagename = substr($pagename, 0, MAX_PAGENAME_LENGTH-1) . '…'; + $CONTENT = HTML::div(array('class' => 'error'), + _('Page name too long')); + GeneratePage($CONTENT, $pagename); + $this->finish(); + } if (preg_match("/[<\[\{\|\"\}\]>]/", $pagename, $matches) > 0) { $CONTENT = HTML::div( array('class' => 'error'), @@ -1027,7 +1034,7 @@ require_once("lib/plugin/_WikiTranslation.php"); $trans = new WikiPlugin__WikiTranslation(); $trans->lang = $LANG; - $default = $trans->translate_to_en($action, $LANG); + $default = $trans->translate_to_en($action, $LANG); if ($default and isActionPage($default)) return $cache[$action] = $default; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-01-11 12:40:57
|
Revision: 8227 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8227&view=rev Author: vargenau Date: 2012-01-11 12:40:50 +0000 (Wed, 11 Jan 2012) Log Message: ----------- Whitespace only Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2012-01-10 17:10:50 UTC (rev 8226) +++ trunk/lib/main.php 2012-01-11 12:40:50 UTC (rev 8227) @@ -170,11 +170,11 @@ function initializeTheme ($when = 'default') { global $WikiTheme; - // if when = 'default', then first time init (default theme, ...) - // if when = 'login', then check some callbacks - // and maybe the theme changed (other theme defined in pref) - // if when = 'logout', then check other callbacks - // and maybe the theme changed (back to default theme) + // if when = 'default', then first time init (default theme, ...) + // if when = 'login', then check some callbacks + // and maybe the theme changed (other theme defined in pref) + // if when = 'logout', then check other callbacks + // and maybe the theme changed (back to default theme) // Load non-default theme (when = login) if (!empty($this->_prefs->_prefs['theme'])) { @@ -215,28 +215,26 @@ include_once("themes/default/themeinfo.php"); assert(!empty($WikiTheme)); - // Do not execute global init code anymore + // Do not execute global init code anymore - // WikiTheme callbacks - if ($when == 'login') { - $WikiTheme->CbUserLogin($this, $this->_user->_userid); - if (!$this->_user->hasHomePage()) { // NewUser - $WikiTheme->CbNewUserLogin($this, $this->_user->_userid); - if (in_array($this->getArg('action'), array('edit','create'))) - $WikiTheme->CbNewUserEdit($this, $this->_user->_userid); + // WikiTheme callbacks + if ($when == 'login') { + $WikiTheme->CbUserLogin($this, $this->_user->_userid); + if (!$this->_user->hasHomePage()) { // NewUser + $WikiTheme->CbNewUserLogin($this, $this->_user->_userid); + if (in_array($this->getArg('action'), array('edit','create'))) + $WikiTheme->CbNewUserEdit($this, $this->_user->_userid); + } + } elseif ($when == 'logout') { + $WikiTheme->CbUserLogout($this, $this->_user->_userid); + } elseif ($when == 'default') { + $WikiTheme->load(); + if ($this->_user->_level > 0 and !$this->_user->hasHomePage()) { // NewUser + if (in_array($this->getArg('action'), array('edit','create'))) + $WikiTheme->CbNewUserEdit($this, $this->_user->_userid); + } } } - elseif ($when == 'logout') { - $WikiTheme->CbUserLogout($this, $this->_user->_userid); - } - elseif ($when == 'default') { - $WikiTheme->load(); - if ($this->_user->_level > 0 and !$this->_user->hasHomePage()) { // NewUser - if (in_array($this->getArg('action'), array('edit','create'))) - $WikiTheme->CbNewUserEdit($this, $this->_user->_userid); - } - } - } // This really maybe should be part of the constructor, but since it // may involve HTML/template output, the global $request really needs @@ -278,13 +276,13 @@ // Ensure user has permissions for action // HACK ALERT: We may not set the request arg to create, // since the pageeditor has an ugly logic for action == create. - if ($action == 'edit' or $action == 'create') { + if ($action == 'edit' or $action == 'create') { $page = $this->getPage(); if (! $page->exists() ) $action = 'create'; else $action = 'edit'; - } + } if (! ENABLE_PAGEPERM) { // Bug #1438392 by Matt Brown $require_level = $this->requiredAuthority($action); if (! $this->_user->hasAuthority($require_level)) @@ -442,10 +440,10 @@ if (defined('MAIN_setUser')) return; // don't set cookies twice $this->setCookieVar(getCookieName(), $user->getAuthenticatedId(), COOKIE_EXPIRATION_DAYS, COOKIE_DOMAIN); - $isSignedIn = $user->isSignedIn(); + $isSignedIn = $user->isSignedIn(); if ($isSignedIn) { $user->_authhow = 'signin'; - } + } // Save userid to prefs.. if ( empty($this->_user->_prefs)) { @@ -502,13 +500,13 @@ $pass_required = ($require_level >= WIKIAUTH_USER); if ($require_level == WIKIAUTH_UNOBTAINABLE) { global $DisabledActions; - if ($DisabledActions and in_array($action, $DisabledActions)) { + if ($DisabledActions and in_array($action, $DisabledActions)) { $msg = fmt("%s is disallowed on this wiki.", $this->getDisallowedActionDescription($this->getArg('action'))); - $this->finish(); - return; - } - // Is the reason a missing ACL or just wrong user or password? + $this->finish(); + return; + } + // Is the reason a missing ACL or just wrong user or password? if (class_exists('PagePermission')) { $user =& $this->_user; $status = $user->isAuthenticated() ? _("authenticated") : _("not authenticated"); @@ -520,25 +518,25 @@ // TODO: add link to action=setacl $user->PrintLoginForm($this, compact('pass_required'), $msg); $this->finish(); - return; + return; } else { $msg = fmt("%s is disallowed on this wiki.", $this->getDisallowedActionDescription($this->getArg('action'))); $this->_user->PrintLoginForm($this, compact('require_level','pass_required'), $msg); - $this->finish(); - return; + $this->finish(); + return; } } elseif ($require_level == WIKIAUTH_BOGO) $msg = fmt("You must sign in to %s.", $what); elseif ($require_level == WIKIAUTH_USER) { - // LoginForm should display the relevant messages... - $msg = ""; - /*if (!ALLOW_ANON_USER) - $msg = fmt("You must log in first to %s", $what); - else + // LoginForm should display the relevant messages... + $msg = ""; + /*if (!ALLOW_ANON_USER) + $msg = fmt("You must log in first to %s", $what); + else $msg = fmt("You must log in to %s.", $what); - */ + */ } elseif ($require_level == WIKIAUTH_ANON) $msg = fmt("Access for you is forbidden to %s.", $what); else @@ -546,8 +544,8 @@ $this->_user->PrintLoginForm($this, compact('require_level','pass_required'), $msg); - if (!$GLOBALS['WikiTheme']->DUMP_MODE) - $this->finish(); // NORETURN + if (!$GLOBALS['WikiTheme']->DUMP_MODE) + $this->finish(); // NORETURN } // Fixme: for PagePermissions we'll need other strings, @@ -673,20 +671,20 @@ case 'soap': case 'dumphtml': if (INSECURE_ACTIONS_LOCALHOST_ONLY and !is_localhost()) - return WIKIAUTH_ADMIN; - return WIKIAUTH_ANON; + return WIKIAUTH_ADMIN; + return WIKIAUTH_ANON; case 'ziphtml': if (ZIPDUMP_AUTH) return WIKIAUTH_ADMIN; if (INSECURE_ACTIONS_LOCALHOST_ONLY and !is_localhost()) - return WIKIAUTH_ADMIN; - return WIKIAUTH_ANON; + return WIKIAUTH_ADMIN; + return WIKIAUTH_ANON; case 'dumpserial': if (INSECURE_ACTIONS_LOCALHOST_ONLY and is_localhost()) - return WIKIAUTH_ANON; - return WIKIAUTH_ADMIN; + return WIKIAUTH_ANON; + return WIKIAUTH_ADMIN; case 'zip': if (ZIPDUMP_AUTH) @@ -850,7 +848,7 @@ unset($this->_user->_auth_dbi); unset($this->_user->_dbi); unset($this->_user->_request); - } + } Request::finish(); exit; } @@ -973,7 +971,7 @@ } } - // Sessions override http auth + // Sessions override http auth if (!empty($HTTP_SERVER_VARS['PHP_AUTH_USER'])) return $HTTP_SERVER_VARS['PHP_AUTH_USER']; // pubcookie et al @@ -1123,8 +1121,8 @@ function action_search () { // Decide between title or fulltextsearch (e.g. both buttons available). // Reformulate URL and redirect. - $searchtype = $this->getArg('searchtype'); - $args = array('s' => $this->getArg('searchterm') + $searchtype = $this->getArg('searchtype'); + $args = array('s' => $this->getArg('searchterm') ? $this->getArg('searchterm') : $this->getArg('s')); if ($searchtype == 'full' or $searchtype == 'fulltext') { @@ -1132,12 +1130,12 @@ } elseif ($searchtype == 'external') { $s = $args['s']; - $link = new WikiPageName("Search:$s"); // Expand interwiki url. I use xapian-omega + $link = new WikiPageName("Search:$s"); // Expand interwiki url. I use xapian-omega $this->redirect($link->url); } else { $search_page = _("TitleSearch"); - $args['auto_redirect'] = 1; + $args['auto_redirect'] = 1; } $this->redirect(WikiURL($search_page, $args, 'absolute_url')); } @@ -1217,12 +1215,12 @@ } function action_soap () { - if (defined("WIKI_SOAP") and WIKI_SOAP) // already loaded - return; - /* - allow VIRTUAL_PATH or action=soap SOAP access - */ - include_once("SOAP.php"); + if (defined("WIKI_SOAP") and WIKI_SOAP) // already loaded + return; + /* + allow VIRTUAL_PATH or action=soap SOAP access + */ + include_once("SOAP.php"); } function action_revert () { @@ -1287,11 +1285,11 @@ } function action_setpref () { - $what = $this->getArg('pref'); - $value = $this->getArg('value'); - $prefs =& $this->_user->_prefs; - $prefs->set($what, $value); - $num = $this->_user->setPreferences($prefs); + $what = $this->getArg('pref'); + $value = $this->getArg('value'); + $prefs =& $this->_user->_prefs; + $prefs->set($what, $value); + $num = $this->_user->setPreferences($prefs); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-14 16:33:10
|
Revision: 8450 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8450&view=rev Author: vargenau Date: 2012-11-14 16:33:03 +0000 (Wed, 14 Nov 2012) Log Message: ----------- Remove parentheses Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2012-11-14 16:24:39 UTC (rev 8449) +++ trunk/lib/main.php 2012-11-14 16:33:03 UTC (rev 8450) @@ -73,13 +73,13 @@ if ($method == 'Db') switch (DATABASE_TYPE) { case 'SQL' : - include_once("lib/WikiUser/PearDb.php"); + include_once 'lib/WikiUser/PearDb.php'; break; case 'ADODB': - include_once("lib/WikiUser/AdoDb.php"); + include_once 'lib/WikiUser/AdoDb.php'; break; case 'PDO' : - include_once("lib/WikiUser/PdoDb.php"); + include_once 'lib/WikiUser/PdoDb.php'; break; } } @@ -208,7 +208,7 @@ and defined('THEME') and $user_theme != THEME ) { - include_once 'themes/' . THEME . "/themeinfo.php"; + include_once 'themes/'. THEME . '/themeinfo.php'; } if (empty($WikiTheme) and $user_theme) { if (strcspn($user_theme, "./\x00]") != strlen($user_theme)) { @@ -218,10 +218,10 @@ $user_theme = "default"; } if (!$user_theme) $user_theme = "default"; - include_once("themes/$user_theme/themeinfo.php"); + include_once "themes/$user_theme/themeinfo.php"; } if (empty($WikiTheme) and defined('THEME')) - include_once 'themes/' . THEME . "/themeinfo.php"; + include_once 'themes/'. THEME . '/themeinfo.php'; if (empty($WikiTheme)) include_once 'themes/default/themeinfo.php'; assert(!empty($WikiTheme)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-14 17:41:21
|
Revision: 8463 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8463&view=rev Author: vargenau Date: 2012-11-14 17:41:10 +0000 (Wed, 14 Nov 2012) Log Message: ----------- Add action DeleteAcl Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2012-11-14 17:38:49 UTC (rev 8462) +++ trunk/lib/main.php 2012-11-14 17:41:10 UTC (rev 8463) @@ -737,6 +737,7 @@ case 'unlock': case 'upgrade': case 'chown': + case 'deleteacl': case 'setacl': case 'setaclsimple': return WIKIAUTH_ADMIN; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-21 13:20:51
|
Revision: 8512 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8512&view=rev Author: vargenau Date: 2012-11-21 13:20:41 +0000 (Wed, 21 Nov 2012) Log Message: ----------- Remove no longer true comment Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2012-11-21 12:58:40 UTC (rev 8511) +++ trunk/lib/main.php 2012-11-21 13:20:41 UTC (rev 8512) @@ -1396,8 +1396,6 @@ function main() { - - // latest supported: Red Hat Enterprise Linux ES release 4 if (version_compare(PHP_VERSION, '4.3.9', '<')) { exit(_("Your PHP version is too old. You must have at least PHP 4.3.9")); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-21 13:32:05
|
Revision: 8513 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8513&view=rev Author: vargenau Date: 2012-11-21 13:31:52 +0000 (Wed, 21 Nov 2012) Log Message: ----------- PHP_VERSION must be at least 5.2 Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2012-11-21 13:20:41 UTC (rev 8512) +++ trunk/lib/main.php 2012-11-21 13:31:52 UTC (rev 8513) @@ -1396,8 +1396,8 @@ function main() { - if (version_compare(PHP_VERSION, '4.3.9', '<')) { - exit(_("Your PHP version is too old. You must have at least PHP 4.3.9")); + if (version_compare(PHP_VERSION, '5.2', '<')) { + exit(_("Your PHP version is too old. You must have at least PHP 5.2.")); } if (!USE_DB_SESSION) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-10 17:10:00
|
Revision: 8638 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8638&view=rev Author: vargenau Date: 2012-12-10 17:09:53 +0000 (Mon, 10 Dec 2012) Log Message: ----------- Remove unused Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2012-12-10 09:38:01 UTC (rev 8637) +++ trunk/lib/main.php 2012-12-10 17:09:53 UTC (rev 8638) @@ -356,11 +356,11 @@ * @return WikiDB_Page Object with methods to pull data from * database for the page requested. */ - function getPage($pagename = false) + function getPage($pagename = '') { - //if (!isset($this->_dbi)) $this->getDbh(); - if (!$pagename) + if (!$pagename) { $pagename = $this->getArg('pagename'); + } return $this->_dbi->getPage($pagename); } @@ -1351,7 +1351,7 @@ $value = $this->getArg('value'); $prefs =& $this->_user->_prefs; $prefs->set($what, $value); - $num = $this->_user->setPreferences($prefs); + $this->_user->setPreferences($prefs); } } @@ -1444,15 +1444,6 @@ $request->updateAuthAndPrefs(); $request->initializeLang(); - //FIXME: - //if ($user->is_authenticated()) - // $LogEntry->user = $user->getId(); - - // Memory optimization: - // http://www.procata.com/blog/archives/2004/05/27/rephlux-and-php-memory-usage/ - // kill the global PEAR _PEAR_destructor_object_list - if (!empty($_PEAR_destructor_object_list)) - $_PEAR_destructor_object_list = array(); $request->possiblyDeflowerVirginWiki(); $validators = array('wikiname' => WIKI_NAME, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-11 14:01:49
|
Revision: 8641 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8641&view=rev Author: vargenau Date: 2012-12-11 14:01:42 +0000 (Tue, 11 Dec 2012) Log Message: ----------- Use getArg and setArg Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2012-12-11 13:58:48 UTC (rev 8640) +++ trunk/lib/main.php 2012-12-11 14:01:42 UTC (rev 8641) @@ -518,13 +518,15 @@ update_locale(DEFAULT_LANGUAGE); // User does not have required authority. Prompt for login. - $what = $this->getActionDescription($this->getArg('action')); + $action = $this->getArg('action'); + $what = $this->getActionDescription($action); $pass_required = ($require_level >= WIKIAUTH_USER); if ($require_level == WIKIAUTH_UNOBTAINABLE) { global $DisabledActions; if ($DisabledActions and in_array($action, $DisabledActions)) { $msg = fmt("%s is disallowed on this wiki.", $this->getDisallowedActionDescription($this->getArg('action'))); + $this->_user->PrintLoginForm($this, compact('require_level'), $msg); $this->finish(); return; } @@ -979,8 +981,12 @@ { global $HTTP_ENV_VARS; - if (!empty($this->args['auth']) and !empty($this->args['auth']['userid'])) - return $this->args['auth']['userid']; + if ($this->getArg('auth')) { + $auth = $this->getArg('auth'); + if ($auth['userid']) { + return $auth['userid']; + } + } if ($user = $this->getSessionVar('wiki_user')) { // Switched auth between sessions. @@ -1106,11 +1112,11 @@ $this->setArg('verify', 1); // only for POST if ($this->getArg('action') != 'rename') $this->setArg('action', $action); - elseif ($this->getArg('to') && empty($this->args['admin_rename'])) { - $this->args['admin_rename'] - = array('from' => $this->getArg('s'), + elseif ($this->getArg('to') && !$this->getArg('admin_rename')) { + $this->setArg('admin_rename', + array('from' => $this->getArg('s'), 'to' => $this->getArg('to'), - 'action' => 'select'); + 'action' => 'select')); } $this->actionpage($action); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-04-18 09:24:39
|
Revision: 8767 http://sourceforge.net/p/phpwiki/code/8767 Author: vargenau Date: 2013-04-18 09:24:36 +0000 (Thu, 18 Apr 2013) Log Message: ----------- var $_dbi Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2013-04-17 13:15:30 UTC (rev 8766) +++ trunk/lib/main.php 2013-04-18 09:24:36 UTC (rev 8767) @@ -50,7 +50,7 @@ class WikiRequest extends Request { - // var $_dbi; + var $_dbi; function WikiRequest() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2013-07-04 16:35:15
|
Revision: 8829 http://sourceforge.net/p/phpwiki/code/8829 Author: vargenau Date: 2013-07-04 16:35:10 +0000 (Thu, 04 Jul 2013) Log Message: ----------- Avoid warning Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2013-07-04 15:54:04 UTC (rev 8828) +++ trunk/lib/main.php 2013-07-04 16:35:10 UTC (rev 8829) @@ -983,7 +983,7 @@ if ($this->getArg('auth')) { $auth = $this->getArg('auth'); - if ($auth['userid']) { + if (isset($auth['userid'])) { return $auth['userid']; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-09-27 17:54:03
|
Revision: 9129 http://sourceforge.net/p/phpwiki/code/9129 Author: vargenau Date: 2014-09-27 17:53:55 +0000 (Sat, 27 Sep 2014) Log Message: ----------- Add return Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2014-09-26 17:02:59 UTC (rev 9128) +++ trunk/lib/main.php 2014-09-27 17:53:55 UTC (rev 9129) @@ -333,6 +333,7 @@ if (isset($this->_prefs)) { return $this->_prefs->get($key); } + return false; } function & getDbh() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-01-14 12:55:15
|
Revision: 9469 http://sourceforge.net/p/phpwiki/code/9469 Author: vargenau Date: 2015-01-14 12:55:08 +0000 (Wed, 14 Jan 2015) Log Message: ----------- Always create global $request and $WikiTheme Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2015-01-14 12:53:03 UTC (rev 9468) +++ trunk/lib/main.php 2015-01-14 12:55:08 UTC (rev 9469) @@ -1473,8 +1473,14 @@ } // don't run the main loop for special requests (test, getimg, xmlrpc, soap, ...) -if (!defined('PHPWIKI_NOMAIN') or !PHPWIKI_NOMAIN) +if (!defined('PHPWIKI_NOMAIN') or !PHPWIKI_NOMAIN) { main(); +} else { + // We need the global $request and $WikiTheme + $request = new WikiRequest(); + require_once 'lib/WikiTheme.php'; + $WikiTheme = new WikiTheme('default'); +} // Local Variables: // mode: php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-09-16 09:23:26
|
Revision: 9723 http://sourceforge.net/p/phpwiki/code/9723 Author: vargenau Date: 2015-09-16 09:23:24 +0000 (Wed, 16 Sep 2015) Log Message: ----------- Remove forbidden characters: <>[]{}"|# from pagename Modified Paths: -------------- trunk/lib/main.php Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2015-09-10 16:42:44 UTC (rev 9722) +++ trunk/lib/main.php 2015-09-16 09:23:24 UTC (rev 9723) @@ -874,8 +874,17 @@ */ function _deducePagename() { - if (trim(rawurldecode($this->getArg('pagename')))) - return rawurldecode($this->getArg('pagename')); + $raw_name = trim(rawurldecode($this->getArg('pagename'))); + if ($raw_name) { + // Remove forbidden characters: <>[]{}"|# + $forbidden = array('<', '>', '[', ']', '{', '}', '"', '|', '#'); + $safe_name = str_replace($forbidden, '', $raw_name); + if ($safe_name != $raw_name) { + trigger_error(sprintf(_('Illegal chars %s removed'), + '<>[]{}"|#')); + } + return $safe_name; + } if (USE_PATH_INFO) { $pathinfo = $this->get('PATH_INFO'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |