Skip to content

Commit 8088ac2

Browse files
committed
create RedirectException
1 parent 8814abd commit 8088ac2

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace UnityWebPortal\lib\exceptions;
4+
5+
class RedirectException extends \Exception
6+
{
7+
}

webroot/panel/account.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
require_once __DIR__ . "/../../resources/autoload.php";
44

55
use UnityWebPortal\lib\UnitySite;
6+
use UnityWebPortal\lib\exceptions\RedirectException;
67

7-
require_once $LOC_HEADER;
8+
try {
9+
include $LOC_HEADER;
10+
} catch (RedirectException $e) {
11+
echo $e->getMessage();
12+
return;
13+
}
814

915
$invalid_ssh_dialogue = "<script type='text/javascript'>
1016
alert('Invalid SSH key. Please verify your public key file is valid.');

0 commit comments

Comments
 (0)