Project

General

Profile

Actions

Bug #14262

closed

Using input type="image" does not trigger $TSFE->checkDataSubmission()

Added by old_leening almost 20 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Frontend
Target version:
-
Start date:
2004-08-03
Due date:
% Done:

0%

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

Description

When using input type="image" in a mailform the HTTP_POST_VARS array does not contain a key named formtype_mail, but two keys named formtype_mail_x and formtype_mail_y
These keys are not checked, thus no mail is sent from a form.

Either patch index.php in the root with:
if ($HTTP_POST_VARS['formtype_mail_x'] || $HTTP_POST_VARS['formtype_mail_y']) {
$HTTP_POST_VARS['formtype_mail'] = 1;
}

or patch tslib/class.tslib_fe.php in this manner.
(issue imported from #M264)


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #14925: No mail from mail-form, but from install-test&php&shellClosedIngmar Schlecht2005-08-12

Actions
Actions #1

Updated by Ingmar Schlecht almost 20 years ago

I don't really understand why there is a difference between <input type="image"> and <input type="submit">. Could you explain that please?

Actions #2

Updated by old_leening almost 20 years ago

I don't really understand why i have to explain the difference between <input type="image"> and <input type="submit"> :-)

There IS a difference. There has been a difference between them ever since HTML 1
Please try the following an let's not talk about the why and what of HTML, it's rather OT.

As you can see when this code is run, there is never a posted variable named "image_submit". That's the problem. Have you tried it in T3? No? Please do so and you can see what I mean.

<form name="formName" method="post">
text: <input type="text" name="name" value="test" /><br />
<input type="submit" name="button_submit" value="Submit" /><br />
<input type="image" name="image_submit" src="http://images.google.com/images?q=tbn:ET6w3oWnwmsJ:eclipse.cps.k12.va.us/spyker/staff/images/submit.gif&quot; />
</form>
if (count($_POST)) {
print '<xmp>';
print_r($_POST);
print '</xmp>';
}
?>

Actions #3

Updated by Dmitriy Larionov over 18 years ago

In function checkDataSubmission() in /tslib/class.tslib_fe.php

line 1870, instead of
if ($_POST['formtype_db'] || $_POST['formtype_mail']) {
use
if ($_POST['formtype_db'] || $_POST['formtype_mail'] || ($_POST['subject'] && $_POST['recipient'])) {

line 1875, instead of
if ($_POST['formtype_mail']) {
use
if ($_POST['formtype_mail'] || ($_POST['subject'] && $_POST['recipient'])) {

the problem with 'FORMTYPE_MAIL_X' and 'FORMTYPE_MAIL_Y' is that $_POST['FORMTYPE_MAIL_X'] and $_POST['FORMTYPE_MAIL_Y'] on the stage of this checks (i think) does not exists, at least we can't check it in POST.

Actions #4

Updated by Jigal van Hemert about 14 years ago

Tested in 4.4-trunk, code checked in 4.3.3 and 4.2.12
If the submit button or image has the name formtype_db or formtype_mail the .._x variations are also detected properly.

So, cannot be reproduced anymore.

Actions #5

Updated by Chris topher about 14 years ago

Thanks for the note, Jigal!

Resolved as duplicate of #14925, which fixed this problem in revision 1473.

Actions

Also available in: Atom PDF