BUG 6453 Fix Bug deprecated PHP 5.3 features and functions in code.
This commit is contained in:
@@ -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,23 +37,35 @@ 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);
|
||||
$snameLogo = str_replace("ç","c",$snameLogo);
|
||||
$snameLogo = str_replace("Ç","C",$snameLogo);
|
||||
$snameLogo = str_replace("[ñ]","n",$snameLogo);
|
||||
$snameLogo = str_replace("[Ñ]","N",$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);
|
||||
$snameLogo = str_replace("[Ñ]","N",$snameLogo);
|
||||
return ($snameLogo);
|
||||
}
|
||||
}
|
||||
|
||||
$sfunction =$_GET['function'];
|
||||
switch($sfunction){
|
||||
|
||||
@@ -41,9 +41,11 @@ 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'])) {
|
||||
G::SendTemporalMessage ('ID_INCORRECT_EMAIL', 'error');
|
||||
}
|
||||
// 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');
|
||||
}
|
||||
}
|
||||
if (!isset($_POST['form']['USR_NEW_PASS'])) {
|
||||
$_POST['form']['USR_NEW_PASS'] = '';
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user