Fixed a bug with working directory in idObfuscation.php

This commit is contained in:
adolfintel 2019-01-30 10:47:45 +01:00
parent 7545d2544c
commit c7a20897d4

View file

@ -1,15 +1,16 @@
<?php <?php
function getObfuscationSalt(){ function getObfuscationSalt(){
if(file_exists("idObfuscation_salt.php")){ $saltFile=dirname(__FILE__)."/idObfuscation_salt.php";
require "idObfuscation_salt.php"; if(file_exists($saltFile)){
require $saltFile;
}else{ }else{
$bytes=openssl_random_pseudo_bytes(4); $bytes=openssl_random_pseudo_bytes(4);
$sf=fopen("idObfuscation_salt.php","w"); $sf=fopen($saltFile,"w");
fwrite($sf,chr(60)."?php\n"); fwrite($sf,chr(60)."?php\n");
fwrite($sf,'$OBFUSCATION_SALT=0x'.bin2hex($bytes).";\n"); fwrite($sf,'$OBFUSCATION_SALT=0x'.bin2hex($bytes).";\n");
fwrite($sf,"?".chr(62)); fwrite($sf,"?".chr(62));
fclose($sf); fclose($sf);
require "idObfuscation_salt.php"; require $saltFile;
} }
return isset($OBFUSCATION_SALT)?$OBFUSCATION_SALT:0; return isset($OBFUSCATION_SALT)?$OBFUSCATION_SALT:0;
} }