BUG 6453 Fix Bug deprecated PHP 5.3 features and functions in code.
This commit is contained in:
@@ -22,7 +22,9 @@ class Service_Comments
|
||||
}
|
||||
public function post()
|
||||
{
|
||||
$q="INSERT INTO comments (`UID`, `NOMBRE`, `COMENTARIO`) VALUES (NULL, '".mysql_escape_string($this->options->data->name)."', '".mysql_escape_string($this->options->data->comment)."')";
|
||||
// The mysql_escape_string function has been DEPRECATED as of PHP 5.3.0.
|
||||
// $q="INSERT INTO comments (`UID`, `NOMBRE`, `COMENTARIO`) VALUES (NULL, '".mysql_escape_string($this->options->data->name)."', '".mysql_escape_string($this->options->data->comment)."')";
|
||||
$q = "INSERT INTO comments (`UID`, `NOMBRE`, `COMENTARIO`) VALUES (NULL, '" . mysql_real_escape_string($this->options->data->name) . "', '". mysql_real_escape_string($this->options->data->comment). "')";
|
||||
$w = mysql_query($q,$this->db) or die(mysql_error());
|
||||
}
|
||||
function __call($n,$a)
|
||||
|
||||
@@ -257,7 +257,9 @@ class DataBaseMaintenance
|
||||
}
|
||||
|
||||
$sql = "SELECT * INTO OUTFILE '{$this->outfile}' FIELDS TERMINATED BY '\t|\t' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\t\t\r\r\n' FROM $table";
|
||||
mysql_escape_string("';");
|
||||
// The mysql_escape_string function has been DEPRECATED as of PHP 5.3.0.
|
||||
// Commented that is not assigned to a variable.
|
||||
// mysql_escape_string("';");
|
||||
if( ! @mysql_query($sql) ) {
|
||||
echo mysql_error() . "\n";
|
||||
return false;
|
||||
|
||||
@@ -264,7 +264,9 @@ class G
|
||||
* @return string $errorBox or $buffer
|
||||
*/
|
||||
/*public static*/ function fatalErrorHandler($buffer) {
|
||||
if (ereg("(error</b>:)(.+)(<br)", $buffer, $regs) ) {
|
||||
// The ereg function has been DEPRECATED as of PHP 5.3.0.
|
||||
// if (ereg("(error</b>:)(.+)(<br)", $buffer, $regs) ) {
|
||||
if (preg_match("/(error</b>:)(.+)(<br)/", $buffer, $regs) ) {
|
||||
$err = preg_replace("/<.*?>/","",$regs[2]);
|
||||
G::customErrorLog('FATAL', $err, '', 0, '');
|
||||
$ip_addr = G::getIpAddress();
|
||||
|
||||
@@ -163,7 +163,8 @@ else{ //cuando no esta definido
|
||||
|
||||
//***************** Session Initializations **************************/
|
||||
ini_alter( 'session.auto_start', '1' );
|
||||
ini_alter( 'register_globals', 'Off' );
|
||||
// This feature has been DEPRECATED as of PHP 5.3.0. default value Off
|
||||
// ini_alter( 'register_globals', 'Off' );
|
||||
session_start();
|
||||
ob_start();
|
||||
|
||||
|
||||
@@ -274,11 +274,20 @@ class Installer
|
||||
public function set_admin()
|
||||
{
|
||||
mysql_select_db($this->wf_site_name,$this->connection_database);
|
||||
$this->run_query('UPDATE USERS SET USR_USERNAME = \''.mysql_escape_string($this->options['admin']['username']).'\', `USR_PASSWORD` = \''.md5($this->options['admin']['password']).'\' WHERE `USR_UID` = \'00000000000000000000000000000001\' LIMIT 1',
|
||||
// The mysql_escape_string function has been DEPRECATED as of PHP 5.3.0.
|
||||
// $this->run_query('UPDATE USERS SET USR_USERNAME = \''.mysql_escape_string($this->options['admin']['username']).'\', `USR_PASSWORD` = \''.md5($this->options['admin']['password']).'\' WHERE `USR_UID` = \'00000000000000000000000000000001\' LIMIT 1',
|
||||
// "Add 'admin' user in ProcessMaker (wf)");
|
||||
$this->run_query('UPDATE USERS SET USR_USERNAME = \'' . mysql_real_escape_string($this->options['admin']['username']) . '\', ' .
|
||||
' `USR_PASSWORD` = \'' . md5($this->options['admin']['password']) . '\' ' .
|
||||
' WHERE `USR_UID` = \'00000000000000000000000000000001\' LIMIT 1',
|
||||
"Add 'admin' user in ProcessMaker (wf)");
|
||||
|
||||
mysql_select_db($this->rbac_site_name,$this->connection_database);
|
||||
$this->run_query('UPDATE USERS SET USR_USERNAME = \''.mysql_escape_string($this->options['admin']['username']).'\', `USR_PASSWORD` = \''.md5($this->options['admin']['password']).'\' WHERE `USR_UID` = \'00000000000000000000000000000001\' LIMIT 1',
|
||||
// The mysql_escape_string function has been DEPRECATED as of PHP 5.3.0.
|
||||
// $this->run_query('UPDATE USERS SET USR_USERNAME = \''.mysql_escape_string($this->options['admin']['username']).'\', `USR_PASSWORD` = \''.md5($this->options['admin']['password']).'\' WHERE `USR_UID` = \'00000000000000000000000000000001\' LIMIT 1',
|
||||
// "Add 'admin' user in ProcessMaker (rb)");
|
||||
$this->run_query('UPDATE USERS SET USR_USERNAME = \'' . mysql_real_escape_string($this->options['admin']['username']) . '\', ' .
|
||||
' `USR_PASSWORD` = \'' . md5($this->options['admin']['password']) . '\' ' .
|
||||
' WHERE `USR_UID` = \'00000000000000000000000000000001\' LIMIT 1',
|
||||
"Add 'admin' user in ProcessMaker (rb)");
|
||||
}
|
||||
|
||||
|
||||
@@ -2596,7 +2596,9 @@ class Xpdl extends processes
|
||||
function calculateTimeScheduler($time)
|
||||
{
|
||||
$result = array();
|
||||
$result = split(' ',$time);
|
||||
// The split function has been DEPRECATED as of PHP 5.3.0.
|
||||
// $result = split(' ',$time);
|
||||
$result = explode(' ', $time);
|
||||
//print_r($result);
|
||||
return $result;
|
||||
}
|
||||
@@ -3919,8 +3921,11 @@ class Xpdl extends processes
|
||||
$file = new DOMDocument();
|
||||
foreach($array as $key => $value){
|
||||
$link = $value->W_LINK;
|
||||
$link = split('>',$link);
|
||||
$link = split('<',$link[2]);
|
||||
// This split function has been DEPRECATED as of PHP 5.3.0.
|
||||
// $link = split('>',$link);
|
||||
// $link = split('<',$link[2]);
|
||||
$link = explode('>',$link);
|
||||
$link = explode('<',$link[2]);
|
||||
$link = $link['0'];
|
||||
$uid = $value->W_PRO_UID;
|
||||
$name = $value->W_FILENAME;
|
||||
|
||||
@@ -57,7 +57,8 @@
|
||||
|
||||
ini_set('short_open_tag', 'on');
|
||||
ini_set('asp_tags', 'on');
|
||||
ini_set('register_globals', 'off');
|
||||
// The register_globals feature has been DEPRECATED as of PHP 5.3.0. default value Off.
|
||||
// ini_set('register_globals', 'off');
|
||||
ini_set('default_charset', "UTF-8");
|
||||
$e_all = defined('E_DEPRECATED') ? E_ALL ^ E_DEPRECATED : E_ALL;
|
||||
ini_set('error_reporting', ($config['debug'] ? $e_all : $e_all ^ E_NOTICE) );
|
||||
|
||||
@@ -1320,15 +1320,31 @@ function get_max_upload_limit() {
|
||||
}
|
||||
|
||||
function calc_php_setting_bytes( $value ) {
|
||||
if(@eregi("G$",$value)) {
|
||||
$value = substr($value,0,-1);
|
||||
$value = round($value*1073741824);
|
||||
} elseif(@eregi("M$",$value)) {
|
||||
$value = substr($value,0,-1);
|
||||
$value = round($value*1048576);
|
||||
} elseif(@eregi("K$",$value)) {
|
||||
$value = substr($value,0,-1);
|
||||
$value = round($value*1024);
|
||||
// if(@eregi("G$",$value)) {
|
||||
// $value = substr($value,0,-1);
|
||||
// $value = round($value*1073741824);
|
||||
// } elseif(@eregi("M$",$value)) {
|
||||
// $value = substr($value,0,-1);
|
||||
// $value = round($value*1048576);
|
||||
// } elseif(@eregi("K$",$value)) {
|
||||
// $value = substr($value,0,-1);
|
||||
// $value = round($value*1024);
|
||||
// }
|
||||
if ( @preg_match("/G$/i", $value) ) {
|
||||
$value = substr($value, 0, -1);
|
||||
$value = round($value * 1073741824);
|
||||
}
|
||||
else {
|
||||
if ( @preg_match("/M$/i", $value) ) {
|
||||
$value = substr($value, 0, -1);
|
||||
$value = round($value * 1048576);
|
||||
}
|
||||
else {
|
||||
if ( @preg_match("/K$/i", $value) ) {
|
||||
$value = substr($value, 0, -1);
|
||||
$value = round($value * 1024);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
||||
@@ -11,5 +11,7 @@
|
||||
$fileJrxml = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension ;
|
||||
|
||||
$bDownload = true;
|
||||
$downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
||||
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
|
||||
// $downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
||||
$downFileName = preg_replace('/[^A-Za-z0-9_]/i', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
||||
G::streamFile ( $fileJrxml, $bDownload, $downFileName );
|
||||
|
||||
@@ -83,7 +83,9 @@ try {
|
||||
if ( $type == 'JRXML') $extension = 'jrxml';
|
||||
if ( $type == 'ACROFORM') $extension = 'pdf';
|
||||
|
||||
$downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
||||
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
|
||||
// $downFileName = ereg_replace('[^A-Za-z0-9_]', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
||||
$downFileName = preg_replace('/[^A-Za-z0-9_]/i', '_', $aFields['OUT_DOC_TITLE'] ) . '.' . $extension;
|
||||
$filename = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $aFields['OUT_DOC_UID'] . '.' . $extension ;
|
||||
if ( file_exists ( $filename) )
|
||||
$aFields['FILENAME'] = $downFileName;
|
||||
|
||||
@@ -37,17 +37,29 @@ try {//ini_set('display_errors','1');
|
||||
die;
|
||||
break;
|
||||
}
|
||||
function changeNamelogo($snameLogo){
|
||||
$snameLogo = ereg_replace("[áàâãª]","a",$snameLogo);
|
||||
$snameLogo = ereg_replace("[ÁÀÂÃ]","A",$snameLogo);
|
||||
$snameLogo = ereg_replace("[ÍÌÎ]","I",$snameLogo);
|
||||
$snameLogo = ereg_replace("[íìî]","i",$snameLogo);
|
||||
$snameLogo = ereg_replace("[éèê]","e",$snameLogo);
|
||||
$snameLogo = ereg_replace("[ÉÈÊ]","E",$snameLogo);
|
||||
$snameLogo = ereg_replace("[óòôõº]","o",$snameLogo);
|
||||
$snameLogo = ereg_replace("[ÓÒÔÕ]","O",$snameLogo);
|
||||
$snameLogo = ereg_replace("[úùû]","u",$snameLogo);
|
||||
$snameLogo = ereg_replace("[ÚÙÛ]","U",$snameLogo);
|
||||
function changeNamelogo($snameLogo)
|
||||
{
|
||||
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
|
||||
// $snameLogo = ereg_replace("[áàâãª]","a",$snameLogo);
|
||||
// $snameLogo = ereg_replace("[ÁÀÂÃ]","A",$snameLogo);
|
||||
// $snameLogo = ereg_replace("[ÍÌÎ]","I",$snameLogo);
|
||||
// $snameLogo = ereg_replace("[íìî]","i",$snameLogo);
|
||||
// $snameLogo = ereg_replace("[éèê]","e",$snameLogo);
|
||||
// $snameLogo = ereg_replace("[ÉÈÊ]","E",$snameLogo);
|
||||
// $snameLogo = ereg_replace("[óòôõº]","o",$snameLogo);
|
||||
// $snameLogo = ereg_replace("[ÓÒÔÕ]","O",$snameLogo);
|
||||
// $snameLogo = ereg_replace("[úùû]","u",$snameLogo);
|
||||
// $snameLogo = ereg_replace("[ÚÙÛ]","U",$snameLogo);
|
||||
$snameLogo = preg_replace("/[áàâãª]/", "a", $snameLogo);
|
||||
$snameLogo = preg_replace("/[ÁÀÂÃ]/", "A", $snameLogo);
|
||||
$snameLogo = preg_replace("/[ÍÌÎ]/", "I", $snameLogo);
|
||||
$snameLogo = preg_replace("/[íìî]/", "i", $snameLogo);
|
||||
$snameLogo = preg_replace("/[éèê]/", "e", $snameLogo);
|
||||
$snameLogo = preg_replace("/[ÉÈÊ]/", "E", $snameLogo);
|
||||
$snameLogo = preg_replace("/[óòôõº]/", "o", $snameLogo);
|
||||
$snameLogo = preg_replace("/[ÓÒÔÕ]/", "O", $snameLogo);
|
||||
$snameLogo = preg_replace("/[úùû]/", "u", $snameLogo);
|
||||
$snameLogo = preg_replace("/[ÚÙÛ]/", "U", $snameLogo);
|
||||
$snameLogo = str_replace("ç","c",$snameLogo);
|
||||
$snameLogo = str_replace("Ç","C",$snameLogo);
|
||||
$snameLogo = str_replace("[ñ]","n",$snameLogo);
|
||||
|
||||
@@ -41,7 +41,9 @@ try {ini_set('display_errors','1');
|
||||
$_POST['form']['USR_RESUME'] = $_FILES['form']['name']['USR_RESUME'];
|
||||
}
|
||||
if ($_POST['form']['USR_EMAIL'] != '') {
|
||||
if (!ereg("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$", $_POST['form']['USR_EMAIL'])) {
|
||||
// The ereg function has been DEPRECATED as of PHP 5.3.0.
|
||||
// if (!ereg("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$", $_POST['form']['USR_EMAIL'])) {
|
||||
if ( !preg_match("/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/", $_POST['form']['USR_EMAIL'])) {
|
||||
G::SendTemporalMessage ('ID_INCORRECT_EMAIL', 'error');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,9 @@ function DumpHeaders($filename)
|
||||
$isIE6 = 1;
|
||||
}
|
||||
|
||||
$aux = ereg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
|
||||
// The ereg_replace function has been DEPRECATED as of PHP 5.3.0.
|
||||
// $aux = ereg_replace('[^-a-zA-Z0-9\.]', '_', $filename);
|
||||
$aux = preg_replace('/[^-a-zA-Z0-9\.]/', '_', $filename);
|
||||
$aux = explode ('_', $aux);
|
||||
$downloadName = $aux[ count($aux)-1 ];
|
||||
// $downloadName = $filename;
|
||||
|
||||
@@ -84,7 +84,9 @@
|
||||
$t->isnt( PATH_GULLIVER, 'PATH_GULLIVER', 'Constant PATH_GULLIVER');
|
||||
$phatSitio = "/home/arturo/processmaker/trunk/workflow/engine/class.x.php/";
|
||||
$phatBuscar = "/processmaker/trunk/workflow/engine/class.x.php/";
|
||||
$t->is(( ereg( $phatBuscar , $phatSitio ) ), 1 , 'expandPath()');
|
||||
// The ereg function has been DEPRECATED as of PHP 5.3.0.
|
||||
// $t->is(( ereg( $phatBuscar , $phatSitio ) ), 1 , 'expandPath()');
|
||||
$t->is(( preg_match( '/' . $phatBuscar . '/', $phatSitio ) ), 1 , 'expandPath()');
|
||||
$t->is( G::LoadSystem("error"), NULL, 'LoadSystem()');
|
||||
$t->can_ok( $obj, 'RenderPage', 'RenderPage()');
|
||||
$t->can_ok( $obj, 'LoadSkin', 'LoadSkin()');
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
$vVar = stripslashes($vVar);
|
||||
}
|
||||
}
|
||||
|
||||
if (ini_get('magic_quotes_gpc') == '1') {
|
||||
// The magic_quotes_gpc feature has been DEPRECATED as of PHP 5.3.0.
|
||||
// if (ini_get('magic_quotes_gpc') == '1') {
|
||||
if (get_magic_quotes_gpc() === 1) {
|
||||
strip_slashes($_POST);
|
||||
}
|
||||
|
||||
@@ -391,7 +392,8 @@
|
||||
|
||||
//***************** Session Initializations **************************/
|
||||
ini_set( 'session.auto_start', '1' );
|
||||
ini_set( 'register_globals', 'Off' );
|
||||
// The register_globals feature has been DEPRECATED as of PHP 5.3.0. default value Off.
|
||||
// ini_set( 'register_globals', 'Off' );
|
||||
session_start();
|
||||
ob_start();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user