Skip to content

Commit

Permalink
add new function esc() to replace htmlspecialchars(), add DotEnv on H…
Browse files Browse the repository at this point in the history
…elper.php
  • Loading branch information
vgalvoso committed Dec 1, 2022
1 parent 27fb2df commit 7635e44
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/Libraries/Helper.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
use App\Libraries\DotEnv;
(new DotEnv(BASE_DIR . '/.env'))->load();
/**
* Generate output in JSON format and terminate the script
*
Expand Down Expand Up @@ -62,7 +64,7 @@ function view($fileName,$data = null){
if(! function_exists('route')){
function route($route){
if($route == "")
return header("Location: http://localhost/hris");
return header("Location: ".getenv('APP_URL'));
header("Location: $route");
exit();
}
Expand All @@ -88,3 +90,7 @@ function notFound(){
header("HTTP/1.1 404 Not Found");
exit("URL not found");
}

function esc($string){
return htmlspecialchars($string);
}

0 comments on commit 7635e44

Please sign in to comment.