Bug #31336
closedmailform JS error caused by rawurlencode deleted from previous version
0%
Description
File : typo3/sysext/cms/tslib/content/class.tslib_content_form.php
if $fieldlist contains some accentued characters or special characters, the JS validation fails due to a JS ERROR (detected by IE but not by Firefox, chrome... even if result is the same).
resolution : rawurlencode must be used like in the typo3 4.2.8 version !
current code :
// Adding evaluation based on settings:
switch ((string) $modeParameters0) {
case 'EREG' :
$fieldlist[] = '_EREG';
$fieldlist[] = $modeParameters1;
$fieldlist[] = $modeParameters2;
$fieldlist[] = $confData['fieldname'];
$fieldlist[] = $confData['label'];
$confData['required'] = 1;
break;
case 'EMAIL' :
$fieldlist[] = '_EMAIL';
$fieldlist[] = $confData['fieldname'];
$fieldlist[] = $confData['label'];
$confData['required'] = 1;
break;
default :
if ($confData['required']) {
$fieldlist[] = $confData['fieldname'];
$fieldlist[] = $confData['label'];
}
break;
}
------------------------------------
code that works in 4.2.8 version :
------------------------------------
// Adding evaluation based on settings:
switch ((string)$modeParameters0) {
case 'EREG':
$fieldlist[] = '_EREG';
$fieldlist[] = rawurlencode($modeParameters1);
$fieldlist[] = rawurlencode($modeParameters2);
$fieldlist[] = rawurlencode($confData['fieldname']);
$fieldlist[] = rawurlencode($confData['label']);
$confData['required'] = 1;
break;
case 'EMAIL':
$fieldlist[] = '_EMAIL';
$fieldlist[] = rawurlencode($confData['fieldname']);
$fieldlist[] = rawurlencode($confData['label']);
$confData['required'] = 1;
break;
default:
if ($confData['required']) {
$fieldlist[] = rawurlencode($confData['fieldname']);
$fieldlist[] = rawurlencode($confData['label']);
}
break;
}
Updated by Markus Klein about 13 years ago
I'm not sure if rawurlencode is the right function here.
Updated by Francois Suter about 13 years ago
- Status changed from New to Needs Feedback
- Complexity changed from no-brainer to hard
With which version of IE do you get the error? Does it happen with any accentuated character or with a rather special one (not all behave the same, depending on the character and the encoding you use)? What encoding (FE/BE) are you using?
Updated by DevEthic about 13 years ago
the bug occurs in all browser but IE is the only one to detect it.
IE page headers :
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?xml version="1.0" encoding="utf-8"?>
<html xml:lang="fr-FR" lang="fr-FR" xmlns="http://www.w3.org/1999/xhtml&quot;>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Firefox page headers :
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="fr-FR" lang="fr-FR" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- the onsubmit that works (with rawurlencode):
onsubmit="return validateForm('mailform','Nom_RESPONSABLE%3A1,%2ANom%20de%20la%20personne%20Responsable%20de%20la%20visite,Prenom,%2APr%C3%A9nom,N_de_Tel,%2AN%C2%B0%20de%20Tel,Service_ou_Societe_les_EE,%2AService%20%28ou%20Soci%C3%A9t%C3%A9%20pour%20les%20EE%29,Le_pays_de_vos_visiteurs_faiti,%2ALe%20pays%20de%20vos%20visiteurs%20fait-il%20partie%20des%20accords%20de%20Schengen%3F,Si_Non_avezvous_reu_laccord_de,%2AAvez-vous%20re%C3%A7u%20l%27accord%20de%20la%20DCRI%20%3F,Duree_sejour,%2ADur%C3%A9e%20du%20s%C3%A9jour,Societe,%2ANom%20de%20la%20Soci%C3%A9t%C3%A9%20ou%20Autre%20Organisme,Il_sagit_,%2AIl%20s%27agit%20%3A,Date,%2ADate,Heure_de_la_visite,%2AHeure%20de%20la%20visite,Si_oui_combien,%2ASi%20v%C3%A9hicule%2C%20combien%20%3F,1NOM,1%20NOM%20et%20Fonction%20du%20visiteur%2A,1_Nationalit_du_visiteur,1%20Nationalit%C3%A9%20du%20visiteur%2A,casque_blouse,%2ACasque%2C%20blouse,Matriel_audio,%2AMat%C3%A9riel%20audio','','Merci de vérifier les champs suivants :','')"
#the onsubmit that not works (with no rawurlencode):
onsubmit="return validateForm('mailform','Nom_RESPONSABLE:1,*Nom de la personne Responsable de la visite,Prenom,*Prénom,N_de_Tel,*N° de Tel,Service_ou_Societe_les_EE,*Service (ou Société pour les EE),Le_pays_de_vos_visiteurs_faiti,*Le pays de vos visiteurs fait-il partie des accords de Schengen?,Si_Non_avezvous_reu_laccord_de,*Avez-vous reçu l'accord de la DCRI ?,Duree_sejour,*Durée du séjour,Societe,*Nom de la Société ou Autre Organisme,Il_sagit_,*Il s'agit :,Date,*Date,Heure_de_la_visite,*Heure de la visite,Si_oui_combien,*Si véhicule, combien ?,1NOM,1 NOM et Fonction du visiteur*,1_Nationalit_du_visiteur,1 Nationalité du visiteur*,casque_blouse,*Casque, blouse,Matriel_audio,*Matériel audio','','Merci de vérifier les champs suivants :','')"
Updated by Alexander Opitz over 11 years ago
Hi,
as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Alexander Opitz about 11 years ago
- Status changed from Needs Feedback to Closed
- Is Regression set to No
No feedback for over 90 days.
If you think, that this is the wrong decision, then please write to the mailing list typo3.teams.bugs with issue number and an explanation.