1
0
Fork 0

Handle files with no php at all, fixes #2910

pull/2918/head
Jordi Boggiano 2014-04-14 12:47:47 +02:00
parent f3c112e9e0
commit 49d4054e51
2 changed files with 15 additions and 1 deletions

View File

@ -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);

View File

@ -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,
),