Skip to content

Commit 7b6ca1d

Browse files
committed
Move license file retrieval into controller
1 parent 73141f0 commit 7b6ca1d

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/controllers/Legal.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function run(Router &$router) {
2525
throw new UnspecifiedViewException();
2626
}
2727
$model = new LegalModel();
28+
$model->license = file_get_contents("../LICENSE.txt");
2829
$model->user_session = UserSession::load($router);
2930
ob_start();
3031
$view->render($model);

src/models/Legal.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Legal extends Model {
1010

1111
public function __construct() {
1212
parent::__construct();
13+
$this->license = null;
1314
$this->user_session = null;
1415
}
1516

src/templates/Legal.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ require("./header.inc.phtml");
6060
<section>
6161
<p>For a plaintext version of the document below, <a href="<?php echo Common::relativeUrlToAbsolute("/legal.txt"); ?>">click here</a>.</p>
6262
<p><pre><code><?php
63-
echo htmlentities(file_get_contents("../../LICENSE.txt"), ENT_HTML5, "UTF-8");
63+
echo htmlentities($this->getContext()->license, ENT_HTML5, "UTF-8");
6464
?></code></pre></p>
6565
</section>
6666
</article>

0 commit comments

Comments
 (0)