function patterns_parser_validate_pattern_name in Patterns 7
Same name and namespace in other branches
- 7.2 includes/parser/parser.inc \patterns_parser_validate_pattern_name()
Validates a pattern name.
@TODO Doc.
Parameters
mixed $name:
File
- includes/
parser/ parser.inc, line 446
Code
function patterns_parser_validate_pattern_name($name = NULL) {
if (empty($name)) {
return FALSE;
}
$pattern = array(
'/\\.[^\\.]*$/',
'/[^a-zA-Z0-9_]/',
);
$replacement = array(
'',
'_',
);
$name = preg_replace($pattern, $replacement, basename($name));
$analysis = _patterns_parser_analyze_pattern_name($name);
return empty($analysis) ? TRUE : FALSE;
}