Commit 33605028 authored by alexpott's avatar alexpott

Issue #2009584 by rteijeiro, ry5n: Fixed Allow double underscores to pass...

Issue #2009584 by rteijeiro, ry5n: Fixed Allow double underscores to pass through drupal_clean_css_identifier() as per new CSS standards.
parent 814089c9
......@@ -2609,7 +2609,7 @@ function drupal_delete_file_if_stale($uri) {
* @return
* The cleaned identifier.
*/
function drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '')) {
function drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '__' => '__', '/' => '-', '[' => '-', ']' => '')) {
// By default, we filter using Drupal's coding standards.
$identifier = strtr($identifier, $filter);
......
......@@ -35,6 +35,10 @@ function testDrupalCleanCSSIdentifier() {
// Verify that invalid characters (including non-breaking space) are stripped from the identifier.
$this->assertIdentical(drupal_clean_css_identifier('invalid !"#$%&\'()*+,./:;<=>?@[\\]^`{|}~ identifier', array()), 'invalididentifier', 'Strip invalid characters.');
// Verify that double underscores are not stripped from the identifier.
$identifier = 'css__identifier__with__double__underscores';
$this->assertIdentical(drupal_clean_css_identifier($identifier), $identifier, 'Verify double underscores pass through.');
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment