Readme, some fixes, rel noopener for _blank links
This commit is contained in:
@@ -27,12 +27,17 @@ abstract class Document {
|
||||
|
||||
public function getView() : ?View {
|
||||
|
||||
$file = getClassPath($this->activeView);
|
||||
if(!file_exists($file) || !is_subclass_of($this->activeView, View::class)) {
|
||||
$view = parseClass($this->activeView);
|
||||
$file = getClassPath($view);
|
||||
if(!file_exists($file) || !is_subclass_of($view, View::class)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new $this->activeView($this);
|
||||
return new $view($this);
|
||||
}
|
||||
|
||||
public function getRequestedView(): string {
|
||||
return $this->activeView;
|
||||
}
|
||||
|
||||
function getCode(): string {
|
||||
|
||||
@@ -89,7 +89,7 @@ abstract class View extends StaticView {
|
||||
|
||||
protected function createExternalLink($link, $title=null): string {
|
||||
if(is_null($title)) $title=$link;
|
||||
return "<a href=\"$link\" target=\"_blank\" class=\"external\">$title</a>";
|
||||
return "<a href=\"$link\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"external\">$title</a>";
|
||||
}
|
||||
|
||||
protected function createIcon($icon, $type = "fas", $classes = ""): string {
|
||||
|
||||
Reference in New Issue
Block a user