From: <ru...@us...> - 2009-08-24 12:29:12
|
Revision: 7084 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7084&view=rev Author: rurban Date: 2009-08-24 12:29:06 +0000 (Mon, 24 Aug 2009) Log Message: ----------- minor convenience re-arrangemen Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2009-08-24 12:24:02 UTC (rev 7083) +++ trunk/lib/Request.php 2009-08-24 12:29:06 UTC (rev 7084) @@ -1,7 +1,7 @@ <?php // -*-php-*- rcs_id('$Id$'); /* - Copyright (C) 2002,2004,2005,2006 $ThePhpWikiProgrammingTeam + Copyright (C) 2002,2004,2005,2006,2009 $ThePhpWikiProgrammingTeam This file is part of PhpWiki. @@ -344,7 +344,8 @@ elseif (isCGI()) // necessary? $compress = false; - if ($this->getArg('start_debug') or $this->getArg('nocache')) + if ($this->getArg('start_debug')) $compress = false; + if ($this->getArg('nocache')) $compress = false; // Should we compress even when apache_note is not available? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2010-06-19 22:08:16
|
Revision: 7552 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7552&view=rev Author: rurban Date: 2010-06-19 22:08:10 +0000 (Sat, 19 Jun 2010) Log Message: ----------- fix Bug #3018484 deprecated session_register since php-5.3 Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2010-06-19 20:16:19 UTC (rev 7551) +++ trunk/lib/Request.php 2010-06-19 22:08:10 UTC (rev 7552) @@ -579,7 +579,8 @@ $vars[$key] = $val; if (isset($_SESSION)) // php-5.2 $_SESSION[$key] = $val; - session_register($key); + if (!check_php_version(5,3)) + session_register($key); } function delete($key) { @@ -588,7 +589,10 @@ unset($GLOBALS[$key]); if (DEBUG) trigger_error("delete session $key", E_USER_WARNING); unset($vars[$key]); - session_unregister($key); + if (isset($_SESSION)) // php-5.2 + unset($_SESSION[$key]); + if (!check_php_version(5,3)) + session_unregister($key); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-11-14 13:25:31
|
Revision: 8427 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8427&view=rev Author: vargenau Date: 2012-11-14 13:25:20 +0000 (Wed, 14 Nov 2012) Log Message: ----------- elseif Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2012-11-14 11:26:33 UTC (rev 8426) +++ trunk/lib/Request.php 2012-11-14 13:25:20 UTC (rev 8427) @@ -831,7 +831,7 @@ while (($header = fgets($fd, 4096))) { if (trim($header) == '') { break; - } else if (!preg_match('/^content-(length|type):/i', $header)) { + } elseif (!preg_match('/^content-(length|type):/i', $header)) { rewind($fd); break; } 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:30:39
|
Revision: 8458 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8458&view=rev Author: vargenau Date: 2012-11-14 17:30:28 +0000 (Wed, 14 Nov 2012) Log Message: ----------- get_old is false for FUSIONFORGE Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2012-11-14 17:10:09 UTC (rev 8457) +++ trunk/lib/Request.php 2012-11-14 17:30:28 UTC (rev 8458) @@ -653,6 +653,9 @@ function get_old($key) { + if (defined('FUSIONFORGE') and FUSIONFORGE) { + return false; + } $vars = &$GLOBALS['HTTP_COOKIE_VARS']; if (isset($vars[$key])) { @$decode = base64_decode($vars[$key]); 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:31:33
|
Revision: 8459 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8459&view=rev Author: vargenau Date: 2012-11-14 17:31:23 +0000 (Wed, 14 Nov 2012) Log Message: ----------- ob_get_level Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2012-11-14 17:30:28 UTC (rev 8458) +++ trunk/lib/Request.php 2012-11-14 17:31:23 UTC (rev 8459) @@ -436,8 +436,12 @@ $this->_do_chunked_output = true; if (empty($this->_ob_get_length)) $this->_ob_get_length = 0; $this->_ob_get_length += ob_get_length(); - while (@ob_end_flush()) ; - @ob_end_clean(); + while (ob_get_level() > 0) { + ob_end_flush(); + } + if (ob_get_level() > 0) { + ob_end_clean(); + } ob_start(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-11 13:58:19
|
Revision: 8639 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8639&view=rev Author: vargenau Date: 2012-12-11 13:58:10 +0000 (Tue, 11 Dec 2012) Log Message: ----------- Explicitely declare var $args in class Request Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2012-12-10 17:09:53 UTC (rev 8638) +++ trunk/lib/Request.php 2012-12-11 13:58:10 UTC (rev 8639) @@ -22,6 +22,7 @@ class Request { + var $args = array(); function Request() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-03 15:23:06
|
Revision: 9184 http://sourceforge.net/p/phpwiki/code/9184 Author: vargenau Date: 2014-10-03 15:22:58 +0000 (Fri, 03 Oct 2014) Log Message: ----------- function ob_get_level Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-10-03 15:22:05 UTC (rev 9183) +++ trunk/lib/Request.php 2014-10-03 15:22:58 UTC (rev 9184) @@ -431,8 +431,7 @@ function chunkOutput() { if (!empty($this->_is_buffering_output) - or - (function_exists('ob_get_level') and @ob_get_level()) + or (@ob_get_level()) ) { $this->_do_chunked_output = true; if (empty($this->_ob_get_length)) $this->_ob_get_length = 0; @@ -476,7 +475,7 @@ } $this->_is_buffering_output = false; ob_end_flush(); - } elseif (function_exists('ob_get_level') and @ob_get_level()) { + } elseif (@ob_get_level()) { ob_end_flush(); } session_write_close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-14 12:14:27
|
Revision: 9258 http://sourceforge.net/p/phpwiki/code/9258 Author: vargenau Date: 2014-10-14 12:14:19 +0000 (Tue, 14 Oct 2014) Log Message: ----------- Remove get_magic_quotes_gpc Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-10-14 10:28:21 UTC (rev 9257) +++ trunk/lib/Request.php 2014-10-14 12:14:19 UTC (rev 9258) @@ -26,7 +26,6 @@ function __construct() { - $this->_fix_magic_quotes_gpc(); $this->_fix_multipart_form_data(); switch ($this->get('REQUEST_METHOD')) { @@ -540,21 +539,6 @@ return Request_UploadedFile::getUploadedFile($key); } - function _fix_magic_quotes_gpc() - { - $needs_fix = array('HTTP_POST_VARS', - 'HTTP_GET_VARS', - 'HTTP_COOKIE_VARS', - 'HTTP_SERVER_VARS', - 'HTTP_POST_FILES'); - - // Fix magic quotes. - if (get_magic_quotes_gpc()) { - foreach ($needs_fix as $vars) - $this->_stripslashes($GLOBALS[$vars]); - } - } - function _stripslashes(&$var) { if (is_array($var)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-14 12:20:14
|
Revision: 9259 http://sourceforge.net/p/phpwiki/code/9259 Author: vargenau Date: 2014-10-14 12:20:10 +0000 (Tue, 14 Oct 2014) Log Message: ----------- Add private Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-10-14 12:14:19 UTC (rev 9258) +++ trunk/lib/Request.php 2014-10-14 12:20:10 UTC (rev 9259) @@ -539,7 +539,7 @@ return Request_UploadedFile::getUploadedFile($key); } - function _stripslashes(&$var) + private function _stripslashes(&$var) { if (is_array($var)) { foreach ($var as $key => $val) @@ -548,13 +548,13 @@ $var = stripslashes($var); } - function _fix_multipart_form_data() + private function _fix_multipart_form_data() { if (preg_match('|^multipart/form-data|', $this->get('CONTENT_TYPE'))) $this->_strip_leading_nl($GLOBALS['HTTP_POST_VARS']); } - function _strip_leading_nl(&$var) + private function _strip_leading_nl(&$var) { if (is_array($var)) { foreach ($var as $key => $val) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-18 17:06:24
|
Revision: 9331 http://sourceforge.net/p/phpwiki/code/9331 Author: vargenau Date: 2014-11-18 17:06:22 +0000 (Tue, 18 Nov 2014) Log Message: ----------- Allow PDO. Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-11-18 16:26:56 UTC (rev 9330) +++ trunk/lib/Request.php 2014-11-18 17:06:22 UTC (rev 9331) @@ -855,10 +855,10 @@ register_shutdown_function("Request_AccessLogEntry_shutdown_function"); if ($do_sql) { - global $DBParams; - if (!in_array($DBParams['dbtype'], array('SQL', 'ADODB'))) { - trigger_error("Unsupported database backend for ACCESS_LOG_SQL. Need DATABASE_TYPE=SQL or ADODB."); + if (!$request->_dbi->isSQL()) { + trigger_error("Unsupported database backend for ACCESS_LOG_SQL. Need DATABASE_TYPE=SQL or ADODB or PDO."); } else { + global $DBParams; //$this->_dbi =& $request->_dbi; $this->logtable = (!empty($DBParams['prefix']) ? $DBParams['prefix'] : '') . "accesslog"; } @@ -944,7 +944,8 @@ } /** - * Read sequentially all previous entries from log file. + * Read sequentially backwards all previous entries from log file. + * FIXME! */ function read_file() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-18 17:15:18
|
Revision: 9333 http://sourceforge.net/p/phpwiki/code/9333 Author: vargenau Date: 2014-11-18 17:15:15 +0000 (Tue, 18 Nov 2014) Log Message: ----------- Do not use void function result Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-11-18 17:12:05 UTC (rev 9332) +++ trunk/lib/Request.php 2014-11-18 17:15:15 UTC (rev 9333) @@ -511,12 +511,12 @@ unset($val->_HomePagehandle); unset($val->_auth_dbi); } - return $this->session->set($key, $val); + $this->session->set($key, $val); } function deleteSessionVar($key) { - return $this->session->delete($key); + $this->session->delete($key); } function getCookieVar($key) @@ -526,12 +526,12 @@ function setCookieVar($key, $val, $lifetime_in_days = false, $path = false) { - return $this->cookies->set($key, $val, $lifetime_in_days, $path); + $this->cookies->set($key, $val, $lifetime_in_days, $path); } function deleteCookieVar($key) { - return $this->cookies->delete($key); + $this->cookies->delete($key); } function getUploadedFile($key) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-19 10:16:15
|
Revision: 9336 http://sourceforge.net/p/phpwiki/code/9336 Author: vargenau Date: 2014-11-19 10:16:06 +0000 (Wed, 19 Nov 2014) Log Message: ----------- Fix database backend test Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-11-18 17:32:01 UTC (rev 9335) +++ trunk/lib/Request.php 2014-11-19 10:16:06 UTC (rev 9336) @@ -838,8 +838,6 @@ */ function __construct($logfile, $do_sql = false) { - //global $request; // request not yet initialized! - $this->logfile = $logfile; if ($logfile and !is_writeable($logfile)) { trigger_error @@ -850,16 +848,13 @@ 'ACCESS_LOG') , E_USER_NOTICE); } - //$request->_accesslog =& $this; - //if (empty($request->_accesslog->entries)) register_shutdown_function("Request_AccessLogEntry_shutdown_function"); if ($do_sql) { - if (!$request->_dbi->isSQL()) { + global $DBParams; + if (!in_array($DBParams['dbtype'], array('SQL', 'ADODB', 'PDO'))) { trigger_error("Unsupported database backend for ACCESS_LOG_SQL. Need DATABASE_TYPE=SQL or ADODB or PDO."); } else { - global $DBParams; - //$this->_dbi =& $request->_dbi; $this->logtable = (!empty($DBParams['prefix']) ? $DBParams['prefix'] : '') . "accesslog"; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-23 18:26:29
|
Revision: 9364 http://sourceforge.net/p/phpwiki/code/9364 Author: vargenau Date: 2014-11-23 18:26:27 +0000 (Sun, 23 Nov 2014) Log Message: ----------- PHP Doc; add class variables Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2014-11-21 17:11:59 UTC (rev 9363) +++ trunk/lib/Request.php 2014-11-23 18:26:27 UTC (rev 9364) @@ -23,6 +23,12 @@ class Request { public $args = array(); + public $_validators; + private $_is_compressing_output; + public $_is_buffering_output; + public $_ob_get_length; + private $_do_chunked_output; + public $_finishing; function __construct() { @@ -103,7 +109,7 @@ } // Well oh well. Do we really want to pass POST params back as GET? - function getURLtoSelf($args = false, $exclude = array()) + function getURLtoSelf($args = array(), $exclude = array()) { $get_args = $this->args; if ($args) @@ -513,11 +519,6 @@ $this->session->set($key, $val); } - function deleteSessionVar($key) - { - $this->session->delete($key); - } - function getCookieVar($key) { return $this->cookies->get($key); @@ -684,7 +685,6 @@ if (isset($deleted[$key])) return; if (defined('WIKI_XMLRPC') and WIKI_XMLRPC) return; - $vars = &$GLOBALS['HTTP_COOKIE_VARS']; if (!defined('COOKIE_DOMAIN')) @setcookie($key, '', 0); else @@ -709,7 +709,7 @@ $this->_info = $fileinfo; } - function getUploadedFile($postname) + static function getUploadedFile($postname) { global $HTTP_POST_FILES; @@ -832,6 +832,9 @@ */ class Request_AccessLog { + public $reader; + public $sqliter; + /** * @param string $logfile Log file name. * @param bool $do_sql @@ -910,8 +913,10 @@ { if ($external_only) { // see stdlin.php:isExternalReferrer() $base = SERVER_URL; - $blen = strlen($base); + } else { + $base = ''; } + $blen = strlen($base); if (!empty($this->_dbi)) { // check same hosts in referer and request and remove them $ext_where = " AND LEFT(referer,$blen) <> " . $this->_dbi->quote($base) @@ -944,7 +949,6 @@ */ function read_file() { - global $request; if ($this->logfile) $this->logfile = ACCESS_LOG; // support Request_AccessLog::read if (empty($this->reader)) // start at the beginning @@ -1013,6 +1017,17 @@ class Request_AccessLogEntry { + public $host; + public $ident; + public $user; + public $request; + public $referer; + public $user_agent; + public $duration; + public $request_args; + public $request_method; + public $request_uri; + /** * The log entry will be automatically appended to the log file or * SQL table when the current request terminates. @@ -1322,6 +1337,10 @@ return $this->_mtime; } + /** + * @param Request $request + * @return int + */ function checkConditionalRequest(&$request) { $result = max($this->_checkIfUnmodifiedSince($request), @@ -1340,6 +1359,10 @@ return false; } + /** + * @param Request $request + * @return int + */ function _checkIfUnmodifiedSince(&$request) { if ($this->_mtime !== false) { @@ -1350,6 +1373,10 @@ return _HTTP_VAL_PASS; } + /** + * @param Request $request + * @return int + */ function _checkIfModifiedSince(&$request) { if ($this->_mtime !== false and $request->isGetOrHead()) { @@ -1363,6 +1390,10 @@ return _HTTP_VAL_PASS; } + /** + * @param Request $request + * @return int + */ function _checkIfMatch(&$request) { if ($this->_tag && ($taglist = $request->get("HTTP_IF_MATCH"))) { @@ -1373,6 +1404,10 @@ return _HTTP_VAL_PASS; } + /** + * @param Request $request + * @return int + */ function _checkIfNoneMatch(&$request) { if ($this->_tag && ($taglist = $request->get("HTTP_IF_NONE_MATCH"))) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-07-20 12:47:25
|
Revision: 9891 http://sourceforge.net/p/phpwiki/code/9891 Author: vargenau Date: 2016-07-20 12:47:23 +0000 (Wed, 20 Jul 2016) Log Message: ----------- Fix buffer conflict with Fusionforge Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2016-07-20 12:36:47 UTC (rev 9890) +++ trunk/lib/Request.php 2016-07-20 12:47:23 UTC (rev 9891) @@ -26,6 +26,7 @@ private $_is_compressing_output; public $_is_buffering_output; public $_ob_get_length; + private $_ob_initial_level; private $_do_chunked_output; public $_finishing; @@ -33,6 +34,8 @@ { global $request; + $this->_ob_initial_level = ob_get_level(); + $this->_fix_multipart_form_data(); switch ($this->get('REQUEST_METHOD')) { @@ -440,15 +443,15 @@ function chunkOutput() { if (!empty($this->_is_buffering_output) - or (@ob_get_level()) + or (@ob_get_level() > $this->_ob_initial_level) ) { $this->_do_chunked_output = true; if (empty($this->_ob_get_length)) $this->_ob_get_length = 0; $this->_ob_get_length += ob_get_length(); - while (ob_get_level() > 0) { + while (ob_get_level() > $this->_ob_initial_level) { ob_end_flush(); } - if (ob_get_level() > 0) { + if (ob_get_level() > $this->_ob_initial_level) { ob_end_clean(); } ob_start(); @@ -484,7 +487,7 @@ } $this->_is_buffering_output = false; ob_end_flush(); - } elseif (@ob_get_level()) { + } elseif (@ob_get_level() > $this->_ob_initial_level) { ob_end_flush(); } session_write_close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-20 09:23:01
|
Revision: 10578 http://sourceforge.net/p/phpwiki/code/10578 Author: vargenau Date: 2021-09-20 09:22:59 +0000 (Mon, 20 Sep 2021) Log Message: ----------- Cases 1 and 2 are the same Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2021-09-20 09:19:42 UTC (rev 10577) +++ trunk/lib/Request.php 2021-09-20 09:22:59 UTC (rev 10578) @@ -692,8 +692,6 @@ // errmsgs by Shilad Sen switch ($err) { case 1: - trigger_error(_("Upload error: file too big"), E_USER_WARNING); - break; case 2: trigger_error(_("Upload error: file too big"), E_USER_WARNING); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2025-02-14 07:58:36
|
Revision: 11107 http://sourceforge.net/p/phpwiki/code/11107 Author: carstenklapp Date: 2025-02-14 07:58:34 +0000 (Fri, 14 Feb 2025) Log Message: ----------- don't compress output when debug is on to avoid garbage on page Modified Paths: -------------- trunk/lib/Request.php Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2025-02-14 07:44:03 UTC (rev 11106) +++ trunk/lib/Request.php 2025-02-14 07:58:34 UTC (rev 11107) @@ -370,6 +370,10 @@ if ($this->getArg('nocache')) { $compress = false; } + // Don't compress page when DEBUG is on because of custom errorhandlers + if (defined('DEBUG') and DEBUG) { + $compress = false; + } // Should we compress even when apache_note is not available? // sf.net bug #933183 and http://bugs.php.net/17557 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |