Example #1
0
/**
 * @param $matches preg_replace_callback matches array, where index 1
 *        is the filename to include
 */
function replace_includes_callback($matches)
{
    $file = $matches[1];
    $preserve = array('XML/HTMLSax3.php' => 1);
    if (isset($preserve[$file])) {
        return $matches[0];
    }
    if (isset($GLOBALS['loaded'][$file])) {
        return '';
    }
    $GLOBALS['loaded'][$file] = true;
    return replace_includes(remove_php_tags(file_get_contents($file)));
}
Example #2
0
/**
 * @param $matches preg_replace_callback matches array, where index 1
 *        is the filename to include
 */
function replace_includes_callback($matches)
{
    $file = $matches[1];
    // PHP 5 only file
    if ($file == 'HTMLPurifier/Lexer/DOMLex.php') {
        return $matches[0];
    }
    if (isset($GLOBALS['loaded'][$file])) {
        return '';
    }
    $GLOBALS['loaded'][$file] = true;
    create_blank($file);
    return replace_includes(remove_php_tags(file_get_contents($file)));
}