editor callback: allow to return empty value

This commit is contained in:
Gregor Harlan
2018-06-30 13:56:13 +02:00
parent 45dad4e41e
commit e730eb22af
2 changed files with 12 additions and 0 deletions
+4
View File
@@ -507,6 +507,10 @@ class PrettyPageHandler extends Handler
$callback = call_user_func($this->editors[$this->editor], $filePath, $line);
}
if (empty($callback)) {
return [];
}
if (is_string($callback)) {
return [
'ajax' => false,
@@ -288,6 +288,14 @@ class PrettyPageHandlerTest extends TestCase
false
);
$handler->setEditor(function ($file, $line) {
return false;
});
$this->assertEquals(
$handler->getEditorHref('/foo/bar.php', 10),
false
);
}
/**