-
-
Notifications
You must be signed in to change notification settings - Fork 904
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
Safe XPath $variable binding. #329
Comments
I now have (untested) patches for Java and libxml support for this feature at http://github.com/kbloom/nokogiri. I don't know what's the best way to implement this into Node#xpath yet, and I'm still trying figure out how to build new gems with these patches on my Debian system. |
adding XPath bind parameter substitution. closed by d5cddbd |
Thank you for merging this. |
I've tried to document this functionality in 95240c4. Shrugs. |
The documentation looks pretty good. Life would be easier if the #xpath interface wasn't so flexible in the first place. I'd add another example that demonstrates how to use both namespaces and variables at the same time, just to make it totally clear what's happening:
|
Please add support for binding $variables in XPath expressions. This behavior can be used to prevent XPath injection attacks. This is similar to REXML's XPath.first( node, "//*[@id=$href]", nil, {"href"=>"linktohere"}). This is implemented in the libxml API using the xmlXPathRegisterVariable function.
The text was updated successfully, but these errors were encountered: