Readme, some fixes, rel noopener for _blank links

This commit is contained in:
2021-04-03 10:39:13 +02:00
parent 2087e56626
commit 18e7955b12
12 changed files with 82 additions and 27 deletions

View File

@@ -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 {

View File

@@ -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 {