BUG 6893 Al subir en logos imagenes que tienen acentos genera un noticei

this issue was fixed, it is not allowed to put this symbol
This commit is contained in:
Carlos Pacha
2011-05-26 09:55:52 -04:00
parent 38d54d4f9d
commit 37314bfcd0
2 changed files with 37 additions and 2 deletions

View File

@@ -37,12 +37,30 @@ try {//ini_set('display_errors','1');
die; die;
break; 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);
return ($snameLogo);
}
$sfunction =$_GET['function']; $sfunction =$_GET['function'];
switch($sfunction){ switch($sfunction){
case 'replacementLogo': case 'replacementLogo':
$snameLogo=urldecode($_GET['NAMELOGO']); $snameLogo=urldecode($_GET['NAMELOGO']);
$snameLogo=trim($snameLogo);
$snameLogo=changeNamelogo($snameLogo);
G::loadClass('configuration'); G::loadClass('configuration');
$oConf = new Configurations; $oConf = new Configurations;
$aConf = Array( $aConf = Array(

View File

@@ -90,7 +90,23 @@ try {
closedir($handle); closedir($handle);
} }
} }
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);
return ($snameLogo);
}
// if we have at least one image we show the restore image // if we have at least one image we show the restore image
/*if($i>0) { /*if($i>0) {
$template->gotoBlock( "_ROOT" ); $template->gotoBlock( "_ROOT" );
@@ -111,6 +127,7 @@ try {
$tpnfile = $formf['tmp_name']['LOGO_FILENAME']; $tpnfile = $formf['tmp_name']['LOGO_FILENAME'];
$aMessage1 = array(); $aMessage1 = array();
$fileName = trim(str_replace(' ','_', $namefile)); $fileName = trim(str_replace(' ','_', $namefile));
$fileName = changeNamelogo($fileName);
G::uploadFile( $tpnfile, $dir . '/', 'tmp'.$fileName ); G::uploadFile( $tpnfile, $dir . '/', 'tmp'.$fileName );
$error = false; $error = false;
try { try {