Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link Elements Not Correctly Validated #3

Open
sprankhub opened this issue Jan 20, 2022 · 1 comment
Open

Link Elements Not Correctly Validated #3

sprankhub opened this issue Jan 20, 2022 · 1 comment

Comments

@sprankhub
Copy link

When using this module, a tags are not correctly validated any more. If the module is disabled, <a href="https://www.google.de" asdsadds="asdasddsa">link</a> will be replaced with <a href="https://www.google.de">link</a> when the editor is toggled, because asdsadds is obviously not a valid attribute. However, when the module is enabled, the invalid attribute asdsadds will be kept and not stripped. This happens, because in the following line, many new allowed tags are added, which all allow all attributes:

$settings['extended_valid_elements'] = $extendedSettings . implode(',', $this->buildExtendedValidElements());

The following is added to extended_valid_elements:

svg[*],a[*],animate[*],animateMotion[*],animateTransform[*],circle[*],clipPath[*],defs[*],desc[*],ellipse[*],feBlend[*],feColorMatrix[*],feComponentTransfer[*],feComposite[*],feConvolveMatrix[*],feDiffuseLighting[*],feDisplacementMap[*],feDistantLight[*],feFlood[*],feFuncA[*],feFuncB[*],feFuncG[*],feFuncR[*],feGaussianBlur[*],feImage[*],feMerge[*],feMergeNode[*],feMorphology[*],feOffset[*],fePointLight[*],feSpecularLighting[*],feSpotLight[*],feTile[*],feTurbulence[*],filter[*],foreignObject[*],g[*],image[*],line[*],linearGradient[*],marker[*],mask[*],metadata[*],mpath[*],path[*],pattern[*],polygon[*],polyline[*],radialGradient[*],rect[*],set[*],stop[*],style[*],switch[*],symbol[*],text[*],textPath[*],title[*],tspan[*],use[*],view[*]

a[*] says that all attributes on the a tag should be allowed. This is probably not what you want to do, @Vinai?

@Vinai
Copy link
Collaborator

Vinai commented Jan 20, 2022

No, it's not. It is used to allow a tags including any nested tags. Thanks for opening the issue, I'll need to refine the valid elements patterns. Not sure when I'll be able to get around to it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants