Short description of the problem: both sides of the string comparison must be lowercased, but the (system) path isn't lowercased…
D7 + D8 are affected by this bug.
-----
API page: https://api.drupal.org/api/drupal/modules%21block%21block.module/functio...
When the path patterns are compared with the current path the block_block_list_alter() function says:
// Compare the lowercase internal and lowercase path alias (if any).
For the comparison of the aliased path everything is fine. But in the 2nd comparison with the internal path there is a missing drupal_strtolower() call for the internal path ($_GET['q']).
So the bugfix would be an easy replacement of the line $page_match = $page_match || drupal_match_path($_GET['q'], $pages);
with $page_match = $page_match || drupal_match_path(drupal_strtolower($_GET['q']), $pages);
.
Or is there any mechanism that "auto"-lowercases $_GET['q']? I don't know such a mechanism...
To reproduce the bug create an internal path (e.g. for a Views page or with hook_menu()) that contains at least 1 capital letter. Create an URL alias for that path. Enter the internal path as visibility page for any block and check that the block visibilty doesn't work as expected.