Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
$this->assertTitle('foo " bar', t('Title displayed'))
fails with the following errors:
SimpleXMLElement::xpath(): Invalid predicate
SimpleXMLElement::xpath(): xmlXPathEval: evaluation failed
This is because the specified title is used in an XPath expression without any escaping, thus making the expression invalid.
This patch fixes this by moving the comparison from XPath to PHP. It also adds a test to node.test that fails without the change to assertTitle().
Comment | File | Size | Author |
---|---|---|---|
assertTitle-1.patch | 2.9 KB | c960657 | |
Comments
Comment #1
c960657 CreditAttribution: c960657 commentedComment #2
puradata CreditAttribution: puradata commentedPatch works fine. Passes all tests. If I undo the fix drupal_in web_test_case.php the new test fails. This is good. I recommend the patch be accepted.
Comment #3
puradata CreditAttribution: puradata commentedPatch works fine. Passes all tests. If I undo the fix in drupal_web_test_case.php the new test fails. This is good. I recommend the patch be accepted.
I get an errpr when I try to edit my last comment
Comment #4
bdanchilla CreditAttribution: bdanchilla commentedthis patch worked for me. passing/failing the new tests as it should
Comment #5
boombatower CreditAttribution: boombatower commentedPasses tests, two others to vogue for it, and looks good.
Comment #7
c960657 CreditAttribution: c960657 commentedThe testbot was having some problems today.
Comment #8
webchickAwesome. Not only did we fix a bug, but we have a test AND the code is much easier to read now. :)
Committed to HEAD. Thanks!