function encrypt($id, $prefix = "JHC", $clear = false) { $crypt = new \Crypt(); $x = $prefix . $crypt->en(intval($id)); if (!$clear) { return $x; } if (strpos($x, '=') !== false || strpos($x, '-') !== false) { // PLog::write("Not a problem: Try again for no '= or -' in encrypt string", "INFO"); return encrypt_id($id, $prefix, $clear); } else { return $x; } }
function encrypt_request($m) { $id = $m[2]; if (is_numeric($id)) { return str_replace($m[2], encrypt_id($m[2]), $m[0]); } return $m[0]; }