Repeatable: Always on 32 character keys
Steps to repeat:
1. Create an API key from Baidu (http://lbsyun.baidu.com/apiconsole/key)
2. Insert key at admin/config/services/baidu_map
3. Save configuration
Expected Results:
The valid 32 character key should pass the form validation.
Actual Results:
Cannot save and use the valid key.
Perhaps Baidu has changed the key format for 32 character keys recently. The regex that validates the key (^([a-zA-Z0-9]){24}$)|(^([a-fA-F0-9]){32}$)/') does not allow lower and upper case a to z characters. Keys from Baidu have a-z characters, so valid keys like 90tuBdiMtr92DsyDMB1pKxuf5Fl702Oj are not permitted by the module. Changing the regex to (^([a-zA-Z0-9]){24}$)|(^([a-zA-Z0-9]){32}$)/') should fix the issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | baidu_map-cannot-use-valid-keys-2706673-2.patch | 449 bytes | millerrs |
Comments
Comment #2
millerrs commentedComment #3
alexandrdnlv commentedHi there. I can confirm, patch from #2 helped me well. Thanks!
Comment #4
henk commentedHi, I also confirm the the patch #2. Thanks.
Comment #5
henk commentedComment #6
aolaze commented我想说这个的,1.0的版本中还是手贼,没有改正过来.自己改过来了。
Comment #7
xiukun.zhou commentedHi everybody, please download dev branch.
Comment #8
xiukun.zhou commented