}
}
if (!$this->checkPerms()) {
- if (!Platal::notAllowed()) {
+ if (Platal::notAllowed()) {
return PL_FORBIDDEN;
}
}
}
}
-
abstract class Platal
{
private $mods;
$this->mods[$module] = $m = PLModule::factory($module);
$hooks = $m->handlers();
foreach ($hooks as $path=>$hook) {
- $this->hooks->addChild(split('/', $path), $hook);
+ $this->hooks->addChild(explode('/', $path), $hook);
}
}
protected function find_hook()
{
- $p = split('/', $this->path);
+ $p = explode('/', $this->path);
list($hook, $matched, $remain, $aliased) = $this->hooks->findChild($p);
if (empty($hook)) {
return null;
public function near_hook()
{
- $p = split('/', $this->path);
+ $p = explode('/', $this->path);
list($hook, $matched, $remain, $aliased) = $this->hooks->findNearestChild($p);
if (empty($hook)) {
return null;
}
} catch (Exception $e) {
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');
-
- $file = fopen(self::globals()->spoolroot . '/spool/tmp/site_errors', 'a');
- fwrite($file, '<pre>' . date('Y-m-d G:i:s') . '</pre>'
- . '<pre>' . pl_entities("" . $e) . '</pre>'
- . '------------------------------------------------------------------' . "\n");
- fclose($file);
-
+ PlErrorReport::report($e);
if (self::globals()->debug) {
$page->kill(pl_entities($e->getMessage())
. '<pre>' . pl_entities("" . $e) . '</pre>');