"
."\t\n"
diff --git a/include/limesurvey/admin/userrighthandling.php b/include/limesurvey/admin/userrighthandling.php
index 9819cc23..399ef44d 100644
--- a/include/limesurvey/admin/userrighthandling.php
+++ b/include/limesurvey/admin/userrighthandling.php
@@ -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['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/users.js';
diff --git a/include/limesurvey/classes/adodb/adodb-csvlib.inc.php b/include/limesurvey/classes/adodb/adodb-csvlib.inc.php
index 0e80e0c5..75214a0d 100644
--- a/include/limesurvey/classes/adodb/adodb-csvlib.inc.php
+++ b/include/limesurvey/classes/adodb/adodb-csvlib.inc.php
@@ -252,7 +252,6 @@ $ADODB_INCLUDED_CSV = 1;
//var_dump($arr);
if (!is_array($arr)) {
$err = "Recordset had unexpected EOF (in serialized recordset)";
- if (get_magic_quotes_runtime()) $err .= ". Magic Quotes Runtime should be disabled!";
return $false;
}
$rs = new $rsclass();
diff --git a/include/limesurvey/classes/adodb/adodb-perf.inc.php b/include/limesurvey/classes/adodb/adodb-perf.inc.php
index 42ad7143..e333e95c 100644
--- a/include/limesurvey/classes/adodb/adodb-perf.inc.php
+++ b/include/limesurvey/classes/adodb/adodb-perf.inc.php
@@ -691,12 +691,6 @@ Committed_AS: 348732 kB
}
$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;
else $nsql = $_SESSION['ADODB_PERF_SQL'];
@@ -999,12 +993,6 @@ Committed_AS: 348732 kB
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;
}
diff --git a/include/limesurvey/classes/adodb/adodb-xmlschema.inc.php b/include/limesurvey/classes/adodb/adodb-xmlschema.inc.php
index 08901550..e70d1c6f 100644
--- a/include/limesurvey/classes/adodb/adodb-xmlschema.inc.php
+++ b/include/limesurvey/classes/adodb/adodb-xmlschema.inc.php
@@ -1303,8 +1303,7 @@ class adoSchema {
*/
function __construct( $db ) {
// Initialize the environment
- $this->mgq = get_magic_quotes_runtime();
- ini_set("magic_quotes_runtime", 0);
+ $this->mgq = 0;
#set_magic_quotes_runtime(0);
$this->db = $db;
diff --git a/include/limesurvey/classes/adodb/adodb-xmlschema03.inc.php b/include/limesurvey/classes/adodb/adodb-xmlschema03.inc.php
index 45a59bbf..0a8e9511 100644
--- a/include/limesurvey/classes/adodb/adodb-xmlschema03.inc.php
+++ b/include/limesurvey/classes/adodb/adodb-xmlschema03.inc.php
@@ -1407,9 +1407,8 @@ class adoSchema {
*/
function __construct( $db ) {
// Initialize the environment
- $this->mgq = get_magic_quotes_runtime();
+ $this->mgq = 0;
#set_magic_quotes_runtime(0);
- ini_set("magic_quotes_runtime", 0);
$this->db = $db;
$this->debug = $this->db->debug;
diff --git a/include/limesurvey/classes/adodb/adodb.inc.php b/include/limesurvey/classes/adodb/adodb.inc.php
index 5207cc04..74880233 100644
--- a/include/limesurvey/classes/adodb/adodb.inc.php
+++ b/include/limesurvey/classes/adodb/adodb.inc.php
@@ -834,7 +834,7 @@ if (!defined('_ADODB_LAYER')) {
* Requested by "Karsten Dambekalns"
*/
function QMagic($s) {
- return $this->qstr($s,get_magic_quotes_gpc());
+ return $this->qstr($s,0);
}
function q(&$s) {
@@ -2034,9 +2034,6 @@ if (!defined('_ADODB_LAYER')) {
if (!$rs) {
// no cached rs found
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) {
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());
*
* @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.
*
* @return quoted string to be sent back to database
diff --git a/include/limesurvey/classes/adodb/drivers/adodb-mssql.inc.php b/include/limesurvey/classes/adodb/drivers/adodb-mssql.inc.php
index fb87a4ac..43902233 100644
--- a/include/limesurvey/classes/adodb/drivers/adodb-mssql.inc.php
+++ b/include/limesurvey/classes/adodb/drivers/adodb-mssql.inc.php
@@ -170,7 +170,7 @@ class ADODB_mssql extends ADOConnection {
* An example is $db->qstr("Don't bother",magic_quotes_runtime());
*
* @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.
*
* @return quoted string to be sent back to database
diff --git a/include/limesurvey/classes/adodb/drivers/adodb-mysqli.inc.php b/include/limesurvey/classes/adodb/drivers/adodb-mysqli.inc.php
index 82899ec0..28b05dd5 100644
--- a/include/limesurvey/classes/adodb/drivers/adodb-mysqli.inc.php
+++ b/include/limesurvey/classes/adodb/drivers/adodb-mysqli.inc.php
@@ -226,10 +226,10 @@ class ADODB_mysqli extends ADOConnection {
* @param string $s The string to quote
* @param boolean $magic_quotes If false, use mysqli_real_escape_string()
* 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
* 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
*/
function qstr($s, $magic_quotes = false)
diff --git a/include/limesurvey/classes/adodb/drivers/adodb-oci8.inc.php b/include/limesurvey/classes/adodb/drivers/adodb-oci8.inc.php
index 48f9107b..2a1002e4 100644
--- a/include/limesurvey/classes/adodb/drivers/adodb-oci8.inc.php
+++ b/include/limesurvey/classes/adodb/drivers/adodb-oci8.inc.php
@@ -1495,7 +1495,7 @@ SELECT /*+ RULE */ distinct b.column_name
* An example is $db->qstr("Don't bother",magic_quotes_runtime());
*
* @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.
*
* @return string quoted string to be sent back to database
diff --git a/include/limesurvey/classes/adodb/server.php b/include/limesurvey/classes/adodb/server.php
index 227bb8b2..9954cbce 100644
--- a/include/limesurvey/classes/adodb/server.php
+++ b/include/limesurvey/classes/adodb/server.php
@@ -54,13 +54,6 @@ function err($s)
// undo stupid magic quotes
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;
}
diff --git a/include/limesurvey/classes/core/language.php b/include/limesurvey/classes/core/language.php
index 3078eab9..88390d0e 100644
--- a/include/limesurvey/classes/core/language.php
+++ b/include/limesurvey/classes/core/language.php
@@ -31,7 +31,7 @@ class limesurvey_lang {
var $gettextclass;
var $langcode;
- function limesurvey_lang($langcode){
+ function __construct($langcode){
global $rootdir;
$langcode=sanitize_languagecode($langcode);
$streamer = new FileReader($rootdir.'/locale/'.$langcode.'/LC_MESSAGES/'.$langcode.'.mo');
diff --git a/include/limesurvey/classes/expressions/LimeExpressionManager.php b/include/limesurvey/classes/expressions/LimeExpressionManager.php
index 4e55d0a0..7913cd16 100644
--- a/include/limesurvey/classes/expressions/LimeExpressionManager.php
+++ b/include/limesurvey/classes/expressions/LimeExpressionManager.php
@@ -1010,7 +1010,7 @@
}
$questionNum = $qinfo['qid'];
$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();
if (isset($qattr['input_boxes']) && $qattr['input_boxes'] == '1')
@@ -4727,12 +4727,6 @@
}
// otherwise will already be in yyyy-mm-dd format after ProcessCurrentResponses()
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 'K': //MULTIPLE NUMERICAL QUESTION
if (trim($val)=='') {
@@ -7184,7 +7178,7 @@ EOT;
foreach(explode("\n",$tests) as $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);
$varSeq[] = $args[0];
$testArgs[] = $args;
@@ -7896,7 +7890,7 @@ EOD;
|| ($this->surveyMode=='group' && $gseq != -1 && isset($var['gseq']) && $gseq == $var['gseq'])
|| ($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 {
return (isset($var['jsName']) ? $var['jsName'] : $default);
diff --git a/include/limesurvey/classes/php-gettext/gettext.php b/include/limesurvey/classes/php-gettext/gettext.php
index 5064047c..81af5550 100644
--- a/include/limesurvey/classes/php-gettext/gettext.php
+++ b/include/limesurvey/classes/php-gettext/gettext.php
@@ -98,7 +98,7 @@ class gettext_reader {
* @param object Reader the StreamReader object
* @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 (! $Reader || isset($Reader->error) ) {
$this->short_circuit = true;
diff --git a/include/limesurvey/classes/php-gettext/streams.php b/include/limesurvey/classes/php-gettext/streams.php
index 3cdc1584..00cf6cc5 100644
--- a/include/limesurvey/classes/php-gettext/streams.php
+++ b/include/limesurvey/classes/php-gettext/streams.php
@@ -49,7 +49,7 @@ class StringReader {
var $_pos;
var $_str;
- function StringReader($str='') {
+ function __construct($str='') {
$this->_str = $str;
$this->_pos = 0;
}
@@ -86,7 +86,7 @@ class FileReader {
var $_fd;
var $_length;
- function FileReader($filename) {
+ function __construct($filename) {
if (file_exists($filename)) {
$this->_length=filesize($filename);
@@ -143,7 +143,7 @@ class FileReader {
// Preloads entire file in memory first, then creates a StringReader
// over it (it assumes knowledge of StringReader internals)
class CachedFileReader extends StringReader {
- function CachedFileReader($filename) {
+ function __construct($filename) {
if (file_exists($filename)) {
$length=filesize($filename);
diff --git a/include/limesurvey/classes/phpmailer/class.phpmailer.php b/include/limesurvey/classes/phpmailer/class.phpmailer.php
index 144892c8..619c928c 100644
--- a/include/limesurvey/classes/phpmailer/class.phpmailer.php
+++ b/include/limesurvey/classes/phpmailer/class.phpmailer.php
@@ -1460,18 +1460,11 @@ class PHPMailer {
if (!is_readable($path)) {
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) {
- $magic_quotes = get_magic_quotes_runtime();
- @set_magic_quotes_runtime(0);
+ $magic_quotes = 0;
}
$file_buffer = file_get_contents($path);
$file_buffer = $this->EncodeString($file_buffer, $encoding);
- if (PHP_VERSION < 6) { @set_magic_quotes_runtime($magic_quotes); }
return $file_buffer;
} catch (Exception $e) {
$this->SetError($e->getMessage());
@@ -2316,4 +2309,4 @@ class phpmailerException extends Exception {
return $errorMsg;
}
}
-?>
\ No newline at end of file
+?>
diff --git a/include/limesurvey/common_functions.php b/include/limesurvey/common_functions.php
index 72e6ce8a..52e6cd18 100644
--- a/include/limesurvey/common_functions.php
+++ b/include/limesurvey/common_functions.php
@@ -436,7 +436,7 @@ function db_quote($str,$ispostvar=false)
// This functions escapes the string only inside
{
global $connect;
- if ($ispostvar) { return $connect->escape($str, get_magic_quotes_gpc());}
+ if ($ispostvar) { return $connect->escape($str, 0);}
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.
{
global $connect;
- if ($ispostvar) { return $connect->qstr($str, get_magic_quotes_gpc());}
+ if ($ispostvar) { return $connect->qstr($str, 0);}
else {return $connect->qstr($str);}
}
@@ -4161,27 +4161,11 @@ function CategorySort($a, $b)
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)
// is safe to use in MySQL. This does nothing if gpc_magic_quotes is on.
function auto_escape($str) {
global $connect;
- if (!get_magic_quotes_gpc()) {
- return $connect->escape($str);
- }
- return $str;
+ return $connect->escape($str);
}
// 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.
@@ -4189,10 +4173,7 @@ function auto_escape($str) {
// a SQL query.
function auto_unescape($str) {
if (!isset($str)) {return null;};
- if (!get_magic_quotes_gpc()) {
- return $str;
- }
- return stripslashes($str);
+ return $str;
}
// make a string safe to include in an HTML 'value' attribute.
function html_escape($str) {
@@ -4235,7 +4216,7 @@ function getHeader($meta = false)
if (!isset($_SESSION['interviewer'])) {
$_SESSION['interviewer'] = $interviewer;
}
- if ($SESSION['interviewer'])
+ if ($_SESSION['interviewer'])
{
$js_header_includes[] = '/../../js/popup.js'; //queXS Addition
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)");
- if (get_magic_quotes_gpc() != "0") {$body = stripcslashes($body);}
if ($ishtml) {
$mail->IsHTML(true);
$mail->Body = $body;
@@ -4704,7 +4684,7 @@ function modify_database($sqlfile='', $sqlstring='')
}
} else {
$sqlstring = trim($sqlstring);
- if ($sqlstring{strlen($sqlstring)-1} != ";") {
+ if ($sqlstring[strlen($sqlstring)-1] != ";") {
$sqlstring .= ";"; // add it in if it's not there.
}
$lines[] = $sqlstring;
@@ -5964,9 +5944,9 @@ function sRandomChars($length,$pattern="23456789abcdefghijkmnpqrstuvwxyz")
for($i=0;$i<$length;$i++)
{
if(isset($key))
- $key .= $pattern{rand(0,$patternlength)};
+ $key .= $pattern[rand(0,$patternlength)];
else
- $key = $pattern{rand(0,$patternlength)};
+ $key = $pattern[rand(0,$patternlength)];
}
return $key;
}
@@ -6365,7 +6345,7 @@ function GetAttributeValue($surveyid,$attrName,$token)
{
return null;
}
- $sanitized_token=$connect->qstr($token,get_magic_quotes_gpc());
+ $sanitized_token=$connect->qstr($token,0);
$surveyid=sanitize_int($surveyid);
$query="SELECT $attrName FROM {$dbprefix}tokens_$surveyid WHERE token=$sanitized_token";
diff --git a/include/limesurvey/docs/release_notes.txt b/include/limesurvey/docs/release_notes.txt
index 979292be..111b9758 100644
--- a/include/limesurvey/docs/release_notes.txt
+++ b/include/limesurvey/docs/release_notes.txt
@@ -840,7 +840,7 @@ Changes from 1.91+ (build 10629) to 1.91+ (build 10647)
#Updated translation: Greek (c_schmitz)
#Updated translation: Italian (c_schmitz)
-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: 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)
diff --git a/include/limesurvey/index.php b/include/limesurvey/index.php
index 44f7773a..4f1084ca 100644
--- a/include/limesurvey/index.php
+++ b/include/limesurvey/index.php
@@ -2536,8 +2536,7 @@ function UpdateFieldArray()
if (isset($_SESSION['fieldarray']))
{
- reset($_SESSION['fieldarray']);
- while ( list($key) = each($_SESSION['fieldarray']) )
+ foreach($_SESSION['fieldarray'] as $key => $value)
{
$questionarray =& $_SESSION['fieldarray'][$key];
diff --git a/include/limesurvey/qanda.php b/include/limesurvey/qanda.php
index 40a6b109..af201b5c 100644
--- a/include/limesurvey/qanda.php
+++ b/include/limesurvey/qanda.php
@@ -912,8 +912,8 @@ function return_array_filter_strings($ia, $qidattributes, $thissurvey, $ansrow,
// ==================================================================
// setting constants for 'checked' and 'selected' inputs
-define('CHECKED' , ' checked="checked"' , true);
-define('SELECTED' , ' selected="selected"' , true);
+define('CHECKED' , ' checked="checked"');
+define('SELECTED' , ' selected="selected"');
// ==================================================================
// QUESTION METHODS =================================================
diff --git a/include/limesurvey/replacements.php b/include/limesurvey/replacements.php
index 15403c3f..97c32877 100644
--- a/include/limesurvey/replacements.php
+++ b/include/limesurvey/replacements.php
@@ -206,12 +206,12 @@ function templatereplace($line, $replacements=array(), $anonymized=false, $quest
$_question_text = '' .$_question_text. '
';
}
- if (
+ if ((
$showqnumcode == 'both' ||
$showqnumcode == 'number' ||
($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) ||
($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') ||
- ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'N')
+ ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'N')) && is_array($question)
)
{
$_question_number = $question['number'];
@@ -220,12 +220,12 @@ function templatereplace($line, $replacements=array(), $anonymized=false, $quest
{
$_question_number = '';
};
- if (
+ if ((
$showqnumcode == 'both' ||
$showqnumcode == 'code' ||
($showqnumcode == 'choose' && !isset($thissurvey['showqnumcode'])) ||
($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B') ||
- ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'C')
+ ($showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'C')) && is_array($question)
)
{
$_question_code = $question['code'];
@@ -708,7 +708,7 @@ EOD;
$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.")."
".$clang->gT("Type in the 'name' you used to save the survey, and the password.")."
";
$coreReplacements['NAVIGATOR'] = $navigator; // global
- $coreReplacements['NOSURVEYID'] = $surveylist['nosid']; // global
+ if (is_array($surveylist)) { $coreReplacements['NOSURVEYID'] = $surveylist['nosid'];} // global
$coreReplacements['NUMBEROFQUESTIONS'] = $_totalquestionsAsked;
$coreReplacements['PASSTHRULABEL'] = '';
$coreReplacements['PASSTHRUVALUE'] = '';
@@ -756,9 +756,13 @@ EOD;
$coreReplacements['SURVEYFORMAT'] = $surveyformat; // global
$coreReplacements['SURVEYLANGAGE'] = $clang->langcode; // this misspelling is kept for legacy reasons
$coreReplacements['SURVEYLANGUAGE'] = $clang->langcode;
- $coreReplacements['SURVEYLIST'] = $surveylist['list']; // global
- $coreReplacements['SURVEYLISTHEADING'] = $surveylist['listheading']; // global
- $coreReplacements['SURVEYNAME'] = $thissurvey['name']; // global
+ if (is_array($surveylist)) {
+ $coreReplacements['SURVEYLIST'] = $surveylist['list']; // global
+ $coreReplacements['SURVEYLISTHEADING'] = $surveylist['listheading']; // global
+ }
+ if (is_array($thissurvey)) {
+ $coreReplacements['SURVEYNAME'] = $thissurvey['name']; // global
+ }
$coreReplacements['TEMPLATECSS'] = $_templatecss;
$coreReplacements['TEMPLATEURL'] = $_templateurl;
$coreReplacements['THEREAREXQUESTIONS'] = $_therearexquestions;
diff --git a/include/pear/HTML/QuickForm.php b/include/pear/HTML/QuickForm.php
index 649af05d..167857e6 100644
--- a/include/pear/HTML/QuickForm.php
+++ b/include/pear/HTML/QuickForm.php
@@ -290,7 +290,7 @@ class HTML_QuickForm extends HTML_Common
$attributes = array('action'=>$action, 'method'=>$method, 'name'=>$formName, 'id'=>$formName) + $target;
$this->updateAttributes($attributes);
if (!$trackSubmit || isset($_REQUEST['_qf__' . $formName])) {
- if (1 == get_magic_quotes_gpc()) {
+ if (1 == 0) {
$this->_submitValues = $this->_recursiveFilter('stripslashes', 'get' == $method? $_GET: $_POST);
foreach ($_FILES as $keyFirst => $valFirst) {
foreach ($valFirst as $keySecond => $valSecond) {
diff --git a/include/pear/PEAR/Config.php b/include/pear/PEAR/Config.php
index 1992e681..c13c74fe 100644
--- a/include/pear/PEAR/Config.php
+++ b/include/pear/PEAR/Config.php
@@ -970,7 +970,7 @@ class PEAR_Config extends PEAR
return $this->raiseError("PEAR_Config::readConfigFile fopen('$file','r') failed");
}
$size = filesize($file);
- $rt = get_magic_quotes_runtime();
+ $rt = 0;
set_magic_quotes_runtime(0);
if (function_exists('file_get_contents')) {
fclose($fp);
diff --git a/include/pear/PEAR/DependencyDB.php b/include/pear/PEAR/DependencyDB.php
index 840cf673..db8856a6 100644
--- a/include/pear/PEAR/DependencyDB.php
+++ b/include/pear/PEAR/DependencyDB.php
@@ -501,7 +501,7 @@ class PEAR_DependencyDB
$err = PEAR::raiseError("Could not open dependencies file `".$this->_depdb."'");
return $err;
}
- $rt = get_magic_quotes_runtime();
+ $rt = 0;
set_magic_quotes_runtime(0);
clearstatcache();
if (function_exists('file_get_contents')) {
@@ -531,7 +531,7 @@ class PEAR_DependencyDB
$this->_unlock();
return PEAR::raiseError("Could not open dependencies file `".$this->_depdb."' for writing");
}
- $rt = get_magic_quotes_runtime();
+ $rt = 0;
set_magic_quotes_runtime(0);
fwrite($fp, serialize($deps));
set_magic_quotes_runtime($rt);
diff --git a/include/pear/PEAR/Registry.php b/include/pear/PEAR/Registry.php
index b198eba3..35460bde 100644
--- a/include/pear/PEAR/Registry.php
+++ b/include/pear/PEAR/Registry.php
@@ -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);
}
clearstatcache();
- $rt = get_magic_quotes_runtime();
+ $rt = 0;
set_magic_quotes_runtime(0);
$fsize = filesize($this->filemap);
if (function_exists('file_get_contents')) {
@@ -998,7 +998,7 @@ class PEAR_Registry extends PEAR
if ($fp === null) {
return null;
}
- $rt = get_magic_quotes_runtime();
+ $rt = 0;
set_magic_quotes_runtime(0);
clearstatcache();
if (function_exists('file_get_contents')) {
@@ -1040,7 +1040,7 @@ class PEAR_Registry extends PEAR
if ($fp === null) {
return null;
}
- $rt = get_magic_quotes_runtime();
+ $rt = 0;
set_magic_quotes_runtime(0);
clearstatcache();
if (function_exists('file_get_contents')) {
diff --git a/include/php-gettext-1.0.11/gettext.php b/include/php-gettext-1.0.11/gettext.php
index 5064047c..81af5550 100755
--- a/include/php-gettext-1.0.11/gettext.php
+++ b/include/php-gettext-1.0.11/gettext.php
@@ -98,7 +98,7 @@ class gettext_reader {
* @param object Reader the StreamReader object
* @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 (! $Reader || isset($Reader->error) ) {
$this->short_circuit = true;
diff --git a/include/php-gettext-1.0.11/streams.php b/include/php-gettext-1.0.11/streams.php
index 3cdc1584..00cf6cc5 100644
--- a/include/php-gettext-1.0.11/streams.php
+++ b/include/php-gettext-1.0.11/streams.php
@@ -49,7 +49,7 @@ class StringReader {
var $_pos;
var $_str;
- function StringReader($str='') {
+ function __construct($str='') {
$this->_str = $str;
$this->_pos = 0;
}
@@ -86,7 +86,7 @@ class FileReader {
var $_fd;
var $_length;
- function FileReader($filename) {
+ function __construct($filename) {
if (file_exists($filename)) {
$this->_length=filesize($filename);
@@ -143,7 +143,7 @@ class FileReader {
// Preloads entire file in memory first, then creates a StringReader
// over it (it assumes knowledge of StringReader internals)
class CachedFileReader extends StringReader {
- function CachedFileReader($filename) {
+ function __construct($filename) {
if (file_exists($filename)) {
$length=filesize($filename);