[Linpha-cvs] SF.net SVN: linpha: [4856] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2008-02-07 20:43:39
|
Revision: 4856 http://linpha.svn.sourceforge.net/linpha/?rev=4856&view=rev Author: fangehrn Date: 2008-02-07 12:43:31 -0800 (Thu, 07 Feb 2008) Log Message: ----------- 2008-02-07 flo * AdoDB updated to version 503 * fixed adodb error handler Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/lib/classes/adodb-errorhandler.inc.php trunk/linpha2/lib/classes/linpha.functions.php trunk/linpha2/lib/classes/linpha.sql.class.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2008-02-07 20:22:33 UTC (rev 4855) +++ trunk/linpha2/ChangeLog 2008-02-07 20:43:31 UTC (rev 4856) @@ -1,4 +1,7 @@ +2008-02-07 flo + * AdoDB updated to version 503 + * fixed adodb error handler 2008-02-06 flo * common.php/linpha.class.php Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2008-02-07 20:22:33 UTC (rev 4855) +++ trunk/linpha2/docs/dev/TODO.txt 2008-02-07 20:43:31 UTC (rev 4856) @@ -24,8 +24,6 @@ - should enable browsers cache for the thumbnails and maybe also for the images -- fix (adodb) error handler - - compress javascripts (prototype and scriptaculous) they are now nearly 200KB big @@ -85,7 +83,7 @@ ############################################################################ Open questions ############################################################################ - + - thumbnail size, set a max size (for example 150px), to be able to switch the size on fly @@ -110,6 +108,8 @@ DONE ############################################################################ +- fix (adodb) error handler + - php session limit the session cookie not only to domain, but also to full url path we cannot use the same session in localhost/linpha1.0 and localhost/linpha2.0 Modified: trunk/linpha2/lib/classes/adodb-errorhandler.inc.php =================================================================== --- trunk/linpha2/lib/classes/adodb-errorhandler.inc.php 2008-02-07 20:22:33 UTC (rev 4855) +++ trunk/linpha2/lib/classes/adodb-errorhandler.inc.php 2008-02-07 20:43:31 UTC (rev 4856) @@ -30,13 +30,13 @@ */ function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection) { - if (error_reporting() == 0) return; // obey @ protocol + //if (error_reporting() == 0) return; // obey @ protocol switch($fn) { case 'EXECUTE': $sql = $p1; $inputparams = $p2; - $s = "$dbms error: [$errno: $errmsg] in $fn(\"$sql\")\n"; + $s = "$dbms error: [$errno: $errmsg] in $fn(\"$sql\")"; break; case 'PCONNECT': @@ -44,10 +44,10 @@ $host = $p1; $database = $p2; - $s = "$dbms error: [$errno: $errmsg] in $fn($host, '****', '****', $database)\n"; + $s = "$dbms error: [$errno: $errmsg] in $fn($host, '****', '****', $database)"; break; default: - $s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)\n"; + $s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)"; break; } /* @@ -64,16 +64,26 @@ * and optionally, port number, of the socket receiving the debug information. * 3 message is appended to the file destination */ - if (defined('ADODB_ERROR_LOG_TYPE')) { + /*if (defined('ADODB_ERROR_LOG_TYPE')) { $t = date('Y-m-d H:i:s'); if (defined('ADODB_ERROR_LOG_DEST')) error_log("($t) $s", ADODB_ERROR_LOG_TYPE, ADODB_ERROR_LOG_DEST); else error_log("($t) $s", ADODB_ERROR_LOG_TYPE); - } + }*/ //print "<p>$s</p>"; - trigger_error($s,ADODB_ERROR_HANDLER_TYPE); + //trigger_error($s,ADODB_ERROR_HANDLER_TYPE); + + /** + * if adodb errorhandler is used, the function $db->ErrorMsg() does not work + * anymore + * -> output the error to screen + * -> no need anymore for : + * if(!$create) { echo $GLOBALS['db']->ErrorMsg().'<br />'; } + */ + echo $s.'<br />'; + linLog(LOG_TYPE_DB, LOG_ERR, 'adodb', $s); } ?> Modified: trunk/linpha2/lib/classes/linpha.functions.php =================================================================== --- trunk/linpha2/lib/classes/linpha.functions.php 2008-02-07 20:22:33 UTC (rev 4855) +++ trunk/linpha2/lib/classes/linpha.functions.php 2008-02-07 20:43:31 UTC (rev 4856) @@ -594,9 +594,11 @@ /** * don't trust $text (contains $_GET and $_POST data) * see also linpha advisory http://secunia.com/advisories/18808/ - * and for more details http://retrogod.altervista.org/linpha_10_local.html + * and for more details http://retrogod.altervista.org/linpha_10_local.html + * + * still use this even if file has a random name, its to dangerous to */ - $text = htmlspecialchars($text, ENT_QUOTES); + $text = htmlentities($text, ENT_QUOTES); /** * Process Log Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2008-02-07 20:22:33 UTC (rev 4855) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2008-02-07 20:43:31 UTC (rev 4856) @@ -46,6 +46,7 @@ if(isset($_SESSION['installmode1'])) { + include_once(LINPHA_DIR.'/lib/classes/adodb-errorhandler.inc.php'); $db_type = $_SESSION['sql_dbtype']; $db_hostname = $_SESSION['sql_hostname']; $db_username = $_SESSION['sql_username']; @@ -56,9 +57,9 @@ } else { - error_reporting(0); - include_once(LINPHA_DIR.'/lib/classes/adodb-errorhandler.inc.php'); - + error_reporting(0); + include_once(LINPHA_DIR.'/lib/classes/adodb-errorhandler.inc.php'); + /** * if this file does not exists we already switch to installer */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |