Handle files with no php at all, fixes #2910
parent
f3c112e9e0
commit
49d4054e51
|
@ -124,7 +124,10 @@ class ClassMapGenerator
|
|||
$contents = preg_replace('{"[^"\\\\]*(\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(\\\\.[^\'\\\\]*)*\'}s', 'null', $contents);
|
||||
// strip leading non-php code if needed
|
||||
if (substr($contents, 0, 2) !== '<?') {
|
||||
$contents = preg_replace('{^.+?<\?}s', '<?', $contents);
|
||||
$contents = preg_replace('{^.+?<\?}s', '<?', $contents, 1, $replacements);
|
||||
if ($replacements === 0) {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
// strip non-php blocks in the file
|
||||
$contents = preg_replace('{\?>.+<\?}s', '?><?', $contents);
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* AJAX interface for remembering user preferences set on the fly
|
||||
*
|
||||
* Match /preferences/ajax/
|
||||
*/
|
||||
'preferences_ajax' => array
|
||||
(
|
||||
'handler' => array ('midgard_admin_asgard_handler_preferences', 'ajax'),
|
||||
'fixed_args' => array('preferences', 'ajax'),
|
||||
'variable_args' => 0,
|
||||
),
|
Loading…
Reference in New Issue