Skip to content

Commit

Permalink
[BUGFIX] Add basic validation for email and phone links
Browse files Browse the repository at this point in the history
To avoid setting potentially invalid links, the "email address" and
"telephone number" fields both are marked as "required". The input type
of the former one is also changed to `email`.

As a drive-by fix, `id` and `for` properties are set to link the input
fields to their respective label.

Resolves: #98388
Releases: main, 11.5
Change-Id: I24d62f70743e2bce73dd1de3cd9ecdac5dd0343a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76216
Reviewed-by: Nikita Hovratov <nikita.h@live.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76222
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
  • Loading branch information
andreaskienast authored and georgringer committed Oct 21, 2022
1 parent ea8ec41 commit 2dc49ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -3,10 +3,10 @@
<f:section name="Content">
<form action="" id="lmailform">
<div class="row">
<label class="col-3 col-form-label"><f:translate key="LLL:EXT:recordlist/Resources/Private/Language/locallang_browse_links.xlf:emailAddress" /></label>
<label class="col-3 col-form-label" for="lemail-label"><f:translate key="LLL:EXT:recordlist/Resources/Private/Language/locallang_browse_links.xlf:emailAddress" /></label>
<div class="col-9">
<div class="input-group">
<input type="text" name="lemail" size="20" class="form-control" value="{email}" />
<input id="lemail-label" type="email" name="lemail" size="20" class="form-control" value="{email}" required />
<div class="input-group-btn">
<input class="btn btn-default" type="submit" value="{f:translate(key: 'LLL:EXT:recordlist/Resources/Private/Language/locallang_browse_links.xlf:setLink')}" />
</div>
Expand Down
Expand Up @@ -3,10 +3,10 @@
<f:section name="Content">
<form action="" id="ltelephoneform">
<div class="row">
<label class="col-3 col-form-label"><f:translate key="LLL:EXT:recordlist/Resources/Private/Language/locallang_browse_links.xlf:telephoneNumber" /></label>
<label class="col-3 col-form-label" for="ltelephone-label"><f:translate key="LLL:EXT:recordlist/Resources/Private/Language/locallang_browse_links.xlf:telephoneNumber" /></label>
<div class="col-9">
<div class="input-group">
<input type="tel" name="ltelephone" size="20" class="form-control" value="{telephone}" />
<input id="ltelephone-label" type="tel" name="ltelephone" size="20" class="form-control" value="{telephone}" required />
<div class="input-group-btn">
<input class="btn btn-default" type="submit" value="{f:translate(key: 'LLL:EXT:recordlist/Resources/Private/Language/locallang_browse_links.xlf:setLink')}" />
</div>
Expand Down

0 comments on commit 2dc49ec

Please sign in to comment.