Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for Zend Encoder/SafeGuard & PhpExpress)
- *
- * @ Version : 2.0.0.4
- * @ Author : DeZender
- * @ Release on : 21.10.2015
- * @ Official site : http://DeZender.Net
- *
- */
- class Util {
- public $timeparts = null;
- public $starttime = null;
- public static function replace_constant($text = null) {
- $procesados = array();
- $patron_constante = "@;([A-Za-z_0-9 ]+);@";
- $l_tmp = "";
- $ret = preg_match_all($patron_constante, $text, $out);
- if ($ret < 1) {
- return $text;
- }
- $l_array = &$out[1];
- $l_cnt = count($l_array);
- $l_i = 0;
- for (/**/; $l_i < $l_cnt; ++$l_i) {
- if (in_array($l_array[$l_i], $procesados)) {
- continue;
- }
- if (defined($l_array[$l_i])) {
- $text = str_replace("@;" . $l_array[$l_i] . ";@", constant($l_array[$l_i]), $text);
- }
- $procesados[] = $l_array[$l_i];
- continue;
- }
- return $text;
- }
- public static function replace_constant_PABORRAR($text = null) {
- if (trim($text) == "") {
- return $text;
- }
- $guindando_local = 0;
- $guindando_global = 0;
- $patron_constante = "(@;[A-Za-z_0-9 ]*;@)";
- $patron_contenido = "/@;([A-Za-z_0-9]*);@/";
- $l_tmp = "";
- $ret = preg_match_all($patron_constante, $text, $out);
- while (0 < $ret) {
- foreach ($out[0] as $l_const) {
- if (preg_match($patron_contenido, $l_const, $out2)) {
- if (defined($out2[1])) {
- $text = Util::replace($text, $out2[0], constant($out2[1]));
- }
- else {
- $guindando_local = 1;
- $guindando_global = 1;
- $l_tmp = Util::replace($l_const, "@;", "@_;");
- $l_tmp = Util::replace($l_tmp, ";@", ";_@");
- }
- }
- else {
- $guindando_local = 1;
- $guindando_global = 1;
- $l_tmp = Util::replace($l_const, "@;", "@_;");
- $l_tmp = Util::replace($l_tmp, ";@", ";_@");
- }
- if (!$guindando_local == 1) {
- continue;
- }
- $text = Util::replace($text, $l_const, $l_tmp);
- $guindando_local = 0;
- continue;
- }
- unset($out);
- $ret = preg_match_all($patron_constante, $text, $out);
- continue;
- }
- if ($guindando_global == 1) {
- $text = Util::replace($text, "@_;", "@;");
- $text = Util::replace($text, ";_@", ";@");
- }
- return $text;
- }
- public static function decode_return_xfmurl($text = null) {
- if (strlen($text) == 0) {
- return $text;
- }
- $text = str_replace("_@_", " ", $text);
- $arr1 = split(" ", $text);
- $result = "";
- $tmp_hex = "";
- $tmp_ascii = "";
- $cnt = count($arr1);
- if ($cnt == 1) {
- $result = $arr1[0] . "();";
- }
- else {
- $result = $arr1[0] . "(";
- $i = 1;
- for (/**/; $i < $cnt; ++$i) {
- if ($i == 1) {
- $result = $result . "'" . $arr1[$i] . "'";
- continue;
- }
- $result = $result . ",'" . $arr1[$i] . "'";
- continue;
- }
- $result .= ");";
- }
- $pos = strpos($result, "\\u");
- $pos2 = 0;
- if ($pos === false) {
- $pos2 = -1;
- }
- else {
- $pos2 = $pos;
- }
- while (0 <= $pos2) {
- $tmp_hex = substr($result, $pos - 1, 7);
- $tmp_ascii = chr((string)hexdec($tmp_hex));
- $result = str_replace($tmp_hex, $tmp_ascii, $result);
- $pos = strpos($result, "\\u");
- if ($pos === false) {
- $pos2 = -1;
- continue;
- }
- $pos2 = $pos;
- continue;
- }
- return $result;
- }
- public static function replace($text = null, $from = null, $to = null) {
- return str_replace($from, $to, $text);
- }
- public static function SQLReplace($text = null, $from = null, $to = null) {
- $tmpTo = trim($to);
- $l_formato = array("string", "number", "date", "datetime", "datetimebegin", "datetimeend", "like", "rlike", "llike", "flike");
- $l_posIni = strpos($from, "[");
- if ($l_posIni === false) {
- if ($tmpTo == "") {
- $text = Util::replace($text, "@" . $from . "@", "null");
- return $text;
- }
- $text = Util::replace($text, "@" . $from . "@", (string)$to);
- return $text;
- }
- $l_value = "";
- $l_tmpFrom = substr($from, 0, $l_posIni);
- $l_tmp = substr($from, $l_posIni + 1, strlen($from) - $l_posIni - 2);
- $l_posIni = strpos($l_tmp, ":");
- if ($l_posIni === false) {
- if (in_array(strtolower($l_tmp), $l_formato)) {
- $to = Util::sqlreplaceext($to, strtolower($l_tmp));
- $text = Util::replace($text, "@" . $l_tmpFrom . "@", $to);
- return $text;
- }
- if ($tmpTo == "") {
- $text = Util::replace($text, "@" . $l_tmpFrom . "@", $l_tmp);
- return $text;
- }
- $text = Util::replace($text, "@" . $l_tmpFrom . "@", $to);
- return $text;
- }
- $l_tmp2 = substr($l_tmp, 0, $l_posIni);
- if (in_array(strtolower($l_tmp2), $l_formato)) {
- $to = Util::sqlreplaceext($to, strtolower($l_tmp2), substr($l_tmp, $l_posIni + 1));
- $text = Util::replace($text, "@" . $l_tmpFrom . "@", $to);
- return $text;
- }
- if ($tmpTo == "") {
- $text = Util::replace($text, "@" . $l_tmpFrom . "@", $l_tmp);
- return $text;
- }
- $text = Util::replace($text, "@" . $l_tmpFrom . "@", $to);
- return $text;
- }
- public static function SQLReplaceExt($to = null, $format = null, $nullValue = null) {
- $l_tmp = "";
- $l_tmp2 = "";
- if (trim($to) == "") {
- return $nullValue;
- }
- switch (strtolower($format)) {
- case "string": {
- return "'" . $to . "'";
- }
- case "like": {
- return "'%" . $to . "%'";
- }
- case "rlike": {
- return "'" . $to . "%'";
- }
- case "llike": {
- return "'%" . $to . "'";
- }
- case "flike": {
- $l_tmp = preg_replace("/\\s+/", "%", $to);
- return "'%" . $l_tmp . "%'";
- }
- case "number": {
- return str_replace(",", ".", str_replace(".", "", $to));
- }
- case "date": {
- $l_tmp = $to;
- $l_tmp2 = "";
- $l_pos = strpos($l_tmp, " ");
- if ($l_pos !== false) {
- $l_tmp = substr($l_tmp, 0, $l_pos);
- }
- return "'" . Util::dbdate($l_tmp) . "'";
- }
- case "datetime": {
- $l_tmp = $to;
- $l_tmp2 = "";
- $l_pos = strpos($l_tmp, " ");
- if ($l_pos !== false) {
- $l_tmp2 = substr($l_tmp, $l_pos);
- ...............................................................................................
- .......................................................................
- .....................
Advertisement
Add Comment
Please, Sign In to add comment