-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[DomCrawler] Fixed image input case sensitive #10841
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
[DomCrawler] Fixed image input case sensitive #10841
Conversation
@@ -667,7 +667,7 @@ public function selectLink($value) | |||
public function selectButton($value) | |||
{ | |||
$xpath = sprintf('//input[((@type="submit" or @type="button") and contains(concat(\' \', normalize-space(string(@value)), \' \'), %s)) ', static::xpathLiteral(' '.$value.' ')). | |||
sprintf('or (@type="image" and contains(concat(\' \', normalize-space(string(@alt)), \' \'), %s)) or @id="%s" or @name="%s"] ', static::xpathLiteral(' '.$value.' '), $value, $value). | |||
sprintf('or (lower-case(@type)="image" and contains(concat(\' \', normalize-space(string(@alt)), \' \'), %s)) or @id="%s" or @name="%s"] ', static::xpathLiteral(' '.$value.' '), $value, $value). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about doing the same for type="submit" and type="button" above? Anywhere else where we can do the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the type should indeed be case insensitive everywhere.
Adn this should be tested
@geoffrey-brier write some tests using an uppercase type attribute (i.e. exactly the case you faced) |
@stof I just wrote a test |
apparently, tests are broken (https://travis-ci.org/symfony/symfony/builds/24294084). |
@fabpot sounds like the |
Tests are broken but I don't think it comes from my modifications, could you confirm @fabpot ? |
Thank you @geoffrey-brier. |
…ier) This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #10841). Discussion ---------- [DomCrawler] Fixed image input case sensitive | Q | A | ------------- | --- | Bug fix? | [yes] | New feature? | [no] | BC breaks? | [no] | Deprecations? | [no] | Tests pass? | | Fixed tickets | | License | MIT | Doc PR | I'm currently testing the payment workflow in a project. The problem is that when I reach the credit card type selection (CB, VISA ...) I cannot submit the desired one because its name is in uppercase (take a look at the screenshot).  Commits ------- ab1198f [DomCrawler] Fixed image input case sensitive
I'm currently testing the payment workflow in a project. The problem is that when I reach the credit card type selection (CB, VISA ...) I cannot submit the desired one because its name is in uppercase (take a look at the screenshot).