#62885 closed enhancement (fixed)
Missing dot at the end of the descriptions
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | trunk |
Component: | General | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
In this file wp-includes/formatting.php
Added missing dots and improve function esc_attr( $text )
unsafe event handler attributes (like onclick, onmouseover, etc.) from HTML elements.
Attachments (1)
Change History (9)
#2
@
3 months ago
- Summary changed from Missing dot at the end of the description and improve function to Missing dot at the end of the descriptions
Hi there,
You're really mixing two completely different things in this ticket — docblock improvements and changes to a crucial function.
Also, what you are missing is that esc_attr()
is supposed to escape attribute values, not attribute names. So your example is wrong and thus the change doesn't make sense.
Let's focus on the docblock improvements :-)
This ticket was mentioned in PR #8241 on WordPress/wordpress-develop by @ankitkumarshah.
3 months ago
#4
Trac ticket: #62885
## Description
Implements the changes from this diff in accordance with this comment. Additionally, I have identified and corrected a few other instances in the file where periods were missing at the end of sentences.
## Changes:
- Added missing periods to @return documentation blocks
- Added missing periods to @param descriptions
- Added missing periods to complete sentence inline comments
- Added missing periods to section marker comments ("START: emoji arrays")
@ankitkumarshah commented on PR #8241:
3 months ago
#5
Hi @peterwilsoncc,
I have made the necessary changes. Please review it at your convenience.
Thank You!
#6
@
3 months ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 59765:
@SergeyBiryukov commented on PR #8241:
3 months ago
#8
Thanks for the PR! Merged in r59765.
Example
This line of code uses
preg_replace()
to sanitize a string by removing potentially unsafe event handler attributes (likeonclick
,onmouseover
, etc.) from HTML elements.This is a security measure to prevent malicious JavaScript from being executed via event handler attributes in user-supplied content. It helps mitigate risks like Cross-Site Scripting (XSS).
Before Update Function : https://prnt.sc/4LfxABLmaM2o
After Update Function : https://prnt.sc/ZYIWFxjYCDnN
so
preg_replace( '/\s*on\w+\s*=\s*["\']?.*?["\']?/i', '', $safe_text );
linesanitized and escaped html