/home/velapos/public_html/verona-manual.intercloudmall.com/user/plugins/toc/classes/Toc.php
*
* @param string $content The content to be tocified
* @param array $options Array of options for the TOC filter
*
* @return string The content with inserted anchor- and
* permalinks in headings
*/
public function tocify($content, $options = [])
{
// Change regex, i.e. allow headers in (block-)quotes being parsed
$regex = str_replace('blockquote|q|cite|', '', $this->regex['html']);
$counter = [];
$content = preg_replace_callback($regex,
function($match) use ($options, &$counter) {
$tag = strtolower($match['tag']);
$text = trim($match['text']);
// Don't consider headings in code or pre environments
if (($tag{0} !== 'h') || (mb_strlen($text) == 0)) {
// Ignore empty headers, too
return $match[0];
}
// Extract informations from HTML tags
$level = $indent = (int) mb_substr($tag, 1);
// Expand tag attributes
$language = $options->get('language');
$attributes = $this->parseAttributes($match['attr']);
$id = isset($attributes['id']) ? $attributes['id'] : $this->hyphenize($text, $options, $language);
$classes = isset($attributes['class']) ? $attributes['class'] . ' headeranchor' : 'headeranchor';
// Replace empty id with hash of text
if (strlen($id) == 0) {
$id = substr(md5($text), 0, 6);
}
// Increment counter on same heading names
Arguments
"Array and string offset access syntax with curly braces is no longer supported"
/home/velapos/public_html/verona-manual.intercloudmall.com/vendor/filp/whoops/src/Whoops/Run.php
/**
* Special case to deal with Fatal errors and the like.
*/
public function handleShutdown()
{
// If we reached this step, we are in shutdown handler.
// An exception thrown in a shutdown handler will not be propagated
// to the exception handler. Pass that information along.
$this->canThrowExceptions = false;
$error = $this->system->getLastError();
if ($error && Misc::isLevelFatal($error['type'])) {
// If there was a fatal error,
// it was not handled in handleError yet.
$this->allowQuit = false;
$this->handleError(
$error['type'],
$error['message'],
$error['file'],
$error['line']
);
}
}
/**
* In certain scenarios, like in shutdown handler, we can not throw exceptions
* @var bool
*/
private $canThrowExceptions = true;
private function resolveHandler($handler)
{
if (is_callable($handler)) {
$handler = new CallbackHandler($handler);
}
if (!$handler instanceof HandlerInterface) {
throw new InvalidArgumentException(
"Handler must be a callable, or instance of "
. "Whoops\\Handler\\HandlerInterface"
/home/velapos/public_html/verona-manual.intercloudmall.com/system/src/Grav/Common/Errors/SystemFacade.php
*
* @return void
*/
public function registerShutdownFunction(callable $function)
{
$this->whoopsShutdownHandler = $function;
register_shutdown_function([$this, 'handleShutdown']);
}
/**
* Special case to deal with Fatal errors and the like.
*/
public function handleShutdown()
{
$error = $this->getLastError();
// Ignore core warnings and errors.
if ($error && !($error['type'] & (E_CORE_WARNING | E_CORE_ERROR))) {
$handler = $this->whoopsShutdownHandler;
$handler();
}
}
}