From a749d48dad4cdb0708ff272129338fa46fff7c2c Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 7 Dec 2010 08:04:00 +0000 Subject: [PATCH] Fixed multiply strict warnings, fixed error handling on php 5.3 --- config.default.php | 4 +++- reporting/includes/class.pdf.inc | 2 +- reporting/includes/pdf_report.inc | 21 +-------------------- reporting/includes/tcpdf.php | 12 ++++++------ 4 files changed, 11 insertions(+), 28 deletions(-) diff --git a/config.default.php b/config.default.php index e69595f3..09dc03a1 100644 --- a/config.default.php +++ b/config.default.php @@ -20,6 +20,8 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_to_root'])) die("Restricted access"); + if (!defined(E_STRICT)) + define('E_STRICT', 2048); // for php4 // Log file for error/warning messages. Should be set to any location // writable by www server. When set to empty string logging is switched off. // Special value 'syslog' can be used for system logger usage (see php manual). @@ -39,7 +41,7 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_ $select_trail = 0; // track also SELECT queries if ($go_debug > 0) { - error_reporting(E_ALL); + error_reporting(E_ALL&E_STRICT); ini_set("display_errors", "On"); } else diff --git a/reporting/includes/class.pdf.inc b/reporting/includes/class.pdf.inc index 0bf38d8f..44b62b43 100644 --- a/reporting/includes/class.pdf.inc +++ b/reporting/includes/class.pdf.inc @@ -251,7 +251,7 @@ class Cpdf extends FPDI { * nSeg is not allowed to be less than 2, as this will simply draw a line (and will even draw a * pretty crappy shape at 2, as we are approximating with bezier curves. */ - function ellipse($x0,$y0,$r1,$r2=0,$angle=0,$nSeg=8,$astart=0,$afinish=360,$close=1,$fill=0) + function ellipse($x0,$y0,$r1,$r2=0,$angle=0,$nSeg=8,$astart=0,$afinish=360,$close=1,$fill=0, $dummy=null) { parent::Ellipse($x0, $y0, $r1, $r2, $angle, $astart. $afinish, ($close?'C':''), "", "", $nSeg); } diff --git a/reporting/includes/pdf_report.inc b/reporting/includes/pdf_report.inc index 6eb0b89e..daacbd2d 100644 --- a/reporting/includes/pdf_report.inc +++ b/reporting/includes/pdf_report.inc @@ -715,25 +715,6 @@ class FrontReport extends Cpdf return $drawColor; } - function SetDrawColor($r, $g, $b) - { - parent::SetDrawColor($r, $g, $b); - } - - function SetTextColor($r, $g, $b) - { - parent::SetTextColor($r, $g, $b); - } - - /** - * Set the fill color for table cells. - * @see reporting/includes/TCPDF#SetFillColor($col1, $col2, $col3, $col4) - */ - function SetFillColor($r, $g, $b) - { - parent::SetFillColor($r, $g, $b); - } - // Get current cell padding setting from TCPDF object function GetCellPadding() { @@ -867,7 +848,7 @@ class FrontReport extends Cpdf parent::line($from, $row, $to, $row2); } - function Line($row, $height = 0) + function Line($row, $height = 0, $dummy1=null, $dummy2=null, $dummy3=null) { $oldLineWidth = $this->GetLineWidth(); $this->SetLineWidth($height + 1); diff --git a/reporting/includes/tcpdf.php b/reporting/includes/tcpdf.php index 8f217855..326ffa61 100644 --- a/reporting/includes/tcpdf.php +++ b/reporting/includes/tcpdf.php @@ -3597,8 +3597,8 @@ if (!class_exists('TCPDF')) { if ($type == "jpg") { $type = "jpeg"; } - $mqr = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); + $mqr = ini_get('magic_quotes_runtime'); + ini_set('magic_quotes_runtime', 0); // Specific image handlers $mtd = '_parse'.$type; // GD image handler function @@ -3625,7 +3625,7 @@ if (!class_exists('TCPDF')) { //If false, we cannot process image return; } - set_magic_quotes_runtime($mqr); + ini_set('magic_quotes_runtime', $mqr); $info['i'] = count($this->images) + 1; // add image to document $this->images[$file] = $info; @@ -4505,8 +4505,8 @@ if (!class_exists('TCPDF')) { $this->_out('<>'); $this->_out('endobj'); } - $mqr = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); + $mqr = ini_get('magic_quotes_runtime'); + ini_set('magic_quotes_runtime', 0); foreach($this->FontFiles as $file => $info) { //Font file embedding $this->_newobj(); @@ -4536,7 +4536,7 @@ if (!class_exists('TCPDF')) { $this->_putstream($font); $this->_out('endobj'); } - set_magic_quotes_runtime($mqr); + ini_set('magic_quotes_runtime', $mgr); foreach($this->fonts as $k => $font) { //Font objects $this->fonts[$k]['n'] = $this->n + 1; -- 2.30.2