mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Experiment: Run through esc_attr() in a single optimized pass. #5337
Draft
dmsnell
wants to merge
10
commits into
WordPress:trunk
Choose a base branch
from
dmsnell:experiment/single-pass-esc-attr
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Oct 2, 2023
-
Experiment: Run through esc_attr() in a single optimized pass.
The existing implementation of `esc_attr()` runs a jumble of regular expression and other search passes over its input. In this patch, if the site uses UTF-8, then an exploratory single-pass custom parser is used to escape the attribute values.
Configuration menu - View commit details
-
Copy full SHA for b99162d - Browse repository at this point
Copy the full SHA b99162dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 43db5f0 - Browse repository at this point
Copy the full SHA 43db5f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bc7b33 - Browse repository at this point
Copy the full SHA 1bc7b33View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2450dd9 - Browse repository at this point
Copy the full SHA 2450dd9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 41365a6 - Browse repository at this point
Copy the full SHA 41365a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a4d4c2 - Browse repository at this point
Copy the full SHA 0a4d4c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 804969a - Browse repository at this point
Copy the full SHA 804969aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 35cc667 - Browse repository at this point
Copy the full SHA 35cc667View commit details
Commits on Oct 3, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 49af2fd - Browse repository at this point
Copy the full SHA 49af2fdView commit details -
Major refactor: Introduce and use WP_Token_Set
In order to clarify the main loop of `_esc_attr_single_pass_utf8` I've moved the named character reference lookup outside of the function and into a new high-performance token set class dubbed `WP_Token_Set`. I created this class to retain the performance perks brought by the optimized data format. There are two lookup sets though because WordPress traditionally has its own custom set based on HTML4, but I would like to see us allow everything that HTML5 allows, including the common `'` so we don't have to keep writing `&WordPress#39;` (because that doesn't stand out as clearly as the name does). Performance in this change is even better than it was previously because I've removed the substitutions from the lookup table and that removes both iteration and working memory. In order to provide the reverse function, decoding these entities, it would probably be best to create two separate tables, or add a fixed byte length and offset value as a lookup into another table so that we can avoid reintroducing the double crawling scan that we had before.
Configuration menu - View commit details
-
Copy full SHA for b5caa5c - Browse repository at this point
Copy the full SHA b5caa5cView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.