You are here

function _process_comment in Drupal 6

Process comment blocks.

This is the callback function for the preg_replace_callback() used in drupal_load_stylesheet_content(). Support for comment hacks is implemented here.

1 string reference to '_process_comment'
drupal_load_stylesheet in includes/common.inc
Loads the stylesheet and resolves all @import commands.

File

includes/common.inc, line 2131
Common functions that many Drupal modules will need to reference.

Code

function _process_comment($matches) {
  static $keep_nextone = FALSE;

  // Quoted string, keep it.
  if ($matches[0][0] == "'" || $matches[0][0] == '"') {
    return $matches[0];
  }

  // End of IE-Mac hack, keep it.
  if ($keep_nextone) {
    $keep_nextone = FALSE;
    return $matches[0];
  }
  switch (strrpos($matches[0], '\\')) {
    case FALSE:

      // No backslash, strip it.
      return '';
    case drupal_strlen($matches[0]) - 3:

      // Ends with \*/ so is a multi line IE-Mac hack, keep the next one also.
      $keep_nextone = TRUE;
      return '/*_\\*/';
    default:

      // Single line IE-Mac hack.
      return '/*\\_*/';
  }
}