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

DOMXPath::quote(string $str): string #13456

Merged
merged 19 commits into from
Feb 22, 2024
Merged

Commits on Feb 21, 2024

  1. DOMXPath::quote(string $str): string

    method to quote strings in XPath,
    similar to PDO::quote() / mysqli::real_escape_string
    
    sample usage: $xp->query("//span[contains(text()," . $xp->quote($string) . ")]")
    
    the algorithm is derived from Robert Rossney's research into XPath quoting published at https://stackoverflow.com/a/1352556/1067003
    (but using an improved implementation I wrote myself, originally for chrome-php/chrome#575 )
    divinity76 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    1730af1 View commit details
    Browse the repository at this point in the history
  2. oops

    divinity76 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    bedc0d0 View commit details
    Browse the repository at this point in the history
  3. efree

    divinity76 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    779bfe1 View commit details
    Browse the repository at this point in the history
  4. eol

    divinity76 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    9925f4a View commit details
    Browse the repository at this point in the history
  5. use smart_str api

    may be slightly slower but easier to read/maintain
    divinity76 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    74404a6 View commit details
    Browse the repository at this point in the history
  6. cleanup

    divinity76 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    c17264e View commit details
    Browse the repository at this point in the history
  7. credits

    divinity76 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    b85a768 View commit details
    Browse the repository at this point in the history
  8. cleanup

    divinity76 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    7ad4c91 View commit details
    Browse the repository at this point in the history
  9. micro optimize

    divinity76 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    e3fb678 View commit details
    Browse the repository at this point in the history
  10. derp

    divinity76 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    62a6eed View commit details
    Browse the repository at this point in the history
  11. Update ext/dom/tests/DOMXPath_quote.phpt

    Co-authored-by: Niels Dossche <[email protected]>
    divinity76 and nielsdos authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    307a9be View commit details
    Browse the repository at this point in the history
  12. emptystring test

    divinity76 authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    641f01f View commit details
    Browse the repository at this point in the history
  13. Update ext/dom/xpath.c

    Co-authored-by: Niels Dossche <[email protected]>
    divinity76 and nielsdos authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    1d935fd View commit details
    Browse the repository at this point in the history
  14. micro-optimize

    requested in PR feedback :o
    divinity76 committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    e9d4990 View commit details
    Browse the repository at this point in the history
  15. Update ext/dom/xpath.c

    Co-authored-by: Niels Dossche <[email protected]>
    divinity76 and nielsdos authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    f90a244 View commit details
    Browse the repository at this point in the history
  16. Update ext/dom/xpath.c

    Co-authored-by: Niels Dossche <[email protected]>
    divinity76 and nielsdos authored Feb 21, 2024
    Configuration menu
    Copy the full SHA
    a20e67b View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2024

  1. better loop

    divinity76 committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    ce9b737 View commit details
    Browse the repository at this point in the history
  2. snakes on a plane

    divinity76 committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    d930979 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7c478a1 View commit details
    Browse the repository at this point in the history