URL Fieldtype wants incorrect `tel://` protocol instead of `tel:`
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 83/100
Rechercherichtung
Beginne mit system/ee/ExpressionEngine/Addons/url/ft.url.php, insbesondere mit getSchemes() und dem validate()-Zweig ohne Host in der Nähe der vorhandenen mailto:-Prüfung. Sieh dir die Tests für den URL-Fieldtype an, falls vorhanden, und ergänze Tests dafür, dass tel: akzeptiert wird, wenn es aktiviert ist, während die vorhandene Einstellung tel:// erhalten bleibt. Fertig ist die Änderung, wenn standardmäßige tel:-Werte validiert werden, sofern dies erlaubt ist, und das bestehende Verhalten kompatibel bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description of the problem
The URL fieldtype's "Allowed URL schemes" setting offers tel:// as an option, but there is no tel: option. tel:// is not a valid form of the tel URI scheme.
Per RFC 3966, a telephone URI is tel: followed directly by the number (e.g. tel:+1-555-555-1234). It has no authority component, so there is no // like there is in http:// or ftp://.
This matters in practice:
- Entering a correct
tel:link (e.g.tel:+15555551234) fails validation even whentel://is checked in the field settings, so authors are pushed into entering the wrong format. tel://links can fail to trigger click-to-call in some browsers and mobile OSes, because the dialer doesn't recognize the malformed URI.
I expected to be able to allow and enter standard tel: links, the same way mailto: works today.
How To Reproduce
- Create a URL field.
- In the field settings, check
tel://under "Allowed URL schemes." - Edit an entry and enter
tel:+15555551234in the field. - Save. Validation fails with the invalid URL scheme error.
- Change the value to
tel://+15555551234and save. It passes, but it's an invalidtelURI.
Screenshots / Videos / Template Code
Environment Details:
- Version: 7.5.28
- PHP Version: 8.3
- MySQL Version: mariadb 11.4
- OS: Alpine Linux (DDEV)
- Web Server: NGINX (DDEV)
Possible Solution
Add tel: as its own allowed scheme, following the existing mailto: precedent in system/ee/ExpressionEngine/Addons/url/ft.url.php (checked against 7.5.28).
In getSchemes(), add a tel: option:
'mailto:' => 'mailto:',
'sftp://' => 'sftp://',
'ssh://' => 'ssh://',
'tel:' => 'tel:',
'tel://' => 'tel://',
In validate(), add a tel check right after the existing mailto check in the "no host" branch:
if (
isset($parsed_url['scheme'], $parsed_url['path']) &&
$parsed_url['scheme'] == 'tel' &&
in_array('tel:', $this->get_setting('allowed_url_schemes'))
) {
return true;
}
Keeping tel:// in the list avoids breaking existing field settings and entries. It could be deprecated or removed in a future major version.
Additional context
This has been around for years. It looks like tel was grouped with the hierarchical schemes (ftp://, sftp://, ssh://) when it belongs with mailto:.
- Vorherrschende Sprache
- PHP
- Sterne
- 505
- Forks
- 135
- Ø Merge
- 3 T. 7 Std.
- Gemergte PRs (30 T.)
- 7
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ExpressionEngine/ExpressionEngine
-
RTE Custom Stylesheet causes warning: Trying to access array offset on value of type boolEvtl. vergeben @Yulyaswan hat das vor 10 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
ExpressionEngine/ExpressionEngine#5406 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ExpressionEngine/ExpressionEngine#5381 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug: Accepted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
ExpressionEngine/ExpressionEngine#5117 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
ExpressionEngine/ExpressionEngine#5066 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
EE6
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
ExpressionEngine/ExpressionEngine#4406 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in ExpressionEngine/ExpressionEngine
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Automattic/blocks-engine#4621 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
YunoHost-Apps/snappymail_ynh#205 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Automattic/static-site-importer#2653 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug (unconfirmed) Search :mag:
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
FreshRSS/FreshRSS#9533 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
✨️ai-candidate effort: [XS] Made by AI module: user interface type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag