/** * Implements comment strip logic. * * This is the callback function for the preg_replace_callback() used in * drupal_load_stylesheet_content(). Support for comment hacks is implemented here. */ function _process_comment($matches) { static $keep_nextone = FALSE; // Quoted string, keep it. $start_char = substr($matches[0], 0, 1); if ($start_char == "'" || $start_char == '"') { return $matches[0]; } // End of IE-Mac hack, keep it. if ($keep_nextone) { $keep_nextone = FALSE; return $matches[0]; } else { switch (strrpos($matches[0], '\\')) { // No backslash, strip it. case FALSE : return ''; break; // Ends with \*/ so is a multi line IE-Mac hack, keep this and the next one. case drupal_strlen($matches[0])-3 : $keep_nextone = TRUE; return '/* \*/'; // Single line IE-Mac hack, keep this. default : return '/*\ */'; } } }