Project

General

Profile

Actions

Bug #16164

closed

Old Gremlin: Mail Form validation: solution of wrong Russian chars in JS pop-up

Added by Valery Romanchev almost 18 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2006-05-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

There is extension to correct this problem:
------------------------
Correct Form (onet_correctform):
When MAILFORM using with differ from English language (for example - Russian) there is problems occur connected with necessarily fields. When necessarily fields is not filled, JavaScript "formValidate" shows form labels after processing rawurlencode() function which distorting labels when they shows on alert-window in turn. This extention are using parallel array, where rawurlencode() is not in use, and labels outputs to validateForm JavaScript in clean sight. This extention actual for Typo3 3.7.0.
------------------------
But IMHO better to correct this problem in TYPO3 Core

Solution (thanks to Kit from forum www.typo3.biz)

Patch for t3lib/jsfunc.validateform.js

function validateForm(theFormname,theFieldlist,goodMess,badMess,emailMess) {
var formObject = document[theFormname];
// patch start
theFieldlist = decodeURI(theFieldlist);
// end
if (!formObj............

(issue imported from #M3527)


Files

jsfunc.validateform.zip (1.74 KB) jsfunc.validateform.zip Administrator Admin, 2006-08-06 08:40
patch3527.diff (379 Bytes) patch3527.diff Administrator Admin, 2007-02-15 16:37
tslib_content-validateForm.diff (1.35 KB) tslib_content-validateForm.diff Administrator Admin, 2007-04-20 13:48
bug3527.patch (462 Bytes) bug3527.patch Administrator Admin, 2009-03-27 15:16

Related issues 5 (0 open5 closed)

Related to TYPO3 Core - Bug #31336: mailform JS error caused by rawurlencode deleted from previous versionClosed2011-10-27

Actions
Has duplicate TYPO3 Core - Bug #18497: t3lib/jsfunc.validateform.js - HTML code and wrong umlauts in alert messageClosed2008-03-25

Actions
Has duplicate TYPO3 Core - Bug #17300: CE Mailform (FE) -> bad characters in JS alert (required fields)Closed2007-05-12

Actions
Has duplicate TYPO3 Core - Bug #16183: JavaScript-Validation at forms: german umlauts (UTF-8) are displayed wrongClosed2006-05-26

Actions
Has duplicate TYPO3 Core - Bug #20655: Mailform: Message in javascript-Alertbox corruptClosedChristian Kuhn2009-06-23

Actions
Actions #1

Updated by Martin Kutschker almost 18 years ago

I'm not sure what happens in TYPO3 4.0 in the FE. In the BE all rawurlencode/unecapse pairs have been removed. This should also happen in the FE as it is only needed for very old browsers.

AFAIR using decodeURI only works if the charset is UTF-8 as it is this what the functions does: convert an UTF-8 string that is escaped (with %) into the local charset of the page. So TYPO3 must deliver UTF-8 to make this patch work.

Actions #2

Updated by Kirill Klimov almost 18 years ago

I could confirm the problem with TYPO3 4.0 with UTF-8 in FE.
onet_correctform does fix the problem!
Why not to integrate it in the core?

Actions #3

Updated by Andres Toomsalu almost 18 years ago

Also badMess, goodMess and emailMess need to be properly decoded as these texts may also contain foreign characters. For example I'm having problems with emailform estonian strings containing äöüõ. decodeURI() helps as I use utf on site.

Actions #4

Updated by Valery Romanchev almost 18 years ago

This is patched version of t3lib/jsfunc.validateform.js
that solve this problem for utf8

Actions #5

Updated by Sebastian Kurfuerst over 17 years ago

keyword:t3dd06

Actions #6

Updated by Kirill Klimov about 17 years ago

The patch is not present neither at 4.1 Beta 3, nor at trunk from today.
Would it be fixed until 4.1?

Actions #7

Updated by Dmitry Pikhno about 17 years ago

guys, please add this patch to the core

Actions #8

Updated by Alexey Boriskin about 17 years ago

I just had attached unified diff. Maybe it will help for commiting patch.

Actions #9

Updated by Kirill Klimov about 17 years ago

I have tried it with typo3-trunk from today (RC2) - it works.
Please, commit this change.

Actions #10

Updated by Kirill Klimov about 17 years ago

Please, take a look and create SVN patch request for this simple change.

Actions #11

Updated by Dmitry Dulepov about 17 years ago

Can some of Russian-speaking people provide an example of mailform configuration here (with russian chars)? Before doing so, switch browser charset of the page to windows-1251 or utf-8, please.

Actions #12

Updated by Kirill Klimov about 17 years ago

Here is it (in UTF8):

=======================================
  1. Example content:
    имÑ: | *name = input,40 |
    Email: | *email=input,40 |
    Сообщение: | *message=textarea,40,5 |
    СвÑзатьÑÑ Ñо мной: | tv=check | 1

|formtype_mail = submit | Send form! |html_enabled=hidden | 0 |subject=hidden| This is the subject =======================================

Actions #13

Updated by Dmitry Dulepov about 17 years ago

Patch works well, I will send it to core team list

Actions #14

Updated by Kirill Klimov about 17 years ago

thank you very much, Dmitry

Actions #15

Updated by Valery Romanchev about 17 years ago

the patch solve the problem for utf-8 (force charset) sites, but produce js error for win-1251 sites (and probably this will be for German with ISO encoding)
So the problem looks not easy
I find the info
http://www.typo3.net/index.php?id=13&action=list_post&tid=45887

Actions #16

Updated by Kirill Klimov about 17 years ago

Patch is recalled due potential problems with various non-unicode encodings.

Why? Isn't it better to fix at least for UTF-8 sites instead of not fixing for all?

Actions #17

Updated by Dmitry Dulepov about 17 years ago

No, it is not better. Fix must not introduce new errors. This is a general typo3 rule.

Actions #18

Updated by Martin Kutschker about 17 years ago

The accompanying tslib_content-validateForm.diff will make patch3527.diff work for all charsets.

Note: that using decodeURI will break ancient browsers (but so does a getElementById).

Actions #19

Updated by Dmytro almost 17 years ago

Was this patch applied? Cause I did not see it applied in TYPO3 4.1.2.

Actions #20

Updated by Jonas Felix about 16 years ago

That's great, we publish a patch which only needs a blink of an eye for a core developer to integrate you set it to duplicated and close it.

It's a old gremlin it's a bad bug it's fixed, so why doesn't it go into core?

It's great that your cleaning up the bugtracker so consequently but it would be also cool if you could integrate the working patches.

The working up to date tested patch (which not only fixes this problem) is located here:
http://bugs.typo3.org/view.php?id=5615

Actions #21

Updated by Francois Suter about 15 years ago

It seems enough to call decodeURI() on the field names, since field names are encoded with rawurlencode() in tslib_content.

Attached a new patch, submitted to the core list.

Actions #22

Updated by Francois Suter almost 15 years ago

Committed to trunk (rev 5535)

Actions

Also available in: Atom PDF