Automattic / Automattic/VIP-Coding-Standards

Flag incorrectly constructed mailto links

Abierto
#556 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Type: Enhancement
Lenguaje dominante
PHP
Estrellas
261
Forks
44
Merge medio
19 min
PR fusionados (30 d)
1

Descripción

## What problem would the enhancement address for VIP?

Some developers are not aware that `esc_url()` supports more than just the `http` and `https` protocols. The default list also includes ftp, ftps, mailto, news, irc, gopher, nntp, feed, and telnet as well.

of those extra ones, the most common is `mailto`, and a common mistake is to split a URL into a static `'mailto:'` and a email address variable/string escaped with something that isn't `esc_url()`.

## Describe the solution you'd like

Add a new sniff, or consider improving ProperEscapingFunction, so that we look for `'mailto:' string before an escaping function.

## What code should be reported as a violation?

```php
Email us

Email us

Email us

Email us

Email us

Email us
```

There are likely other ways to get a similar output.

## What code should *not* be reported as a violation?

```php
Email us

">Email us
```

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con el sniff ProperEscapingFunction mencionado en el issue y compara su comportamiento con los ejemplos de PHP indicados que infringen y no infringen la regla. Se considera terminado cuando se informan los enlaces mailto construidos incorrectamente, mientras que se aceptan los valores mailto pasados por esc_url().

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
php, wordpress
Área
tooling
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.