Currently, the regex used by locale_language_from_browser() to match language strings will incorrectly match invalid language strings. As an example, the random 10-character string iecRswK4eh will incorrectly result in eh-oh-laa-laa because there is a numeral in the string, and the regex does not require that each string be preceeded by the beginning of the string or a comma (with optional whitespace).
Comment | File | Size | Author |
---|---|---|---|
#8 | core-failing_langage_test-1513520-8.patch | 735 bytes | pdrake |
#7 | core-fix_nonspecific_language_matching_regex-1513520-7.patch | 1.54 KB | plach |
#3 | core-failing_langage_test-1513520-3.patch | 755 bytes | pdrake |
#1 | core-fix_nonspecific_language_matching_regex-1513520-1.patch | 1.58 KB | pdrake |
Comments
Comment #1
pdrake CreditAttribution: pdrake commentedComment #2
Gábor HojtsyLooks good. It just adds a look-behind pattern before the existing pattern. Can you also submit just the test change so we can demonstrate it failing? Thanks!
Comment #3
pdrake CreditAttribution: pdrake commentedThis patch includes both an added test for a comma-space separated set of languages which should pass (and the change continues to pass) as well as the test for the bad string, which should fail.
Comment #5
plachLooks like this is RTBC. Patch to be committed in #1 (kudos ;)
Comment #6
Dries CreditAttribution: Dries commentedCommitted to 8.x. Thanks.
Comment #7
plachJust applied the patch in #1 with -p2 and rerolled, thus setting back to RTBC.
Comment #8
pdrake CreditAttribution: pdrake commentedAnd here is a re-roll of #3 which should show the failure in D7.
Comment #10
pdrake CreditAttribution: pdrake commentedSince the patch in #8 was intended to fail - setting this back to RTBC (patch in #7).
Comment #11
webchickCommitted and pushed to 7.x. Thanks!
Comment #12
xjmThe test-only patch from #8 was committed. We need a rollback, and/or just to commit the fix part from #7. :)
Comment #13
Gábor HojtsyPlease commit the fix :)
Comment #14
webchickDoh. :( Core commit sprees after 1 am--;
Comment #15
xjmYay.
Comment #16
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedComment #18
Gábor HojtsyThanks.
Comment #20
cweagansUpdating tags per http://drupal.org/node/1517250