|
@@ -184,15 +184,14 @@ if (!function_exists('str_contains')) {
|
|
|
* @dep XML_TAG
|
|
|
* @dep JSON_ENCODE_FLAGS
|
|
|
**********************************************************************************************************************/
|
|
|
-function gfError($aValue, $aPHPError = false, $aDisableExternalOutput = null) {
|
|
|
+function gfError($aValue, $aPHPError = false, $aExternalOutput = null) {
|
|
|
$pageHeader = array(
|
|
|
'default' => 'Unable to Comply',
|
|
|
- 'fatal' => 'Fatal Error',
|
|
|
'php' => 'PHP Error',
|
|
|
'output' => 'Output'
|
|
|
);
|
|
|
|
|
|
- $externalOutput = !$aDisableExternalOutput ?? function_exists('gfGenContent');
|
|
|
+ $externalOutput = !$aExternalOutput ?? function_exists('gfGenContent');
|
|
|
$isCLI = (php_sapi_name() == "cli");
|
|
|
$isOutput = false;
|
|
|
|
|
@@ -223,7 +222,7 @@ function gfError($aValue, $aPHPError = false, $aDisableExternalOutput = null) {
|
|
|
gfGenContent($ePrefix, $eMessage, true, false, true);
|
|
|
}
|
|
|
|
|
|
- gfGenContent($ePrefix, $eMessage);
|
|
|
+ gfGenContent($ePrefix, $eMessage, null, null, true);
|
|
|
}
|
|
|
elseif ($isCLI) {
|
|
|
print('========================================' . NEW_LINE .
|
|
@@ -285,7 +284,7 @@ function gfSuperVar($aVarType, $aVarValue, $aFalsy = null) {
|
|
|
$varType = UNDERSCORE . strtoupper($aVarType);
|
|
|
|
|
|
// General variable absolute null check unless falsy is allowed
|
|
|
- if ($varType == "_VAR" || $varType == "_DIRECT"){
|
|
|
+ if ($varType == "_CHECK" || $varType == "_VAR" || $varType == "_DIRECT"){
|
|
|
$rv = $aVarValue ?? null;
|
|
|
|
|
|
if ($rv && !$aFalsy) {
|
|
@@ -380,7 +379,7 @@ function gfHeader($aHeader) {
|
|
|
**********************************************************************************************************************/
|
|
|
// This function sends a redirect header
|
|
|
function gfRedirect($aURL) {
|
|
|
- header('Location: ' . $aURL , true, 302);
|
|
|
+ header('Location: ' . $aURL, true, 302);
|
|
|
|
|
|
// We are done here
|
|
|
exit();
|
|
@@ -478,8 +477,8 @@ function gfStripRootPath($aPath) {
|
|
|
function gfGetDomain($aHost, $aReturnSub = null) {
|
|
|
$host = gfExplodeString(DOT, $aHost);
|
|
|
$domainSlice = $aReturnSub ? array_slice($host, 0, -2) : array_slice($host, -2, 2);
|
|
|
- $domainString = implode(DOT, $domainSlice);
|
|
|
- return $domainString;
|
|
|
+ $rv = implode(DOT, $domainSlice);
|
|
|
+ return $rv;
|
|
|
}
|
|
|
|
|
|
/**********************************************************************************************************************
|
|
@@ -642,7 +641,7 @@ function gfWriteFile($aData, $aFile, $aRenameFile = null) {
|
|
|
* Generate a random hexadecimal string
|
|
|
*
|
|
|
* @param $aLength Desired number of final chars
|
|
|
-* @returns Random hexadecimal string of desired lenth
|
|
|
+* @returns Random hexadecimal string of desired length
|
|
|
**********************************************************************************************************************/
|
|
|
function gfHexString($aLength = 40) {
|
|
|
if ($aLength <= 1) {
|