Merge pull request #285 from andrejguran/master

getEditorHref returns false if editor is not set
This commit is contained in:
Denis Sokolov
2015-05-28 13:09:05 +03:00
+5 -1
View File
@@ -318,12 +318,16 @@ class PrettyPageHandler extends Handler
* @throws InvalidArgumentException If editor resolver does not return a string
* @param string $filePath
* @param int $line
* @return string
* @return string|bool
*/
public function getEditorHref($filePath, $line)
{
$editor = $this->getEditor($filePath, $line);
if (!$editor) {
return false;
}
// Check that the editor is a string, and replace the
// %line and %file placeholders:
if (!isset($editor['url']) || !is_string($editor['url'])) {