2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Fix for warnings/notices/deprecated messages on PHP 7.4

This commit is contained in:
Adam Zammit
2021-01-28 14:07:17 +11:00
parent e7093af41e
commit ead8e5f0ea
53 changed files with 152 additions and 248 deletions

View File

@@ -94,8 +94,8 @@ if (isset($_POST['day']))
$val = intval($val); $val = intval($val);
$key = intval($key); $key = intval($key);
$start = $db->qstr($_POST['start'][$key],get_magic_quotes_gpc()); $start = $db->qstr($_POST['start'][$key],0);
$end = $db->qstr($_POST['end'][$key],get_magic_quotes_gpc()); $end = $db->qstr($_POST['end'][$key],0);
$sql = "INSERT INTO availability (day_of_week,start,end,availability_group_id) $sql = "INSERT INTO availability (day_of_week,start,end,availability_group_id)
VALUES ('$val',$start,$end,$availability_group)"; VALUES ('$val',$start,$end,$availability_group)";

View File

@@ -88,8 +88,8 @@ if (isset($_POST['day']))
$val = intval($val); $val = intval($val);
$key = intval($key); $key = intval($key);
$start = $db->qstr($_POST['start'][$key],get_magic_quotes_gpc()); $start = $db->qstr($_POST['start'][$key],0);
$end = $db->qstr($_POST['end'][$key],get_magic_quotes_gpc()); $end = $db->qstr($_POST['end'][$key],0);
$sql = "INSERT INTO call_restrict (day_of_week,start,end) $sql = "INSERT INTO call_restrict (day_of_week,start,end)
VALUES ('$val',$start,$end)"; VALUES ('$val',$start,$end)";

View File

@@ -61,11 +61,11 @@ $client =""; $firstname="";$lastname="";$email=""; $time_zone_name="";
if (isset($_POST['client']) && !empty($_POST['client'])) if (isset($_POST['client']) && !empty($_POST['client']))
{ {
$client = $db->qstr($_POST['client'],get_magic_quotes_gpc()); $client = $db->qstr($_POST['client'],0);
$firstname = $db->qstr($_POST['firstname'],get_magic_quotes_gpc()); $firstname = $db->qstr($_POST['firstname'],0);
$email = $db->qstr($_POST['email'],get_magic_quotes_gpc()); $email = $db->qstr($_POST['email'],0);
$lastname = $db->qstr($_POST['lastname'],get_magic_quotes_gpc()); $lastname = $db->qstr($_POST['lastname'],0);
$time_zone_name = $db->qstr($_POST['Time_zone_name'],get_magic_quotes_gpc()); $time_zone_name = $db->qstr($_POST['Time_zone_name'],0);
/* check if there'a record with this username*/ /* check if there'a record with this username*/
$sql = "SELECT `username`,`client_id` from client WHERE `username` LIKE $client"; $sql = "SELECT `username`,`client_id` from client WHERE `username` LIKE $client";

View File

@@ -56,14 +56,14 @@ $a = false;
if (isset($_POST['operator']) && isset($_POST['adduser'])) if (isset($_POST['operator']) && isset($_POST['adduser']))
{ {
$operator = $db->qstr($_POST['operator'],get_magic_quotes_gpc()); $operator = $db->qstr($_POST['operator'],0);
$email= $db->qstr($_POST['email'],get_magic_quotes_gpc()); $email= $db->qstr($_POST['email'],0);
$password = $db->qstr($_POST['password'],get_magic_quotes_gpc()); $password = $db->qstr($_POST['password'],0);
$firstname = $db->qstr($_POST['firstname'],get_magic_quotes_gpc()); $firstname = $db->qstr($_POST['firstname'],0);
$lastname = $db->qstr($_POST['lastname'],get_magic_quotes_gpc()); $lastname = $db->qstr($_POST['lastname'],0);
$chat_user = $db->qstr($_POST['chat_user'],get_magic_quotes_gpc()); $chat_user = $db->qstr($_POST['chat_user'],0);
$chat_password = $db->qstr($_POST['chat_password'],get_magic_quotes_gpc()); $chat_password = $db->qstr($_POST['chat_password'],0);
$time_zone_name = $db->qstr($_POST['Time_zone_name'],get_magic_quotes_gpc()); $time_zone_name = $db->qstr($_POST['Time_zone_name'],0);
$extension = ""; $extension = "";
if (FREEPBX_PATH != false) if (FREEPBX_PATH != false)
{ {

View File

@@ -311,9 +311,9 @@ if (isset($_POST['update']) && isset($_GET['modify']))
if ($respsc == 1) if ($respsc == 1)
{ {
$lime_mode = $db->qstr($_POST['lime_mode'],get_magic_quotes_gpc()); $lime_mode = $db->qstr($_POST['lime_mode'],0);
$lime_template = $db->qstr($_POST['lime_template'],get_magic_quotes_gpc()); $lime_template = $db->qstr($_POST['lime_template'],0);
$lime_endurl = $db->qstr($_POST['lime_endurl'],get_magic_quotes_gpc()); $lime_endurl = $db->qstr($_POST['lime_endurl'],0);
$sql = "UPDATE questionnaire $sql = "UPDATE questionnaire
SET lime_mode = $lime_mode, lime_template = $lime_template, lime_endurl = $lime_endurl SET lime_mode = $lime_mode, lime_template = $lime_template, lime_endurl = $lime_endurl

View File

@@ -85,8 +85,8 @@ if (isset($_POST['day']))
$val = intval($val); $val = intval($val);
$key = intval($key); $key = intval($key);
$start = $db->qstr($_POST['start'][$key],get_magic_quotes_gpc()); $start = $db->qstr($_POST['start'][$key],0);
$end = $db->qstr($_POST['end'][$key],get_magic_quotes_gpc()); $end = $db->qstr($_POST['end'][$key],0);
$sql = "INSERT INTO shift_template(day_of_week,start,end) $sql = "INSERT INTO shift_template(day_of_week,start,end)
VALUES ($val,$start,$end)"; VALUES ($val,$start,$end)";

View File

@@ -72,7 +72,7 @@ if (isset($_GET['time_zone']))
{ {
//need to add sample to questionnaire //need to add sample to questionnaire
$tz = $db->qstr($_GET['time_zone'],get_magic_quotes_gpc()); $tz = $db->qstr($_GET['time_zone'],0);
$sql = "INSERT INTO timezone_template(Time_zone_name) $sql = "INSERT INTO timezone_template(Time_zone_name)
VALUES($tz)"; VALUES($tz)";
@@ -85,7 +85,7 @@ if (isset($_GET['tz']))
{ {
//need to remove rsid from questionnaire //need to remove rsid from questionnaire
$tz = $db->qstr($_GET['tz'],get_magic_quotes_gpc()); $tz = $db->qstr($_GET['tz'],0);
$sql = "DELETE FROM timezone_template $sql = "DELETE FROM timezone_template
WHERE Time_zone_name = $tz"; WHERE Time_zone_name = $tz";

View File

@@ -57,9 +57,9 @@ function sRandomChars($length = 15,$pattern="23456789abcdefghijkmnpqrstuvwxyz")
for($i=0;$i<$length;$i++) for($i=0;$i<$length;$i++)
{ {
if(isset($key)) if(isset($key))
$key .= $pattern{mt_rand(0,$patternlength)}; $key .= $pattern[mt_rand(0,$patternlength)];
else else
$key = $pattern{mt_rand(0,$patternlength)}; $key = $pattern[mt_rand(0,$patternlength)];
} }
return $key; return $key;
} }
@@ -2577,10 +2577,10 @@ function add_respondent($case_id,$firstName,$lastName,$Time_zone_name)
{ {
global $db; global $db;
$case_id = $db->qstr($case_id,get_magic_quotes_gpc()); $case_id = $db->qstr($case_id,0);
$firstName = $db->qstr($firstName,get_magic_quotes_gpc()); $firstName = $db->qstr($firstName,0);
$lastName = $db->qstr($lastName,get_magic_quotes_gpc()); $lastName = $db->qstr($lastName,0);
$Time_zone_name = $db->qstr($Time_zone_name,get_magic_quotes_gpc()); $Time_zone_name = $db->qstr($Time_zone_name,0);
$sql = "INSERT INTO respondent (respondent_id,case_id,firstName,lastName,Time_zone_name) $sql = "INSERT INTO respondent (respondent_id,case_id,firstName,lastName,Time_zone_name)
VALUES (NULL,$case_id,$firstName,$lastName,$Time_zone_name)"; VALUES (NULL,$case_id,$firstName,$lastName,$Time_zone_name)";

View File

@@ -185,7 +185,7 @@ function process_append_data($process_id,$data)
{ {
global $db; global $db;
$data = $db->qstr($data,get_magic_quotes_gpc()); $data = $db->qstr($data,0);
$sql = "INSERT INTO `process_log` (process_log_id,process_id,datetime,data) $sql = "INSERT INTO `process_log` (process_log_id,process_id,datetime,data)
VALUES (NULL,'$process_id',NOW(),$data)"; VALUES (NULL,'$process_id',NOW(),$data)";

View File

@@ -241,8 +241,8 @@ function checkQuestions($postsid, $surveyid, $qtypes)
} }
$fieldlist=array_reverse($fieldlist); //let's always change the later duplicate, not the earlier one $fieldlist=array_reverse($fieldlist); //let's always change the later duplicate, not the earlier one
} }
$checkKeysUniqueComparison = create_function('$value','if ($value > 1) return true;'); //$checkKeysUniqueComparison = create_function('$value','if ($value > 1) return true;');
@$duplicates = array_keys (array_filter (array_count_values($fieldlist), $checkKeysUniqueComparison)); @$duplicates = array_keys (array_filter (array_count_values($fieldlist), function($k) { if ($k > 1) return true; }));
if (isset($duplicates)) if (isset($duplicates))
{ {
foreach ($duplicates as $dup) foreach ($duplicates as $dup)

View File

@@ -59,7 +59,7 @@ if ($action == "assessmentadd" && bHasSurveyPermission($surveyid, 'assessments',
$datarray['id']=$aid; $datarray['id']=$aid;
} }
$query = $connect->GetInsertSQL($inserttable, $datarray, get_magic_quotes_gpc()); $query = $connect->GetInsertSQL($inserttable, $datarray, 0);
$result=$connect->Execute($query) or safe_die("Error inserting<br />$query<br />".$connect->ErrorMsg()); $result=$connect->Execute($query) or safe_die("Error inserting<br />$query<br />".$connect->ErrorMsg());
if ($first==true) if ($first==true)
{ {

View File

@@ -63,7 +63,7 @@ class ProgressBar
// constructor // constructor
function ProgressBar($width=0,$height=0) function __construct($width=0,$height=0)
{ {
$this->code = substr(md5(microtime()), 0, 6); $this->code = substr(md5(microtime()), 0, 6);
if ($width>0) {$this->width = $width;} if ($width>0) {$this->width = $width;}

View File

@@ -46,7 +46,11 @@ final class SettingsStorage extends ArrayObject
*/ */
public function offsetExists($index) public function offsetExists($index)
{ {
if (is_array($this)) {
return array_key_exists($index, $this); return array_key_exists($index, $this);
} else if (is_object($this)) {
return property_exists('SettingsStorage', $index);
} else return false;
} }

View File

@@ -5955,7 +5955,7 @@ class PclZip
} }
// ----- Get and memorize the magic_quote value // ----- Get and memorize the magic_quote value
$this->magic_quotes_status = @get_magic_quotes_runtime(); $this->magic_quotes_status = @0;
PclTraceFctMessage(__FILE__, __LINE__, 3, "Current magic_quotes_runtime status is '".($this->magic_quotes_status==0?'disable':'enable')."'"); PclTraceFctMessage(__FILE__, __LINE__, 3, "Current magic_quotes_runtime status is '".($this->magic_quotes_status==0?'disable':'enable')."'");
// ----- Disable magic_quotes // ----- Disable magic_quotes

View File

@@ -5316,7 +5316,7 @@ class PclZip
} }
// ----- Get and memorize the magic_quote value // ----- Get and memorize the magic_quote value
$this->magic_quotes_status = @get_magic_quotes_runtime(); $this->magic_quotes_status = @0;
// ----- Disable magic_quotes // ----- Disable magic_quotes
if ($this->magic_quotes_status == 1) { if ($this->magic_quotes_status == 1) {

View File

@@ -51,7 +51,7 @@ class Spreadsheet_Excel_Writer extends Spreadsheet_Excel_Writer_Workbook
* @param string $filename The optional filename for the Workbook. * @param string $filename The optional filename for the Workbook.
* @return Spreadsheet_Excel_Writer_Workbook The Workbook created * @return Spreadsheet_Excel_Writer_Workbook The Workbook created
*/ */
function Spreadsheet_Excel_Writer($filename = '') function __construct($filename = '')
{ {
$this->_filename = $filename; $this->_filename = $filename;
$this->Spreadsheet_Excel_Writer_Workbook($filename); $this->Spreadsheet_Excel_Writer_Workbook($filename);

View File

@@ -4,7 +4,7 @@ require_once('tcpdf.php');
class PDF extends TCPDF class PDF extends TCPDF
{ {
function PDF($orientation='L', $unit='mm', $format='A4') function __construct($orientation='L', $unit='mm', $format='A4')
{ {
parent::__construct($orientation,$unit,$format); parent::__construct($orientation,$unit,$format);
$this->SetAutoPageBreak(true,10); $this->SetAutoPageBreak(true,10);

View File

@@ -2872,7 +2872,7 @@ class TCPDF {
if (empty($orientation)) { if (empty($orientation)) {
$orientation = $default_orientation; $orientation = $default_orientation;
} else { } else {
$orientation = strtoupper($orientation{0}); $orientation = strtoupper($orientation[0]);
} }
if (in_array($orientation, $valid_orientations) AND ($orientation != $default_orientation)) { if (in_array($orientation, $valid_orientations) AND ($orientation != $default_orientation)) {
$this->CurOrientation = $orientation; $this->CurOrientation = $orientation;
@@ -3324,7 +3324,7 @@ class TCPDF {
$slen = strlen($brd); $slen = strlen($brd);
$newbrd = array(); $newbrd = array();
for ($i = 0; $i < $slen; ++$i) { for ($i = 0; $i < $slen; ++$i) {
$newbrd[$brd{$i}] = true; $newbrd[$brd[$i]] = true;
} }
$brd = $newbrd; $brd = $newbrd;
} elseif (($brd === 1) OR ($brd === true) OR (is_numeric($brd) AND (intval($brd) > 0))) { } elseif (($brd === 1) OR ($brd === true) OR (is_numeric($brd) AND (intval($brd) > 0))) {
@@ -5757,7 +5757,7 @@ class TCPDF {
$slen = strlen($brd); $slen = strlen($brd);
$newbrd = array(); $newbrd = array();
for ($i = 0; $i < $slen; ++$i) { for ($i = 0; $i < $slen; ++$i) {
$newbrd[$brd{$i}] = array('cap' => 'square', 'join' => 'miter'); $newbrd[$brd[$i]] = array('cap' => 'square', 'join' => 'miter');
} }
$brd = $newbrd; $brd = $newbrd;
} }
@@ -6260,7 +6260,7 @@ class TCPDF {
$slen = strlen($brd); $slen = strlen($brd);
$newbrd = array(); $newbrd = array();
for ($i = 0; $i < $slen; ++$i) { for ($i = 0; $i < $slen; ++$i) {
$newbrd[$brd{$i}] = array('cap' => 'square', 'join' => 'miter'); $newbrd[$brd[$i]] = array('cap' => 'square', 'join' => 'miter');
} }
$brd = $newbrd; $brd = $newbrd;
} }
@@ -7343,7 +7343,7 @@ class TCPDF {
public function set_mqr($mqr) { public function set_mqr($mqr) {
if(!defined('PHP_VERSION_ID')) { if(!defined('PHP_VERSION_ID')) {
$version = PHP_VERSION; $version = PHP_VERSION;
define('PHP_VERSION_ID', (($version{0} * 10000) + ($version{2} * 100) + $version{4})); define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4]));
} }
if (PHP_VERSION_ID < 50300) { if (PHP_VERSION_ID < 50300) {
@set_magic_quotes_runtime($mqr); @set_magic_quotes_runtime($mqr);
@@ -7358,10 +7358,10 @@ class TCPDF {
public function get_mqr() { public function get_mqr() {
if(!defined('PHP_VERSION_ID')) { if(!defined('PHP_VERSION_ID')) {
$version = PHP_VERSION; $version = PHP_VERSION;
define('PHP_VERSION_ID', (($version{0} * 10000) + ($version{2} * 100) + $version{4})); define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4]));
} }
if (PHP_VERSION_ID < 50300) { if (PHP_VERSION_ID < 50300) {
return @get_magic_quotes_runtime(); return @0;
} }
return 0; return 0;
} }
@@ -7834,7 +7834,7 @@ class TCPDF {
$dest = $dest ? 'D' : 'F'; $dest = $dest ? 'D' : 'F';
} }
$dest = strtoupper($dest); $dest = strtoupper($dest);
if ($dest{0} != 'F') { if ($dest[0] != 'F') {
$name = preg_replace('/[\s]+/', '_', $name); $name = preg_replace('/[\s]+/', '_', $name);
$name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $name); $name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $name);
} }
@@ -9520,12 +9520,12 @@ class TCPDF {
$font = file_get_contents($fontfile); $font = file_get_contents($fontfile);
$compressed = (substr($file, -2) == '.z'); $compressed = (substr($file, -2) == '.z');
if ((!$compressed) AND (isset($info['length2']))) { if ((!$compressed) AND (isset($info['length2']))) {
$header = (ord($font{0}) == 128); $header = (ord($font[0]) == 128);
if ($header) { if ($header) {
//Strip first binary header //Strip first binary header
$font = substr($font, 6); $font = substr($font, 6);
} }
if ($header AND (ord($font{$info['length1']}) == 128)) { if ($header AND (ord($font[$info['length1']]) == 128)) {
//Strip second binary header //Strip second binary header
$font = substr($font, 0, $info['length1']).substr($font, ($info['length1'] + 6)); $font = substr($font, 0, $info['length1']).substr($font, ($info['length1'] + 6));
} }
@@ -10990,7 +10990,7 @@ class TCPDF {
$strarr = array(); $strarr = array();
$strlen = strlen($str); $strlen = strlen($str);
for ($i=0; $i < $strlen; ++$i) { for ($i=0; $i < $strlen; ++$i) {
$strarr[] = ord($str{$i}); $strarr[] = ord($str[$i]);
} }
// insert new value on cache // insert new value on cache
$this->cache_UTF8StringToArray[$strkey]['s'] = $strarr; $this->cache_UTF8StringToArray[$strkey]['s'] = $strarr;
@@ -11004,7 +11004,7 @@ class TCPDF {
$str .= ''; // force $str to be a string $str .= ''; // force $str to be a string
$length = strlen($str); $length = strlen($str);
for ($i = 0; $i < $length; ++$i) { for ($i = 0; $i < $length; ++$i) {
$char = ord($str{$i}); // get one string character at time $char = ord($str[$i]); // get one string character at time
if (count($bytes) == 0) { // get starting octect if (count($bytes) == 0) { // get starting octect
if ($char <= 0x7F) { if ($char <= 0x7F) {
$unichar = $char; // use the character "as is" because is ASCII $unichar = $char; // use the character "as is" because is ASCII
@@ -11286,7 +11286,7 @@ class TCPDF {
* @access public * @access public
*/ */
public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color='', $style=-1, $firstblock=false) { public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color='', $style=-1, $firstblock=false) {
if (!$this->empty_string($url) AND ($url{0} == '#')) { if (!$this->empty_string($url) AND ($url[0] == '#')) {
// convert url to internal link // convert url to internal link
$lnkdata = explode(',', $url); $lnkdata = explode(',', $url);
if (isset($lnkdata[0])) { if (isset($lnkdata[0])) {
@@ -11645,7 +11645,7 @@ class TCPDF {
$j = 0; $j = 0;
for ($i = 0; $i < 256; ++$i) { for ($i = 0; $i < 256; ++$i) {
$t = $rc4[$i]; $t = $rc4[$i];
$j = ($j + $t + ord($k{$i})) % 256; $j = ($j + $t + ord($k[$i])) % 256;
$rc4[$i] = $rc4[$j]; $rc4[$i] = $rc4[$j];
$rc4[$j] = $t; $rc4[$j] = $t;
} }
@@ -11665,7 +11665,7 @@ class TCPDF {
$rc4[$a] = $rc4[$b]; $rc4[$a] = $rc4[$b];
$rc4[$b] = $t; $rc4[$b] = $t;
$k = $rc4[($rc4[$a] + $rc4[$b]) % 256]; $k = $rc4[($rc4[$a] + $rc4[$b]) % 256];
$out .= chr(ord($text{$i}) ^ $k); $out .= chr(ord($text[$i]) ^ $k);
} }
return $out; return $out;
} }
@@ -11719,7 +11719,7 @@ class TCPDF {
for ($i = 1; $i <= 19; ++$i) { for ($i = 1; $i <= 19; ++$i) {
$ek = ''; $ek = '';
for ($j = 0; $j < $len; ++$j) { for ($j = 0; $j < $len; ++$j) {
$ek .= chr(ord($this->encryptdata['key']{$j}) ^ $i); $ek .= chr(ord($this->encryptdata['key'][$j]) ^ $i);
} }
$enc = $this->_RC4($ek, $enc); $enc = $this->_RC4($ek, $enc);
} }
@@ -11770,7 +11770,7 @@ class TCPDF {
for ($i = 1; $i <= 19; ++$i) { for ($i = 1; $i <= 19; ++$i) {
$ek = ''; $ek = '';
for ($j = 0; $j < $len; ++$j) { for ($j = 0; $j < $len; ++$j) {
$ek .= chr(ord($owner_key{$j}) ^ $i); $ek .= chr(ord($owner_key[$j]) ^ $i);
} }
$enc = $this->_RC4($ek, $enc); $enc = $this->_RC4($ek, $enc);
} }
@@ -12084,7 +12084,7 @@ class TCPDF {
++$bslenght; ++$bslenght;
} }
for ($i = 0; $i < $bslenght; $i += 2) { for ($i = 0; $i < $bslenght; $i += 2) {
$string .= chr(hexdec($bs{$i}.$bs{($i + 1)})); $string .= chr(hexdec($bs[$i].$bs[($i + 1)]));
} }
return $string; return $string;
} }
@@ -16410,7 +16410,7 @@ class TCPDF {
$cnt = count($lines); $cnt = count($lines);
for ($i=0; $i < $cnt; ++$i) { for ($i=0; $i < $cnt; ++$i) {
$line = $lines[$i]; $line = $lines[$i];
if (($line == '') OR ($line{0} == '%')) { if (($line == '') OR ($line[0] == '%')) {
continue; continue;
} }
$len = strlen($line); $len = strlen($line);
@@ -16460,7 +16460,7 @@ class TCPDF {
case 'V': case 'V':
case 'L': case 'L':
case 'C': { case 'C': {
$line{$len-1} = strtolower($cmd); $line[$len-1] = strtolower($cmd);
$this->_out($line); $this->_out($line);
break; break;
} }
@@ -17383,7 +17383,7 @@ class TCPDF {
$attrib = strtolower(trim($attrib[0])); $attrib = strtolower(trim($attrib[0]));
if (!empty($attrib)) { if (!empty($attrib)) {
// check if matches class, id, attribute, pseudo-class or pseudo-element // check if matches class, id, attribute, pseudo-class or pseudo-element
switch ($attrib{0}) { switch ($attrib[0]) {
case '.': { // class case '.': { // class
if (in_array(substr($attrib, 1), $class)) { if (in_array(substr($attrib, 1), $class)) {
$valid = true; $valid = true;
@@ -17450,7 +17450,7 @@ class TCPDF {
break; break;
} }
case ':': { // pseudo-class or pseudo-element case ':': { // pseudo-class or pseudo-element
if ($attrib{1} == ':') { // pseudo-element if ($attrib[1] == ':') { // pseudo-element
// pseudo-elements are not supported! // pseudo-elements are not supported!
// (::first-line, ::first-letter, ::before, ::after) // (::first-line, ::first-letter, ::before, ::after)
} else { // pseudo-class } else { // pseudo-class
@@ -18075,7 +18075,7 @@ class TCPDF {
$tagname = strtolower($tag[1]); $tagname = strtolower($tag[1]);
// check if we are inside a table header // check if we are inside a table header
if ($tagname == 'thead') { if ($tagname == 'thead') {
if ($element{0} == '/') { if ($element[0] == '/') {
$thead = false; $thead = false;
} else { } else {
$thead = true; $thead = true;
@@ -18090,7 +18090,7 @@ class TCPDF {
} else { } else {
$dom[$key]['block'] = false; $dom[$key]['block'] = false;
} }
if ($element{0} == '/') { if ($element[0] == '/') {
// *** closing html tag // *** closing html tag
$dom[$key]['opening'] = false; $dom[$key]['opening'] = false;
$dom[$key]['parent'] = end($level); $dom[$key]['parent'] = end($level);
@@ -18296,10 +18296,10 @@ class TCPDF {
} }
} }
// font style // font style
if (isset($dom[$key]['style']['font-weight']) AND (strtolower($dom[$key]['style']['font-weight']{0}) == 'b')) { if (isset($dom[$key]['style']['font-weight']) AND (strtolower($dom[$key]['style']['font-weight'][0]) == 'b')) {
$dom[$key]['fontstyle'] .= 'B'; $dom[$key]['fontstyle'] .= 'B';
} }
if (isset($dom[$key]['style']['font-style']) AND (strtolower($dom[$key]['style']['font-style']{0}) == 'i')) { if (isset($dom[$key]['style']['font-style']) AND (strtolower($dom[$key]['style']['font-style'][0]) == 'i')) {
$dom[$key]['fontstyle'] .= 'I'; $dom[$key]['fontstyle'] .= 'I';
} }
// font color // font color
@@ -18318,13 +18318,13 @@ class TCPDF {
foreach ($decors as $dec) { foreach ($decors as $dec) {
$dec = trim($dec); $dec = trim($dec);
if (!$this->empty_string($dec)) { if (!$this->empty_string($dec)) {
if ($dec{0} == 'u') { if ($dec[0] == 'u') {
// underline // underline
$dom[$key]['fontstyle'] .= 'U'; $dom[$key]['fontstyle'] .= 'U';
} elseif ($dec{0} == 'l') { } elseif ($dec[0] == 'l') {
// line-trough // line-trough
$dom[$key]['fontstyle'] .= 'D'; $dom[$key]['fontstyle'] .= 'D';
} elseif ($dec{0} == 'o') { } elseif ($dec[0] == 'o') {
// overline // overline
$dom[$key]['fontstyle'] .= 'O'; $dom[$key]['fontstyle'] .= 'O';
} }
@@ -18343,7 +18343,7 @@ class TCPDF {
} }
// check for text alignment // check for text alignment
if (isset($dom[$key]['style']['text-align'])) { if (isset($dom[$key]['style']['text-align'])) {
$dom[$key]['align'] = strtoupper($dom[$key]['style']['text-align']{0}); $dom[$key]['align'] = strtoupper($dom[$key]['style']['text-align'][0]);
} }
// check for CSS border properties // check for CSS border properties
if (isset($dom[$key]['style']['border'])) { if (isset($dom[$key]['style']['border'])) {
@@ -18504,9 +18504,9 @@ class TCPDF {
// font size // font size
if (isset($dom[$key]['attribute']['size'])) { if (isset($dom[$key]['attribute']['size'])) {
if ($key > 0) { if ($key > 0) {
if ($dom[$key]['attribute']['size']{0} == '+') { if ($dom[$key]['attribute']['size'][0] == '+') {
$dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] + intval(substr($dom[$key]['attribute']['size'], 1)); $dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] + intval(substr($dom[$key]['attribute']['size'], 1));
} elseif ($dom[$key]['attribute']['size']{0} == '-') { } elseif ($dom[$key]['attribute']['size'][0] == '-') {
$dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] - intval(substr($dom[$key]['attribute']['size'], 1)); $dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] - intval(substr($dom[$key]['attribute']['size'], 1));
} else { } else {
$dom[$key]['fontsize'] = intval($dom[$key]['attribute']['size']); $dom[$key]['fontsize'] = intval($dom[$key]['attribute']['size']);
@@ -18548,10 +18548,10 @@ class TCPDF {
if (($dom[$key]['value'] == 'pre') OR ($dom[$key]['value'] == 'tt')) { if (($dom[$key]['value'] == 'pre') OR ($dom[$key]['value'] == 'tt')) {
$dom[$key]['fontname'] = $this->default_monospaced_font; $dom[$key]['fontname'] = $this->default_monospaced_font;
} }
if (($dom[$key]['value']{0} == 'h') AND (intval($dom[$key]['value']{1}) > 0) AND (intval($dom[$key]['value']{1}) < 7)) { if (($dom[$key]['value'][0] == 'h') AND (intval($dom[$key]['value'][1]) > 0) AND (intval($dom[$key]['value'][1]) < 7)) {
// headings h1, h2, h3, h4, h5, h6 // headings h1, h2, h3, h4, h5, h6
if (!isset($dom[$key]['attribute']['size']) AND !isset($dom[$key]['style']['font-size'])) { if (!isset($dom[$key]['attribute']['size']) AND !isset($dom[$key]['style']['font-size'])) {
$headsize = (4 - intval($dom[$key]['value']{1})) * 2; $headsize = (4 - intval($dom[$key]['value'][1])) * 2;
$dom[$key]['fontsize'] = $dom[0]['fontsize'] + $headsize; $dom[$key]['fontsize'] = $dom[0]['fontsize'] + $headsize;
} }
if (!isset($dom[$key]['style']['font-weight'])) { if (!isset($dom[$key]['style']['font-weight'])) {
@@ -18613,7 +18613,7 @@ class TCPDF {
} }
// check for text alignment // check for text alignment
if (isset($dom[$key]['attribute']['align']) AND (!$this->empty_string($dom[$key]['attribute']['align'])) AND ($dom[$key]['value'] !== 'img')) { if (isset($dom[$key]['attribute']['align']) AND (!$this->empty_string($dom[$key]['attribute']['align'])) AND ($dom[$key]['value'] !== 'img')) {
$dom[$key]['align'] = strtoupper($dom[$key]['attribute']['align']{0}); $dom[$key]['align'] = strtoupper($dom[$key]['attribute']['align'][0]);
} }
// check for text rendering mode (the following attributes do not exist in HTML) // check for text rendering mode (the following attributes do not exist in HTML)
if (isset($dom[$key]['attribute']['stroke'])) { if (isset($dom[$key]['attribute']['stroke'])) {
@@ -19268,7 +19268,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
if (($stroffset !== false) AND ($stroffset <= $strpiece[2][1])) { if (($stroffset !== false) AND ($stroffset <= $strpiece[2][1])) {
// set offset to the end of string section // set offset to the end of string section
$offset = strpos($pmid, ')]', $stroffset); $offset = strpos($pmid, ')]', $stroffset);
while (($offset !== false) AND ($pmid{($offset - 1)} == '\\')) { while (($offset !== false) AND ($pmid[($offset - 1)] == '\\')) {
$offset = strpos($pmid, ')]', ($offset + 1)); $offset = strpos($pmid, ')]', ($offset + 1));
} }
if ($offset === false) { if ($offset === false) {
@@ -19327,7 +19327,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
// justify block // justify block
if (!$this->empty_string($this->lispacer)) { if (!$this->empty_string($this->lispacer)) {
$this->lispacer = ''; $this->lispacer = '';
continue; continue 2;
} }
preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x', $pmid, $xmatches); preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x', $pmid, $xmatches);
$currentxpos = $xmatches[1]; $currentxpos = $xmatches[1];
@@ -20330,7 +20330,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$imglink = ''; $imglink = '';
if (isset($this->HREF['url']) AND !$this->empty_string($this->HREF['url'])) { if (isset($this->HREF['url']) AND !$this->empty_string($this->HREF['url'])) {
$imglink = $this->HREF['url']; $imglink = $this->HREF['url'];
if ($imglink{0} == '#') { if ($imglink[0] == '#') {
// convert url to internal link // convert url to internal link
$lnkdata = explode(',', $imglink); $lnkdata = explode(',', $imglink);
if (isset($lnkdata[0])) { if (isset($lnkdata[0])) {
@@ -25501,11 +25501,11 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
$this->SVGTransform($tm); $this->SVGTransform($tm);
$obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h); $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h);
// fix image path // fix image path
if (!$this->empty_string($this->svgdir) AND (($img{0} == '.') OR (basename($img) == $img))) { if (!$this->empty_string($this->svgdir) AND (($img[0] == '.') OR (basename($img) == $img))) {
// replace relative path with full server path // replace relative path with full server path
$img = $this->svgdir.'/'.$img; $img = $this->svgdir.'/'.$img;
} }
if (($img{0} == '/') AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { if (($img[0] == '/') AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
$findroot = strpos($img, $_SERVER['DOCUMENT_ROOT']); $findroot = strpos($img, $_SERVER['DOCUMENT_ROOT']);
if (($findroot === false) OR ($findroot > 1)) { if (($findroot === false) OR ($findroot > 1)) {
// replace relative path with full server path // replace relative path with full server path

View File

@@ -10,20 +10,6 @@
*/ */
// work around magic quotes // work around magic quotes
if (get_magic_quotes_gpc())
{
function stripslashes_deep($value)
{
$value = is_array($value) ?
array_map('stripslashes_deep', $value) :
stripslashes($value);
return $value;
}
$_GET = array_map('stripslashes_deep', $_GET);
}
if ( isset( $_GET['usepost'] ) && $_GET['usepost'] === 'true' ) if ( isset( $_GET['usepost'] ) && $_GET['usepost'] === 'true' )
{ {
$_GET = $_POST; $_GET = $_POST;

View File

@@ -23,9 +23,6 @@ $postgid=returnglobal('gid');
$postqid=returnglobal('qid'); $postqid=returnglobal('qid');
$postqaid=returnglobal('qaid'); $postqaid=returnglobal('qaid');
if (get_magic_quotes_gpc())
{$_POST = array_map('recursive_stripslashes', $_POST);}
/** /**
@@ -1131,7 +1128,7 @@ if(isset($surveyid))
'tokenlength'=>$_POST['tokenlength'] 'tokenlength'=>$_POST['tokenlength']
); );
$usquery=$connect->GetUpdateSQL($rs, $updatearray, false, get_magic_quotes_gpc()); $usquery=$connect->GetUpdateSQL($rs, $updatearray, false, 0);
if ($usquery) { if ($usquery) {
$usresult = $connect->Execute($usquery) or safe_die("Error updating<br />".$usquery."<br /><br /><strong>".$connect->ErrorMsg()); // Checked $usresult = $connect->Execute($usquery) or safe_die("Error updating<br />".$usquery."<br /><br /><strong>".$connect->ErrorMsg()); // Checked
} }

View File

@@ -280,8 +280,12 @@ $action!='vvimport' && $action!='vvexport' && $action!='exportresults')
rsort($tmp_survlangs); rsort($tmp_survlangs);
if (count($tmp_survlangs) == 1) if (count($tmp_survlangs) == 1)
{ {
$interviewer = "";
if (isset($_SESSION['interviewer'])) {
$interviewer = "interviewer=" . $_SESSION['interviewer'] . "&amp";
}
$surveysummary .= "<li><a href='#' accesskey='d' onclick=\"window.open('" $surveysummary .= "<li><a href='#' accesskey='d' onclick=\"window.open('"
. $publicurl."/index.php?sid={$surveyid}&amp;interviewer=" . $_SESSION['interviewer'] . "&amp;newtest=Y&amp;lang={$baselang}', '_blank')\" title=\"{$icontext2}\" >" . $publicurl."/index.php?sid={$surveyid}&amp;" . $interviewer . "newtest=Y&amp;lang={$baselang}', '_blank')\" title=\"{$icontext2}\" >"
. "<img src='{$imageurl}/do.png' alt='{$icontext}' />" . "<img src='{$imageurl}/do.png' alt='{$icontext}' />"
. "</a></li>\n"; . "</a></li>\n";

View File

@@ -64,7 +64,6 @@ else {
$fieldname=$oFilter->process($_GET['fieldname']); $fieldname=$oFilter->process($_GET['fieldname']);
$fieldtext=$oFilter->process($_GET['fieldtext']); $fieldtext=$oFilter->process($_GET['fieldtext']);
if (get_magic_quotes_gpc()) $fieldtext = stripslashes($fieldtext);
$controlidena=$_GET['fieldname'].'_popupctrlena'; $controlidena=$_GET['fieldname'].'_popupctrlena';
$controliddis=$_GET['fieldname'].'_popupctrldis'; $controliddis=$_GET['fieldname'].'_popupctrldis';

View File

@@ -76,10 +76,7 @@ elseif ($action == 'copysurvey')
{ {
$surveyid = sanitize_int($_POST['copysurveylist']); $surveyid = sanitize_int($_POST['copysurveylist']);
$exclude = array(); $exclude = array();
if (get_magic_quotes_gpc()) {$sNewSurveyName = stripslashes($_POST['copysurveyname']);}
else{
$sNewSurveyName=$_POST['copysurveyname']; $sNewSurveyName=$_POST['copysurveyname'];
}
require_once("../classes/inputfilter/class.inputfilter_clean.php"); require_once("../classes/inputfilter/class.inputfilter_clean.php");
$myFilter = new InputFilter('','',1,1,1); $myFilter = new InputFilter('','',1,1,1);

View File

@@ -20,12 +20,7 @@ include_once("login_check.php"); //Login Check dies also if the script is start
// Do not stripslashes on POSted fields because labels.php uses db_quoteall($str, $ispostvariable) that checks for magic_quotes_gpc // Do not stripslashes on POSted fields because labels.php uses db_quoteall($str, $ispostvariable) that checks for magic_quotes_gpc
// However We need to stripslashes from $_POST['method'] compared to // However We need to stripslashes from $_POST['method'] compared to
// unescaped strings in switch case // unescaped strings in switch case
//if (get_magic_quotes_gpc())
//$_POST = array_map('stripslashes', $_POST); //$_POST = array_map('stripslashes', $_POST);
if (isset($_POST['method']) && get_magic_quotes_gpc())
{
$_POST['method'] = stripslashes($_POST['method']);
}
$labelsoutput=''; $labelsoutput='';
if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_MANAGE_LABEL'] == 1) if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_MANAGE_LABEL'] == 1)
@@ -600,14 +595,7 @@ function modlabelsetanswers($lid)
$sPostData=html_entity_decode($_POST['dataToSend'], ENT_QUOTES, "UTF-8"); $sPostData=html_entity_decode($_POST['dataToSend'], ENT_QUOTES, "UTF-8");
$sPostData=str_replace("\t", '', $sPostData); $sPostData=str_replace("\t", '', $sPostData);
if (get_magic_quotes_gpc())
{
$data = json_decode(stripslashes($sPostData));
}
else
{
$data = json_decode($sPostData); $data = json_decode($sPostData);
}
if ($ajax){ if ($ajax){
@@ -657,11 +645,6 @@ function modlabelsetanswers($lid)
$lang = db_quoteall($lang); $lang = db_quoteall($lang);
$title = trim($title, "'"); $title = trim($title, "'");
if (get_magic_quotes_gpc())
{
$title = str_replace("'","\'",$title);
}
$query = "INSERT INTO ".db_table_name('labels')." (lid,code,title,sortorder, assessment_value, language) $query = "INSERT INTO ".db_table_name('labels')." (lid,code,title,sortorder, assessment_value, language)
VALUES({$lid},{$actualcode},'".$title."',{$sort_order},{$assessmentvalue},{$lang})"; VALUES({$lid},{$actualcode},'".$title."',{$sort_order},{$assessmentvalue},{$lang})";

View File

@@ -35,7 +35,7 @@ class input {
protected $magic_quotes_sybase; protected $magic_quotes_sybase;
public function __construct() { public function __construct() {
$this->magic_quotes_gpc = function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc(); $this->magic_quotes_gpc = 0;
$this->magic_quotes_sybase = ini_get('magic_quotes_sybase'); $this->magic_quotes_sybase = ini_get('magic_quotes_sybase');
$this->magic_quotes_sybase = $this->magic_quotes_sybase $this->magic_quotes_sybase = $this->magic_quotes_sybase
? !in_array(strtolower(trim($this->magic_quotes_sybase)), ? !in_array(strtolower(trim($this->magic_quotes_sybase)),

View File

@@ -164,19 +164,11 @@ else {$codelanguage='en';}
if (isset ($_POST['changes'])) { if (isset ($_POST['changes'])) {
$changedtext=$_POST['changes']; $changedtext=$_POST['changes'];
$changedtext=str_replace ('<?','',$changedtext); $changedtext=str_replace ('<?','',$changedtext);
if(get_magic_quotes_gpc())
{
$changedtext = stripslashes($changedtext);
}
} }
if (isset ($_POST['changes_cp'])) { if (isset ($_POST['changes_cp'])) {
$changedtext=$_POST['changes_cp']; $changedtext=$_POST['changes_cp'];
$changedtext=str_replace ('<?','',$changedtext); $changedtext=str_replace ('<?','',$changedtext);
if(get_magic_quotes_gpc())
{
$changedtext = stripslashes($changedtext);
}
} }

View File

@@ -801,7 +801,7 @@
$fieldvalue['bounceaccounthost']=$_POST['bounceaccounthost']; $fieldvalue['bounceaccounthost']=$_POST['bounceaccounthost'];
} }
$connect->AutoExecute("{$dbprefix}surveys", $fieldvalue, 2,"sid=$surveyid",get_magic_quotes_gpc()); $connect->AutoExecute("{$dbprefix}surveys", $fieldvalue, 2,"sid=$surveyid",0);
$tokenoutput .= "<div class='header ui-widget-header'>".$clang->gT("Bounce settings")."</div>\n" $tokenoutput .= "<div class='header ui-widget-header'>".$clang->gT("Bounce settings")."</div>\n"
."<div class='messagebox ui-corner-all'>" ."<div class='messagebox ui-corner-all'>"
."\t<div class='successheader'>".$clang->gT("Bounce settings have been saved.")."</div>\n" ."\t<div class='successheader'>".$clang->gT("Bounce settings have been saved.")."</div>\n"

View File

@@ -18,9 +18,6 @@ if (!isset($dbprefix) || isset($_REQUEST['dbprefix'])) {die("Cannot run this scr
if (isset($_POST['uid'])) {$postuserid=intval($_POST['uid']);} if (isset($_POST['uid'])) {$postuserid=intval($_POST['uid']);}
if (isset($_POST['ugid'])) {$postusergroupid=intval($_POST['ugid']);} if (isset($_POST['ugid'])) {$postusergroupid=intval($_POST['ugid']);}
if (get_magic_quotes_gpc())
{$_POST = array_map('recursive_stripslashes', $_POST);}
$js_admin_includes[]='../scripts/jquery/jquery.tablesorter.min.js'; $js_admin_includes[]='../scripts/jquery/jquery.tablesorter.min.js';
$js_admin_includes[]='scripts/users.js'; $js_admin_includes[]='scripts/users.js';

View File

@@ -252,7 +252,6 @@ $ADODB_INCLUDED_CSV = 1;
//var_dump($arr); //var_dump($arr);
if (!is_array($arr)) { if (!is_array($arr)) {
$err = "Recordset had unexpected EOF (in serialized recordset)"; $err = "Recordset had unexpected EOF (in serialized recordset)";
if (get_magic_quotes_runtime()) $err .= ". Magic Quotes Runtime should be disabled!";
return $false; return $false;
} }
$rs = new $rsclass(); $rs = new $rsclass();

View File

@@ -691,12 +691,6 @@ Committed_AS: 348732 kB
} }
$this->conn->LogSQL($savelog); $this->conn->LogSQL($savelog);
// magic quotes
if (isset($_GET['sql']) && get_magic_quotes_gpc()) {
$_GET['sql'] = $_GET['sql'] = str_replace(array("\\'",'\"'),array("'",'"'),$_GET['sql']);
}
if (!isset($_SESSION['ADODB_PERF_SQL'])) $nsql = $_SESSION['ADODB_PERF_SQL'] = 10; if (!isset($_SESSION['ADODB_PERF_SQL'])) $nsql = $_SESSION['ADODB_PERF_SQL'] = 10;
else $nsql = $_SESSION['ADODB_PERF_SQL']; else $nsql = $_SESSION['ADODB_PERF_SQL'];
@@ -999,12 +993,6 @@ Committed_AS: 348732 kB
function undomq($m) function undomq($m)
{ {
if (get_magic_quotes_gpc()) {
// undo the damage
$m = str_replace('\\\\','\\',$m);
$m = str_replace('\"','"',$m);
$m = str_replace('\\\'','\'',$m);
}
return $m; return $m;
} }

View File

@@ -1303,8 +1303,7 @@ class adoSchema {
*/ */
function __construct( $db ) { function __construct( $db ) {
// Initialize the environment // Initialize the environment
$this->mgq = get_magic_quotes_runtime(); $this->mgq = 0;
ini_set("magic_quotes_runtime", 0);
#set_magic_quotes_runtime(0); #set_magic_quotes_runtime(0);
$this->db = $db; $this->db = $db;

View File

@@ -1407,9 +1407,8 @@ class adoSchema {
*/ */
function __construct( $db ) { function __construct( $db ) {
// Initialize the environment // Initialize the environment
$this->mgq = get_magic_quotes_runtime(); $this->mgq = 0;
#set_magic_quotes_runtime(0); #set_magic_quotes_runtime(0);
ini_set("magic_quotes_runtime", 0);
$this->db = $db; $this->db = $db;
$this->debug = $this->db->debug; $this->debug = $this->db->debug;

View File

@@ -834,7 +834,7 @@ if (!defined('_ADODB_LAYER')) {
* Requested by "Karsten Dambekalns" <k.dambekalns@fishfarm.de> * Requested by "Karsten Dambekalns" <k.dambekalns@fishfarm.de>
*/ */
function QMagic($s) { function QMagic($s) {
return $this->qstr($s,get_magic_quotes_gpc()); return $this->qstr($s,0);
} }
function q(&$s) { function q(&$s) {
@@ -2034,9 +2034,6 @@ if (!defined('_ADODB_LAYER')) {
if (!$rs) { if (!$rs) {
// no cached rs found // no cached rs found
if ($this->debug) { if ($this->debug) {
if (get_magic_quotes_runtime() && !$this->memCache) {
ADOConnection::outp("Please disable magic_quotes_runtime - it corrupts cache files :(");
}
if ($this->debug !== -1) { if ($this->debug !== -1) {
ADOConnection::outp( " $md5file cache failure: $err (this is a notice and not an error)"); ADOConnection::outp( " $md5file cache failure: $err (this is a notice and not an error)");
} }
@@ -2941,7 +2938,7 @@ http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_1
* An example is $db->qstr("Don't bother",magic_quotes_runtime()); * An example is $db->qstr("Don't bother",magic_quotes_runtime());
* *
* @param s the string to quote * @param s the string to quote
* @param [magic_quotes] if $s is GET/POST var, set to get_magic_quotes_gpc(). * @param [magic_quotes] if $s is GET/POST var, set to 0.
* This undoes the stupidity of magic quotes for GPC. * This undoes the stupidity of magic quotes for GPC.
* *
* @return quoted string to be sent back to database * @return quoted string to be sent back to database

View File

@@ -170,7 +170,7 @@ class ADODB_mssql extends ADOConnection {
* An example is $db->qstr("Don't bother",magic_quotes_runtime()); * An example is $db->qstr("Don't bother",magic_quotes_runtime());
* *
* @param s the string to quote * @param s the string to quote
* @param [magic_quotes] if $s is GET/POST var, set to get_magic_quotes_gpc(). * @param [magic_quotes] if $s is GET/POST var, set to 0.
* This undoes the stupidity of magic quotes for GPC. * This undoes the stupidity of magic quotes for GPC.
* *
* @return quoted string to be sent back to database * @return quoted string to be sent back to database

View File

@@ -226,10 +226,10 @@ class ADODB_mysqli extends ADOConnection {
* @param string $s The string to quote * @param string $s The string to quote
* @param boolean $magic_quotes If false, use mysqli_real_escape_string() * @param boolean $magic_quotes If false, use mysqli_real_escape_string()
* if you are quoting a string extracted from a POST/GET variable, * if you are quoting a string extracted from a POST/GET variable,
* then pass get_magic_quotes_gpc() as the second parameter. This will * then pass 0 as the second parameter. This will
* ensure that the variable is not quoted twice, once by qstr() and * ensure that the variable is not quoted twice, once by qstr() and
* once by the magic_quotes_gpc. * once by the magic_quotes_gpc.
* Eg. $s = $db->qstr(_GET['name'],get_magic_quotes_gpc()); * Eg. $s = $db->qstr(_GET['name'],0);
* @return string Quoted string * @return string Quoted string
*/ */
function qstr($s, $magic_quotes = false) function qstr($s, $magic_quotes = false)

View File

@@ -1495,7 +1495,7 @@ SELECT /*+ RULE */ distinct b.column_name
* An example is $db->qstr("Don't bother",magic_quotes_runtime()); * An example is $db->qstr("Don't bother",magic_quotes_runtime());
* *
* @param string $s the string to quote * @param string $s the string to quote
* @param bool $magic_quotes if $s is GET/POST var, set to get_magic_quotes_gpc(). * @param bool $magic_quotes if $s is GET/POST var, set to 0.
* This undoes the stupidity of magic quotes for GPC. * This undoes the stupidity of magic quotes for GPC.
* *
* @return string quoted string to be sent back to database * @return string quoted string to be sent back to database

View File

@@ -54,13 +54,6 @@ function err($s)
// undo stupid magic quotes // undo stupid magic quotes
function undomq(&$m) function undomq(&$m)
{ {
if (get_magic_quotes_gpc()) {
// undo the damage
$m = str_replace('\\\\','\\',$m);
$m = str_replace('\"','"',$m);
$m = str_replace('\\\'','\'',$m);
}
return $m; return $m;
} }

View File

@@ -31,7 +31,7 @@ class limesurvey_lang {
var $gettextclass; var $gettextclass;
var $langcode; var $langcode;
function limesurvey_lang($langcode){ function __construct($langcode){
global $rootdir; global $rootdir;
$langcode=sanitize_languagecode($langcode); $langcode=sanitize_languagecode($langcode);
$streamer = new FileReader($rootdir.'/locale/'.$langcode.'/LC_MESSAGES/'.$langcode.'.mo'); $streamer = new FileReader($rootdir.'/locale/'.$langcode.'/LC_MESSAGES/'.$langcode.'.mo');

View File

@@ -1010,7 +1010,7 @@
} }
$questionNum = $qinfo['qid']; $questionNum = $qinfo['qid'];
$type = $qinfo['type']; $type = $qinfo['type'];
$hasSubqs = (isset($qinfo['subqs']) && count($qinfo['subqs'] > 0)); $hasSubqs = (isset($qinfo['subqs']) && is_array($qinfo['subqs']) && count($qinfo['subqs']) > 0);
$qattr = isset($this->qattr[$questionNum]) ? $this->qattr[$questionNum] : array(); $qattr = isset($this->qattr[$questionNum]) ? $this->qattr[$questionNum] : array();
if (isset($qattr['input_boxes']) && $qattr['input_boxes'] == '1') if (isset($qattr['input_boxes']) && $qattr['input_boxes'] == '1')
@@ -4727,12 +4727,6 @@
} }
// otherwise will already be in yyyy-mm-dd format after ProcessCurrentResponses() // otherwise will already be in yyyy-mm-dd format after ProcessCurrentResponses()
break; break;
case '|': //File upload
// This block can be removed once we require 5.3 or later
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
$val=addslashes($val);
}
break;
case 'N': //NUMERICAL QUESTION TYPE case 'N': //NUMERICAL QUESTION TYPE
case 'K': //MULTIPLE NUMERICAL QUESTION case 'K': //MULTIPLE NUMERICAL QUESTION
if (trim($val)=='') { if (trim($val)=='') {
@@ -7184,7 +7178,7 @@ EOT;
foreach(explode("\n",$tests) as $test) foreach(explode("\n",$tests) as $test)
{ {
$args = explode("~",$test); $args = explode("~",$test);
$type = (($args[1]=='expr') ? '*' : ($args[1]=='message') ? 'X' : 'S'); $type = ((($args[1]=='expr') ? '*' : ($args[1]=='message')) ? 'X' : 'S');
$vars[$args[0]] = array('sgqa'=>$args[0], 'code'=>'', 'jsName'=>'java' . $args[0], 'jsName_on'=>'java' . $args[0], 'readWrite'=>'Y', 'type'=>$type, 'relevanceStatus'=>'1', 'gid'=>1, 'gseq'=>1, 'qseq'=>$i, 'qid'=>$i); $vars[$args[0]] = array('sgqa'=>$args[0], 'code'=>'', 'jsName'=>'java' . $args[0], 'jsName_on'=>'java' . $args[0], 'readWrite'=>'Y', 'type'=>$type, 'relevanceStatus'=>'1', 'gid'=>1, 'gseq'=>1, 'qseq'=>$i, 'qid'=>$i);
$varSeq[] = $args[0]; $varSeq[] = $args[0];
$testArgs[] = $args; $testArgs[] = $args;
@@ -7896,7 +7890,7 @@ EOD;
|| ($this->surveyMode=='group' && $gseq != -1 && isset($var['gseq']) && $gseq == $var['gseq']) || ($this->surveyMode=='group' && $gseq != -1 && isset($var['gseq']) && $gseq == $var['gseq'])
|| ($this->surveyMode=='question' && $qseq != -1 && isset($var['qseq']) && $qseq == $var['qseq'])) || ($this->surveyMode=='question' && $qseq != -1 && isset($var['qseq']) && $qseq == $var['qseq']))
{ {
return (isset($var['jsName_on']) ? $var['jsName_on'] : (isset($var['jsName'])) ? $var['jsName'] : $default); return ((isset($var['jsName_on']) ? $var['jsName_on'] : (isset($var['jsName']))) ? $var['jsName'] : $default);
} }
else { else {
return (isset($var['jsName']) ? $var['jsName'] : $default); return (isset($var['jsName']) ? $var['jsName'] : $default);

View File

@@ -98,7 +98,7 @@ class gettext_reader {
* @param object Reader the StreamReader object * @param object Reader the StreamReader object
* @param boolean enable_cache Enable or disable caching of strings (default on) * @param boolean enable_cache Enable or disable caching of strings (default on)
*/ */
function gettext_reader($Reader, $enable_cache = true) { function __construct($Reader, $enable_cache = true) {
// If there isn't a StreamReader, turn on short circuit mode. // If there isn't a StreamReader, turn on short circuit mode.
if (! $Reader || isset($Reader->error) ) { if (! $Reader || isset($Reader->error) ) {
$this->short_circuit = true; $this->short_circuit = true;

View File

@@ -49,7 +49,7 @@ class StringReader {
var $_pos; var $_pos;
var $_str; var $_str;
function StringReader($str='') { function __construct($str='') {
$this->_str = $str; $this->_str = $str;
$this->_pos = 0; $this->_pos = 0;
} }
@@ -86,7 +86,7 @@ class FileReader {
var $_fd; var $_fd;
var $_length; var $_length;
function FileReader($filename) { function __construct($filename) {
if (file_exists($filename)) { if (file_exists($filename)) {
$this->_length=filesize($filename); $this->_length=filesize($filename);
@@ -143,7 +143,7 @@ class FileReader {
// Preloads entire file in memory first, then creates a StringReader // Preloads entire file in memory first, then creates a StringReader
// over it (it assumes knowledge of StringReader internals) // over it (it assumes knowledge of StringReader internals)
class CachedFileReader extends StringReader { class CachedFileReader extends StringReader {
function CachedFileReader($filename) { function __construct($filename) {
if (file_exists($filename)) { if (file_exists($filename)) {
$length=filesize($filename); $length=filesize($filename);

View File

@@ -1460,18 +1460,11 @@ class PHPMailer {
if (!is_readable($path)) { if (!is_readable($path)) {
throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE); throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE);
} }
if (function_exists('get_magic_quotes')) {
function get_magic_quotes() {
return false;
}
}
if (PHP_VERSION < 6) { if (PHP_VERSION < 6) {
$magic_quotes = get_magic_quotes_runtime(); $magic_quotes = 0;
@set_magic_quotes_runtime(0);
} }
$file_buffer = file_get_contents($path); $file_buffer = file_get_contents($path);
$file_buffer = $this->EncodeString($file_buffer, $encoding); $file_buffer = $this->EncodeString($file_buffer, $encoding);
if (PHP_VERSION < 6) { @set_magic_quotes_runtime($magic_quotes); }
return $file_buffer; return $file_buffer;
} catch (Exception $e) { } catch (Exception $e) {
$this->SetError($e->getMessage()); $this->SetError($e->getMessage());

View File

@@ -436,7 +436,7 @@ function db_quote($str,$ispostvar=false)
// This functions escapes the string only inside // This functions escapes the string only inside
{ {
global $connect; global $connect;
if ($ispostvar) { return $connect->escape($str, get_magic_quotes_gpc());} if ($ispostvar) { return $connect->escape($str, 0);}
else {return $connect->escape($str);} else {return $connect->escape($str);}
} }
@@ -445,7 +445,7 @@ function db_quoteall($str,$ispostvar=false)
// IF you are quoting a variable from a POST/GET then set $ispostvar to true so it doesnt get quoted twice. // IF you are quoting a variable from a POST/GET then set $ispostvar to true so it doesnt get quoted twice.
{ {
global $connect; global $connect;
if ($ispostvar) { return $connect->qstr($str, get_magic_quotes_gpc());} if ($ispostvar) { return $connect->qstr($str, 0);}
else {return $connect->qstr($str);} else {return $connect->qstr($str);}
} }
@@ -4161,27 +4161,11 @@ function CategorySort($a, $b)
return $result; return $result;
} }
if (!function_exists('get_magic_quotes_gpc')) {
/**
* Gets the current configuration setting of magic_quotes_gpc
* NOTE: Compat variant for PHP 6+ versions
*
* @link http://www.php.net/manual/en/function.get-magic-quotes-gpc.php
* @return int 0 if magic_quotes_gpc is off, 1 otherwise.
*/
function get_magic_quotes_gpc() {
return 0;
}
}
// make sure the given string (which comes from a POST or GET variable) // make sure the given string (which comes from a POST or GET variable)
// is safe to use in MySQL. This does nothing if gpc_magic_quotes is on. // is safe to use in MySQL. This does nothing if gpc_magic_quotes is on.
function auto_escape($str) { function auto_escape($str) {
global $connect; global $connect;
if (!get_magic_quotes_gpc()) {
return $connect->escape($str); return $connect->escape($str);
}
return $str;
} }
// the opposite of the above: takes a POST or GET variable which may or // the opposite of the above: takes a POST or GET variable which may or
// may not have been 'auto-quoted', and return the *unquoted* version. // may not have been 'auto-quoted', and return the *unquoted* version.
@@ -4189,10 +4173,7 @@ function auto_escape($str) {
// a SQL query. // a SQL query.
function auto_unescape($str) { function auto_unescape($str) {
if (!isset($str)) {return null;}; if (!isset($str)) {return null;};
if (!get_magic_quotes_gpc()) {
return $str; return $str;
}
return stripslashes($str);
} }
// make a string safe to include in an HTML 'value' attribute. // make a string safe to include in an HTML 'value' attribute.
function html_escape($str) { function html_escape($str) {
@@ -4235,7 +4216,7 @@ function getHeader($meta = false)
if (!isset($_SESSION['interviewer'])) { if (!isset($_SESSION['interviewer'])) {
$_SESSION['interviewer'] = $interviewer; $_SESSION['interviewer'] = $interviewer;
} }
if ($SESSION['interviewer']) if ($_SESSION['interviewer'])
{ {
$js_header_includes[] = '/../../js/popup.js'; //queXS Addition $js_header_includes[] = '/../../js/popup.js'; //queXS Addition
include_once("quexs.php"); include_once("quexs.php");
@@ -4565,7 +4546,6 @@ function SendEmailMessage($mail, $body, $subject, $to, $from, $sitename, $ishtml
} }
} }
$mail->AddCustomHeader("X-Surveymailer: $sitename Emailer (LimeSurvey.sourceforge.net)"); $mail->AddCustomHeader("X-Surveymailer: $sitename Emailer (LimeSurvey.sourceforge.net)");
if (get_magic_quotes_gpc() != "0") {$body = stripcslashes($body);}
if ($ishtml) { if ($ishtml) {
$mail->IsHTML(true); $mail->IsHTML(true);
$mail->Body = $body; $mail->Body = $body;
@@ -4704,7 +4684,7 @@ function modify_database($sqlfile='', $sqlstring='')
} }
} else { } else {
$sqlstring = trim($sqlstring); $sqlstring = trim($sqlstring);
if ($sqlstring{strlen($sqlstring)-1} != ";") { if ($sqlstring[strlen($sqlstring)-1] != ";") {
$sqlstring .= ";"; // add it in if it's not there. $sqlstring .= ";"; // add it in if it's not there.
} }
$lines[] = $sqlstring; $lines[] = $sqlstring;
@@ -5964,9 +5944,9 @@ function sRandomChars($length,$pattern="23456789abcdefghijkmnpqrstuvwxyz")
for($i=0;$i<$length;$i++) for($i=0;$i<$length;$i++)
{ {
if(isset($key)) if(isset($key))
$key .= $pattern{rand(0,$patternlength)}; $key .= $pattern[rand(0,$patternlength)];
else else
$key = $pattern{rand(0,$patternlength)}; $key = $pattern[rand(0,$patternlength)];
} }
return $key; return $key;
} }
@@ -6365,7 +6345,7 @@ function GetAttributeValue($surveyid,$attrName,$token)
{ {
return null; return null;
} }
$sanitized_token=$connect->qstr($token,get_magic_quotes_gpc()); $sanitized_token=$connect->qstr($token,0);
$surveyid=sanitize_int($surveyid); $surveyid=sanitize_int($surveyid);
$query="SELECT $attrName FROM {$dbprefix}tokens_$surveyid WHERE token=$sanitized_token"; $query="SELECT $attrName FROM {$dbprefix}tokens_$surveyid WHERE token=$sanitized_token";

View File

@@ -840,7 +840,7 @@ Changes from 1.91+ (build 10629) to 1.91+ (build 10647)
#Updated translation: Greek (c_schmitz) #Updated translation: Greek (c_schmitz)
#Updated translation: Italian (c_schmitz) #Updated translation: Italian (c_schmitz)
-Fixed issue #5376: Timestamp for login attempts was improperly formatted. Fixed. (mot3) -Fixed issue #5376: Timestamp for login attempts was improperly formatted. Fixed. (mot3)
-Fixed issue #5377: get_magic_quotes_gpc() finally gone with PHP 6. Conditional forward-compat function fixes fatal errors. (mot3) -Fixed issue #5377: 0 finally gone with PHP 6. Conditional forward-compat function fixes fatal errors. (mot3)
-Fixed issue #5381: Multiple invitations sent (idobraca) -Fixed issue #5381: Multiple invitations sent (idobraca)
-Fixed issue: Firstname & surname aren't used when sending invitation and reminders even if they are provided by survey administrator in token table (idobraca) -Fixed issue: Firstname & surname aren't used when sending invitation and reminders even if they are provided by survey administrator in token table (idobraca)
-Fixed issue: No tabs are showing when editing survey question having more than one language (idobraca) -Fixed issue: No tabs are showing when editing survey question having more than one language (idobraca)

View File

@@ -2536,8 +2536,7 @@ function UpdateFieldArray()
if (isset($_SESSION['fieldarray'])) if (isset($_SESSION['fieldarray']))
{ {
reset($_SESSION['fieldarray']); foreach($_SESSION['fieldarray'] as $key => $value)
while ( list($key) = each($_SESSION['fieldarray']) )
{ {
$questionarray =& $_SESSION['fieldarray'][$key]; $questionarray =& $_SESSION['fieldarray'][$key];

View File

@@ -912,8 +912,8 @@ function return_array_filter_strings($ia, $qidattributes, $thissurvey, $ansrow,
// ================================================================== // ==================================================================
// setting constants for 'checked' and 'selected' inputs // setting constants for 'checked' and 'selected' inputs
define('CHECKED' , ' checked="checked"' , true); define('CHECKED' , ' checked="checked"');
define('SELECTED' , ' selected="selected"' , true); define('SELECTED' , ' selected="selected"');
// ================================================================== // ==================================================================
// QUESTION METHODS ================================================= // QUESTION METHODS =================================================

View File

@@ -206,12 +206,12 @@ function templatereplace($line, $replacements=array(), $anonymized=false, $quest
$_question_text = '<div class="em_equation">' .$_question_text. '</div>'; $_question_text = '<div class="em_equation">' .$_question_text. '</div>';
} }
if ( if ((
$showqnumcode == 'both' || $showqnumcode == 'both' ||
$showqnumcode == 'number' || $showqnumcode == 'number' ||
($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) || ($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) ||
($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') || ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') ||
($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'N') ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'N')) && is_array($question)
) )
{ {
$_question_number = $question['number']; $_question_number = $question['number'];
@@ -220,12 +220,12 @@ function templatereplace($line, $replacements=array(), $anonymized=false, $quest
{ {
$_question_number = ''; $_question_number = '';
}; };
if ( if ((
$showqnumcode == 'both' || $showqnumcode == 'both' ||
$showqnumcode == 'code' || $showqnumcode == 'code' ||
($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) || ($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) ||
($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') || ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') ||
($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'C') ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'C')) && is_array($question)
) )
{ {
$_question_code = $question['code']; $_question_code = $question['code'];
@@ -708,7 +708,7 @@ EOD;
$coreReplacements['LOADHEADING'] = $clang->gT("Load A Previously Saved Survey"); $coreReplacements['LOADHEADING'] = $clang->gT("Load A Previously Saved Survey");
$coreReplacements['LOADMESSAGE'] = $clang->gT("You can load a survey that you have previously saved from this screen.")."<br />".$clang->gT("Type in the 'name' you used to save the survey, and the password.")."<br />"; $coreReplacements['LOADMESSAGE'] = $clang->gT("You can load a survey that you have previously saved from this screen.")."<br />".$clang->gT("Type in the 'name' you used to save the survey, and the password.")."<br />";
$coreReplacements['NAVIGATOR'] = $navigator; // global $coreReplacements['NAVIGATOR'] = $navigator; // global
$coreReplacements['NOSURVEYID'] = $surveylist['nosid']; // global if (is_array($surveylist)) { $coreReplacements['NOSURVEYID'] = $surveylist['nosid'];} // global
$coreReplacements['NUMBEROFQUESTIONS'] = $_totalquestionsAsked; $coreReplacements['NUMBEROFQUESTIONS'] = $_totalquestionsAsked;
$coreReplacements['PASSTHRULABEL'] = ''; $coreReplacements['PASSTHRULABEL'] = '';
$coreReplacements['PASSTHRUVALUE'] = ''; $coreReplacements['PASSTHRUVALUE'] = '';
@@ -756,9 +756,13 @@ EOD;
$coreReplacements['SURVEYFORMAT'] = $surveyformat; // global $coreReplacements['SURVEYFORMAT'] = $surveyformat; // global
$coreReplacements['SURVEYLANGAGE'] = $clang->langcode; // this misspelling is kept for legacy reasons $coreReplacements['SURVEYLANGAGE'] = $clang->langcode; // this misspelling is kept for legacy reasons
$coreReplacements['SURVEYLANGUAGE'] = $clang->langcode; $coreReplacements['SURVEYLANGUAGE'] = $clang->langcode;
if (is_array($surveylist)) {
$coreReplacements['SURVEYLIST'] = $surveylist['list']; // global $coreReplacements['SURVEYLIST'] = $surveylist['list']; // global
$coreReplacements['SURVEYLISTHEADING'] = $surveylist['listheading']; // global $coreReplacements['SURVEYLISTHEADING'] = $surveylist['listheading']; // global
}
if (is_array($thissurvey)) {
$coreReplacements['SURVEYNAME'] = $thissurvey['name']; // global $coreReplacements['SURVEYNAME'] = $thissurvey['name']; // global
}
$coreReplacements['TEMPLATECSS'] = $_templatecss; $coreReplacements['TEMPLATECSS'] = $_templatecss;
$coreReplacements['TEMPLATEURL'] = $_templateurl; $coreReplacements['TEMPLATEURL'] = $_templateurl;
$coreReplacements['THEREAREXQUESTIONS'] = $_therearexquestions; $coreReplacements['THEREAREXQUESTIONS'] = $_therearexquestions;

View File

@@ -290,7 +290,7 @@ class HTML_QuickForm extends HTML_Common
$attributes = array('action'=>$action, 'method'=>$method, 'name'=>$formName, 'id'=>$formName) + $target; $attributes = array('action'=>$action, 'method'=>$method, 'name'=>$formName, 'id'=>$formName) + $target;
$this->updateAttributes($attributes); $this->updateAttributes($attributes);
if (!$trackSubmit || isset($_REQUEST['_qf__' . $formName])) { if (!$trackSubmit || isset($_REQUEST['_qf__' . $formName])) {
if (1 == get_magic_quotes_gpc()) { if (1 == 0) {
$this->_submitValues = $this->_recursiveFilter('stripslashes', 'get' == $method? $_GET: $_POST); $this->_submitValues = $this->_recursiveFilter('stripslashes', 'get' == $method? $_GET: $_POST);
foreach ($_FILES as $keyFirst => $valFirst) { foreach ($_FILES as $keyFirst => $valFirst) {
foreach ($valFirst as $keySecond => $valSecond) { foreach ($valFirst as $keySecond => $valSecond) {

View File

@@ -970,7 +970,7 @@ class PEAR_Config extends PEAR
return $this->raiseError("PEAR_Config::readConfigFile fopen('$file','r') failed"); return $this->raiseError("PEAR_Config::readConfigFile fopen('$file','r') failed");
} }
$size = filesize($file); $size = filesize($file);
$rt = get_magic_quotes_runtime(); $rt = 0;
set_magic_quotes_runtime(0); set_magic_quotes_runtime(0);
if (function_exists('file_get_contents')) { if (function_exists('file_get_contents')) {
fclose($fp); fclose($fp);

View File

@@ -501,7 +501,7 @@ class PEAR_DependencyDB
$err = PEAR::raiseError("Could not open dependencies file `".$this->_depdb."'"); $err = PEAR::raiseError("Could not open dependencies file `".$this->_depdb."'");
return $err; return $err;
} }
$rt = get_magic_quotes_runtime(); $rt = 0;
set_magic_quotes_runtime(0); set_magic_quotes_runtime(0);
clearstatcache(); clearstatcache();
if (function_exists('file_get_contents')) { if (function_exists('file_get_contents')) {
@@ -531,7 +531,7 @@ class PEAR_DependencyDB
$this->_unlock(); $this->_unlock();
return PEAR::raiseError("Could not open dependencies file `".$this->_depdb."' for writing"); return PEAR::raiseError("Could not open dependencies file `".$this->_depdb."' for writing");
} }
$rt = get_magic_quotes_runtime(); $rt = 0;
set_magic_quotes_runtime(0); set_magic_quotes_runtime(0);
fwrite($fp, serialize($deps)); fwrite($fp, serialize($deps));
set_magic_quotes_runtime($rt); set_magic_quotes_runtime($rt);

View File

@@ -696,7 +696,7 @@ class PEAR_Registry extends PEAR
return $this->raiseError('PEAR_Registry: could not open filemap "' . $this->filemap . '"', PEAR_REGISTRY_ERROR_FILE, null, null, $php_errormsg); return $this->raiseError('PEAR_Registry: could not open filemap "' . $this->filemap . '"', PEAR_REGISTRY_ERROR_FILE, null, null, $php_errormsg);
} }
clearstatcache(); clearstatcache();
$rt = get_magic_quotes_runtime(); $rt = 0;
set_magic_quotes_runtime(0); set_magic_quotes_runtime(0);
$fsize = filesize($this->filemap); $fsize = filesize($this->filemap);
if (function_exists('file_get_contents')) { if (function_exists('file_get_contents')) {
@@ -998,7 +998,7 @@ class PEAR_Registry extends PEAR
if ($fp === null) { if ($fp === null) {
return null; return null;
} }
$rt = get_magic_quotes_runtime(); $rt = 0;
set_magic_quotes_runtime(0); set_magic_quotes_runtime(0);
clearstatcache(); clearstatcache();
if (function_exists('file_get_contents')) { if (function_exists('file_get_contents')) {
@@ -1040,7 +1040,7 @@ class PEAR_Registry extends PEAR
if ($fp === null) { if ($fp === null) {
return null; return null;
} }
$rt = get_magic_quotes_runtime(); $rt = 0;
set_magic_quotes_runtime(0); set_magic_quotes_runtime(0);
clearstatcache(); clearstatcache();
if (function_exists('file_get_contents')) { if (function_exists('file_get_contents')) {

View File

@@ -98,7 +98,7 @@ class gettext_reader {
* @param object Reader the StreamReader object * @param object Reader the StreamReader object
* @param boolean enable_cache Enable or disable caching of strings (default on) * @param boolean enable_cache Enable or disable caching of strings (default on)
*/ */
function gettext_reader($Reader, $enable_cache = true) { function __construct($Reader, $enable_cache = true) {
// If there isn't a StreamReader, turn on short circuit mode. // If there isn't a StreamReader, turn on short circuit mode.
if (! $Reader || isset($Reader->error) ) { if (! $Reader || isset($Reader->error) ) {
$this->short_circuit = true; $this->short_circuit = true;

View File

@@ -49,7 +49,7 @@ class StringReader {
var $_pos; var $_pos;
var $_str; var $_str;
function StringReader($str='') { function __construct($str='') {
$this->_str = $str; $this->_str = $str;
$this->_pos = 0; $this->_pos = 0;
} }
@@ -86,7 +86,7 @@ class FileReader {
var $_fd; var $_fd;
var $_length; var $_length;
function FileReader($filename) { function __construct($filename) {
if (file_exists($filename)) { if (file_exists($filename)) {
$this->_length=filesize($filename); $this->_length=filesize($filename);
@@ -143,7 +143,7 @@ class FileReader {
// Preloads entire file in memory first, then creates a StringReader // Preloads entire file in memory first, then creates a StringReader
// over it (it assumes knowledge of StringReader internals) // over it (it assumes knowledge of StringReader internals)
class CachedFileReader extends StringReader { class CachedFileReader extends StringReader {
function CachedFileReader($filename) { function __construct($filename) {
if (file_exists($filename)) { if (file_exists($filename)) {
$length=filesize($filename); $length=filesize($filename);