Revision db2d93dd
Added by Benjamin Luce over 9 years ago
drupal7/includes/common.inc | ||
---|---|---|
1522 | 1522 |
return '<'; |
1523 | 1523 |
} |
1524 | 1524 |
|
1525 |
if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?|(<!--.*?-->)$%', $string, $matches)) { |
|
1525 |
if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9\-]+)([^>]*)>?|(<!--.*?-->)$%', $string, $matches)) {
|
|
1526 | 1526 |
// Seriously malformed. |
1527 | 1527 |
return ''; |
1528 | 1528 |
} |
... | ... | |
3802 | 3802 |
|
3803 | 3803 |
// Replaces @import commands with the actual stylesheet content. |
3804 | 3804 |
// This happens recursively but omits external files. |
3805 |
$contents = preg_replace_callback('/@import\s*(?:url\(\s*)?[\'"]?(?![a-z]+:)([^\'"\()]+)[\'"]?\s*\)?\s*;/', '_drupal_load_stylesheet', $contents); |
|
3805 |
$contents = preg_replace_callback('/@import\s*(?:url\(\s*)?[\'"]?(?![a-z]+:)(?!\/\/)([^\'"\()]+)[\'"]?\s*\)?\s*;/', '_drupal_load_stylesheet', $contents);
|
|
3806 | 3806 |
return $contents; |
3807 | 3807 |
} |
3808 | 3808 |
|
... | ... | |
7137 | 7137 |
} |
7138 | 7138 |
} |
7139 | 7139 |
|
7140 |
/** |
|
7141 |
* Retrieves the type for every field in a table schema. |
|
7142 |
* |
|
7143 |
* @param $table |
|
7144 |
* The name of the table from which to retrieve type information. |
|
7145 |
* |
|
7146 |
* @return |
|
7147 |
* An array of types, keyed by field name. |
|
7148 |
*/ |
|
7149 |
function drupal_schema_field_types($table) { |
|
7150 |
$table_schema = drupal_get_schema($table); |
|
7151 |
foreach ($table_schema['fields'] as $field_name => $field_info) { |
|
7152 |
$field_types[$field_name] = isset($field_info['type']) ? $field_info['type'] : NULL; |
|
7153 |
} |
|
7154 |
return $field_types; |
|
7155 |
} |
|
7156 |
|
|
7140 | 7157 |
/** |
7141 | 7158 |
* Retrieves a list of fields from a table schema. |
7142 | 7159 |
* |
... | ... | |
7761 | 7778 |
// Prepare entity schema fields SQL info for |
7762 | 7779 |
// DrupalEntityControllerInterface::buildQuery(). |
7763 | 7780 |
if (isset($entity_info[$name]['base table'])) { |
7781 |
$entity_info[$name]['base table field types'] = drupal_schema_field_types($entity_info[$name]['base table']); |
|
7764 | 7782 |
$entity_info[$name]['schema_fields_sql']['base table'] = drupal_schema_fields_sql($entity_info[$name]['base table']); |
7765 | 7783 |
if (isset($entity_info[$name]['revision table'])) { |
7766 | 7784 |
$entity_info[$name]['schema_fields_sql']['revision table'] = drupal_schema_fields_sql($entity_info[$name]['revision table']); |
Also available in: Unified diff
Update to 7.37