function PrepareScript($testname, $obfu, $subs) { if (is_array($subs)) { // Keys from the argument will overwrite those from the base array. $subs = array_merge(GetBaseSubs(), $subs); } else { if ($subs) { // A truthy value indicates that the base array should be used. $subs = GetBaseSubs(); } } if (is_string($obfu)) { $code = GetObfuscatedPayload($testname, $obfu, $subs); } else { $code = GetPayload($testname, $subs); } return urlencode('<script>' . $code . '</script>'); }
function PrepareScript($testname, $obfu, $subs) { if (is_array($subs)) { // Keys from the argument will overwrite those from the base array. $subs = array_merge(GetBaseSubs(), $subs); } else { if ($subs) { // A truthy value indicates that the base array should be used. $subs = GetBaseSubs(); } } if (is_string($obfu)) { $code = GetObfuscatedPayload($testname, $obfu, $subs); } else { $code = GetPayload($testname, $subs); } $code = str_replace(array("\\", "'", "\n", "\r"), array("\\\\", "\\'", '\\n', '\\r'), $code); return $code; }
function PrepareScript($testname, $obfu, $subs) { if (is_array($subs)) { // Keys from the argument will overwrite those from the base array. $subs = array_merge(GetBaseSubs(), $subs); } else { if ($subs) { // A truthy value indicates that the base array should be used. $subs = GetBaseSubs(); } } if (is_string($obfu)) { $code = GetObfuscatedPayload($testname, $obfu, $subs); } else { $code = GetPayload($testname, $subs); } // No further processing needed to directly return a script. return $code; }