diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index ac5c9a1c978..15ccad5b5d1 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -38,7 +38,6 @@ $action = GETPOST('action','alpha'); $cancel = GETPOST('cancel','alpha'); $origin = GETPOST('origin','alpha'); $catorigin = GETPOST('catorigin','int'); -$nbcats = (GETPOST('choix') ? GETPOST('choix') : 1); // TODO not use ? $type = GETPOST('type','alpha'); $urlfrom = GETPOST('urlfrom','alpha'); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5dfcda5ab17..90167a94b87 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -249,18 +249,20 @@ function GETPOST($paramname,$check='',$method=0) elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:''; elseif ($method==2) $out = isset($_POST[$paramname])?$_POST[$paramname]:''; elseif ($method==3) $out = isset($_POST[$paramname])?$_POST[$paramname]:(isset($_GET[$paramname])?$_GET[$paramname]:''); + else return 'BadParameter'; if (! empty($check)) { + $out=trim($out); // Check if numeric - if ($check == 'int' && ! preg_match('/^[-\.,0-9]+$/i',trim($out))) $out=''; + if ($check == 'int' && ! preg_match('/^[-\.,0-9]+$/i',$out)) $out=''; // Check if alpha - //if ($check == 'alpha' && ! preg_match('/^[ =:@#\/\\\(\)\-\._a-z0-9]+$/i',trim($out))) $out=''; - // '"' is dangerous because param in url can close the href= or src= and add javascript functions. - if ($check == 'alpha') + elseif ($check == 'alpha') { - if (preg_match('/"/',trim($out))) $out=''; - else if (preg_match('/(\.\.\/)+/',trim($out))) $out=''; + // '"' is dangerous because param in url can close the href= or src= and add javascript functions. + // '../' is dangerous because it allows dir transversals + if (preg_match('/"/',$out)) $out=''; + else if (preg_match('/\.\.\//',$out)) $out=''; } } diff --git a/htdocs/langs/ca_ES/banks.lang b/htdocs/langs/ca_ES/banks.lang index ea189a52be2..c740fa5ef87 100644 --- a/htdocs/langs/ca_ES/banks.lang +++ b/htdocs/langs/ca_ES/banks.lang @@ -142,4 +142,8 @@ AllAccounts=Tots els comptes bancaris/de caixa BackToAccount=Tornar al compte ShowAllAccounts=Mostra per a tots els comptes FutureTransaction=Transacció futura. No és possible conciliar. -SelectChequeTransactionAndGenerate=Seleccioneu/filtreu els xecs a incloure a la remesa i feu clic a "Crear". \ No newline at end of file +SelectChequeTransactionAndGenerate=Seleccioneu/filtreu els xecs a incloure a la remesa i feu clic a "Crear". +InputReceiptNumber=Indiqui l'extracte bancari relacionat amb la conciliació. Utilitzeu un valor numèric ordenable (per exemple, AAAAMM) +EventualyAddCategory=Eventualment, indiqui una categoria en la qual classificar els registres +ToConciliate=A conciliar? +ThenCheckLinesAndConciliate=A continuació, comproveu les línies presents en l'extracte bancari i feu clic \ No newline at end of file diff --git a/htdocs/langs/ca_ES/companies.lang b/htdocs/langs/ca_ES/companies.lang index 3cdf9b80129..2838478d6c1 100644 --- a/htdocs/langs/ca_ES/companies.lang +++ b/htdocs/langs/ca_ES/companies.lang @@ -115,6 +115,12 @@ ProfId2BE=- ProfId3BE=- ProfId4BE=- ProfId5BE=- +#ProfId1BR=CNAE +#ProfId2BR=CNPJ +#ProfId3BR=CPF +#ProfId4BR=INSS +#ProfId5BR=IE +#ProfId6BR=IM ProfId1CH=- ProfId2CH=- ProfId3CH=Número federat diff --git a/htdocs/langs/ca_ES/errors.lang b/htdocs/langs/ca_ES/errors.lang index e086b1ffdd6..a1ff701cdd2 100644 --- a/htdocs/langs/ca_ES/errors.lang +++ b/htdocs/langs/ca_ES/errors.lang @@ -104,6 +104,7 @@ ErrorBadValueForCode=Valor no vàlid per al codi. Torneu a intentar-ho amb un no ErrorBothFieldCantBeNegative=Els camps %s i %s no poden ser negatius ErrorNoActivatedBarcode=Cap tipus de codi de barres activat ErrorWebServerUserHasNotPermission=El compte d'execució del servidor web %s no disposa dels permisos per això +ErrorNoActivatedBarcode=No hi ha activat cap tipus de codi de barres # Warnings WarningSafeModeOnCheckExecDir=Atenció, està activada l'opció PHP safe_mode, la comanda ha d'estar dins d'un directori declarat dins del paràmetre php safe_mode_exec_dir. diff --git a/htdocs/langs/ca_ES/mails.lang b/htdocs/langs/ca_ES/mails.lang index 30605b3e2a4..24a5be04af4 100644 --- a/htdocs/langs/ca_ES/mails.lang +++ b/htdocs/langs/ca_ES/mails.lang @@ -39,6 +39,7 @@ MailingStatusDraft=Esborrany MailingStatusValidated=Validat MailingStatusApproved=Aprovat MailingStatusSent=Enviat +MailingStatusRead=Llegit MailingStatusSentPartialy=Enviat parcialment MailingStatusSentCompletely=Enviat completament MailingStatusError=Error diff --git a/htdocs/langs/ca_ES/main.lang b/htdocs/langs/ca_ES/main.lang index 59f7f3e2bfc..3db44046497 100644 --- a/htdocs/langs/ca_ES/main.lang +++ b/htdocs/langs/ca_ES/main.lang @@ -175,7 +175,7 @@ Info=Log Family=Familia Description=Descripció Designation=Descripción -Action=Esdeveniment +Action=Acció Model=Model DefaultModel=Model per defecte About=Sobre diff --git a/htdocs/langs/ca_ES/paypal.lang b/htdocs/langs/ca_ES/paypal.lang index 4759aa1f822..762d2628b42 100644 --- a/htdocs/langs/ca_ES/paypal.lang +++ b/htdocs/langs/ca_ES/paypal.lang @@ -15,4 +15,5 @@ ThisIsTransactionId=Identificador de la transacció: %s PAYPAL_ADD_PAYMENT_URL=Afegir la url del pagament Paypal en enviar un document per e-mail PAYPAL_IPN_MAIL_ADDRESS=Adreça e-mail per les notificacions instantànies de pagament (IPN) PredefinedMailContentSendOrderWithPaypalLink=Us adjuntem la comanda __ORDERREF__\n\nPodeu fer clic a l'enllaç assegurança de sota per realitzar el seu pagament a través de PayPal\n\n%s\n\nCordialment\n\n -PredefinedMailContentSendInvoiceWithPaypalLink=Us adjuntem la factura __FACREF__\n\nPodeu fer clic a l'enllaç assegurança de sota per realitzar el seu pagament a través de PayPal\n\n%s\n\nCordialment\n\n \ No newline at end of file +PredefinedMailContentSendInvoiceWithPaypalLink=Us adjuntem la factura __FACREF__\n\nPodeu fer clic a l'enllaç assegurança de sota per realitzar el seu pagament a través de PayPal\n\n%s\n\nCordialment\n\n +YouAreCurrentlyInSandboxMode=Actualment es troba en mode "sandbox" \ No newline at end of file diff --git a/htdocs/langs/es_ES/banks.lang b/htdocs/langs/es_ES/banks.lang index 9e87caff24f..8c0ae21ca39 100644 --- a/htdocs/langs/es_ES/banks.lang +++ b/htdocs/langs/es_ES/banks.lang @@ -142,4 +142,8 @@ AllAccounts=Todas las cuentas bancarias/de caja BackToAccount=Volver a la cuenta ShowAllAccounts=Mostrar para todas las cuentas FutureTransaction=Transacción futura. No es posible conciliar. -SelectChequeTransactionAndGenerate=Seleccione/filtre los cheques a incluir en la remesa y haga clic en "Crear". \ No newline at end of file +SelectChequeTransactionAndGenerate=Seleccione/filtre los cheques a incluir en la remesa y haga clic en "Crear". +InputReceiptNumber=Indique el extracto bancario relacionado con la conciliación. Utilice un valor numérico ordenable (por ejemplo, AAAAMM) +EventualyAddCategory=Eventualmente, indique una categoría en la que clasificar los registros +ToConciliate=¿A conciliar? +ThenCheckLinesAndConciliate=A continuación, compruebe las líneas presentes en el extracto bancario y haga clic \ No newline at end of file diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 199f90333c8..9ca56737e70 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -115,6 +115,12 @@ ProfId2BE=- ProfId3BE=- ProfId4BE=- ProfId5BE=- +#ProfId1BR=CNAE +#ProfId2BR=CNPJ +#ProfId3BR=CPF +#ProfId4BR=INSS +#ProfId5BR=IE +#ProfId6BR=IM ProfId1CH=- ProfId2CH=- ProfId3CH=Número federado diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index fd1765a345f..d1a35024ea9 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -104,6 +104,7 @@ ErrorBadValueForCode=Valor incorrecto para el código. Vuelva a intentar con un ErrorBothFieldCantBeNegative=Los campos %s y %s no pueden ser negativos ErrorNoActivatedBarcode=Ningún tipo de código de barra activado ErrorWebServerUserHasNotPermission=La cuenta de ejecución del servidor web %s no dispone de los permisos para esto +ErrorNoActivatedBarcode=No hay activado ningún tipo de código de barras # Warnings WarningSafeModeOnCheckExecDir=Atención, está activada la opción PHP safe_mode, el comando deberá estar dentro de un directorio declarado dentro del parámetro php safe_mode_exec_dir. diff --git a/htdocs/langs/es_ES/mails.lang b/htdocs/langs/es_ES/mails.lang index c5c2ed7e51e..3957b886cae 100644 --- a/htdocs/langs/es_ES/mails.lang +++ b/htdocs/langs/es_ES/mails.lang @@ -39,6 +39,7 @@ MailingStatusDraft=Borrador MailingStatusValidated=Validado MailingStatusApproved=Aprovado MailingStatusSent=Enviado +MailingStatusRead=Leido MailingStatusSentPartialy=Enviado parcialmente MailingStatusSentCompletely=Enviado completamente MailingStatusError=Error diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index 92e37752683..578803f08bd 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -175,7 +175,7 @@ Info=Log Family=Familia Description=Descripción Designation=Descripción -Action=Evento +Action=Acción Model=Modelo DefaultModel=Modelo por defecto About=Acerca de diff --git a/htdocs/langs/es_ES/paypal.lang b/htdocs/langs/es_ES/paypal.lang index 8616d2e5e2b..2320ceebc39 100644 --- a/htdocs/langs/es_ES/paypal.lang +++ b/htdocs/langs/es_ES/paypal.lang @@ -15,4 +15,5 @@ ThisIsTransactionId=Identificador de la transacción: %s PAYPAL_ADD_PAYMENT_URL=Añadir la url del pago Paypal al enviar un documento por e-mail PAYPAL_IPN_MAIL_ADDRESS=Dirección e-mail para las notificaciones instantáneas de pago (IPN) PredefinedMailContentSendOrderWithPaypalLink=Le adjuntamos el pedido __ORDERREF__\n\nPuede hacer clic en el enlace seguro de abajo para realizar su pago a través de PayPal\n\n%s\n\nCordialmente\n\n -PredefinedMailContentSendInvoiceWithPaypalLink=Le adjuntamos la factura __FACREF__\n\nPuede hacer clic en el enlace seguro de abajo para realizar su pago a través de PayPal\n\n%s\n\nCordialmente\n\n \ No newline at end of file +PredefinedMailContentSendInvoiceWithPaypalLink=Le adjuntamos la factura __FACREF__\n\nPuede hacer clic en el enlace seguro de abajo para realizar su pago a través de PayPal\n\n%s\n\nCordialmente\n\n +YouAreCurrentlyInSandboxMode=Actualmente se encuentra en modo "sandbox" \ No newline at end of file diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index ef231baa464..10d395ff94e 100755 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -144,6 +144,7 @@ class SecurityTest extends PHPUnit_Framework_TestCase $_POST["param1"]="333"; $_GET["param2"]='a/b#e(pr)qq-rr\cc'; $_GET["param3"]='"a/b#e(pr)qq-rr\cc'; // Same than param2 + " + $_GET["param4"]='../dir'; $result=GETPOST('id','int'); // Must return nothing print __METHOD__." result=".$result."\n"; @@ -161,11 +162,15 @@ class SecurityTest extends PHPUnit_Framework_TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals($result,$_GET["param2"]); - $result=GETPOST("param3",'alpha'); // Must return '' as there is a forbidden char + $result=GETPOST("param3",'alpha'); // Must return '' as there is a forbidden char " print __METHOD__." result=".$result."\n"; $this->assertEquals($result,''); - return $result; + $result=GETPOST("param4",'alpha'); // Must return '' as there is a forbidden char ../ + print __METHOD__." result=".$result."\n"; + $this->assertEquals($result,''); + + return $result; } /**