Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
private function x83($x58) { $x72 = "\154\157g"; $x75 ..
Decoded Output download
<? private function x83($x58) {
$x72 = "log";
$x75 = "in_array";
$x77 = "array_unshift";
$x79 = "count";
$x7a = "implode";
$x7b = "is_numeric";
$x7c = "array_push";
$x7d = "strtolower";
$x7e = "strstr";
$x7f = "explode";
$x80 = "addslashes";
$this->_sql = [];
foreach($x58 as $x59 => $x5a) {
$x58[$x59] = trim($x5a);
}
if($this->getUseCustomRules()) {
/**
* Commented by Vitapur
*/
//eval(str_replace('$C[', '$x58[', $this->getCustomRules()));
/**
* Added by Vitapur
*/
foreach($this->getEvalLines() as $l => $line) {
try {
eval(str_replace('$C[', '$x58[', $line.';'));
}catch(ParseError $e) {
if(!isset($this->_parseError[$l])) {
$this->_parseError[$l] = true;
Mage::$x72('--> Custom rules parse error at line '.($l + 1).': '.$line, null, "MassStockUpate.log");
}
}
}
}
$x5c = array();
$x5d = array();
if (isset($this->_products[$x58[0]])) {
$x5e = $this->_products[$x58[0]];
if (isset($this->_stocks[$x5e])) {
$x5f = $this->_stocks[$x5e];
} else {
$this->_autoInc++;
$x5f = $this->_autoInc;
}
$x5c["ID"] = $x5e;
$x60 = true;
$x5c["status"] = $x60;
$x5c["total"] = 0;
$x5c["in_stock"] = null;
$x61 = 0;
foreach ($x58 as $x4d => $x62) {
if (isset($this->_columns[$x4d - 1]) && $x4d > 0) {
if (!$this->_total) {
if ($x7b($x62) && $x60) {
if ($this->_columns[$x4d - 1] != "total" && $this->_columns[$x4d - 1] != "is_in_stock" && ($this->_columns[$x4d - 1] == "used" || $x7b($this->_columns[$x4d - 1])))
$x5c["total"] += $x62;
$x60 = true;
}
} else {
if ($this->_total && $this->_columns[$x4d - 1] == "total") {
$x5c["total"] = $x62;
if ($x7b($x62))
$x60 = true;
else
$x60 = false;
}
}
if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory") && $x60) {
if ($x7b($x62) && $x7b($this->_columns[$x4d - 1])) {
$x63 = " REPLACE INTO `" . $this->_tables["ai"] . "` (`id`, `localstock_id`,`place_id`,`quantity_in_stock`,`product_id`,`backorder_allowed`,`use_config_setting_for_backorders`) values(
IF((SELECT count(`id`) FROM `" . $this->_tables["ai"] . "` AS a WHERE `place_id`=" . $this->_columns[$x4d - 1] . " AND `product_id`=" . $x5e . ")=1,(SELECT `id` FROM " . $this->_tables["ai"] . " AS a WHERE `place_id`=" . $this->_columns[$x4d - 1] . " AND `product_id`=" . $x5e . "),NULL) ,$x5f," . $this->_columns[$x4d - 1] . ",$x62,$x5e,(SELECT `backorder_allowed` FROM `" . $this->_tables["ai"] . "` AS `b` WHERE `place_id`=" . $this->_columns[$x4d - 1] . " AND `product_id`=" . $x5e . "),(SELECT `use_config_setting_for_backorders` FROM `" . $this->_tables["ai"] . "` AS `c` WHERE `place_id`=" . $this->_columns[$x4d - 1] . " AND `product_id`=" . $x5e . ")); ";
$x7c($this->_sql, $x63);
$x5d[] = "-IFNULL((SELECT `quantity_in_stock` FROM `" . $this->_tables["ai"] . "` WHERE `place_id`=" . $this->_columns[$x4d - 1] . " AND `product_id`=" . $x5e . " ),0)";
}
}
if (!$this->getAutoSetInstock()) {
if ($this->_is_in_stock && $this->_columns[$x4d - 1] == "is_in_stock") {
if ($x75($x7d($x62), array(
"1",
"true",
"yes",
"on",
"in stock",
"instock",
"available"
)))
$x5c["in_stock"] = true;
else
$x5c["in_stock"] = false;
}
} else {
if ($x5c["total"] > 0)
$x5c["in_stock"] = true;
else
$x5c["in_stock"] = false;
}
if ($this->_manage_local_stock && $this->_columns[$x4d - 1] == "manage_local_stock") {
if ($x75($x7d($x62), array(
"1",
"true",
"yes",
"on",
"in stock",
"instock",
"available"
)))
$x5c["manage_local_stock"] = 1;
else
$x5c["manage_local_stock"] = 0;
} else {
$x5c["manage_local_stock"] = 1;
}
if ($x7e($this->_columns[$x4d - 1], "attribute")) {
$x64 = ($x7f('-', $this->_columns[$x4d - 1]));
$x65 = Mage::getSingleton("core/resource")->getTableName("catalog_product_entity_" . $x64[3]);
$x63 = "UPDATE `$x65` SET `value`='" . $x80($x62) . "' WHERE `entity_id`='" . $x5e . "' AND `attribute_id`='" . $x64[2] . "';";
$x7c($this->_sql, $x63);
}
$x5c[$x61]["value"] = $x62;
$x5c[$x61]["code"] = $this->_columns[$x4d - 1];
$x61++;
}
}
;
$x5c["status"] = $x60;
$x66 = $x5c["total"];
if ($this->getAutoSetTotal() == 2) {
if ($x79($x5d))
$x66 = "(SELECT (IFNULL(SUM(`quantity_in_stock`),0)" . $x7a('', $x5d) . "+$x66) FROM " . $this->_tables["ai"] . " WHERE `product_id`=$x5e)";
else {
$x60 = false;
}
}
$x67 = $x5c["in_stock"];
if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory")) {
if ($x60) {
$x63 = "REPLACE INTO `" . $this->_tables["aip"] . "` values($x5f,$x5e," . $x5c["manage_local_stock"] . ",$x66); ";
$x77($this->_sql, $x63);
}
}
if (($x60)) {
if ($x67 === true || $x67 === false) {
$x68 = ", `is_in_stock`";
$x69 = ($x67) ? ',1' : ',0';
if ($this->getAutoSetTotal() == 2) {
$x69 = " , IF ($x66>0,1,0)";
}
} else {
$x68 = null;
$x69 = null;
}
$x63 = "REPLACE INTO `" . $this->_tables["csi"] . "` (`item_id`,`product_id`,`qty`,`stock_id` $x68) VALUES ( IF((SELECT COUNT(`item_id`) FROM `" . $this->_tables["csi"] . "` as `csi` WHERE `product_id`=$x5e)=1, (SELECT `item_id` FROM `" . $this->_tables["csi"] . "` as `csi` WHERE `product_id`=$x5e),NULL) ,$x5e,$x66,1 $x69); ";
$x77($this->_sql, $x63);
}
if ($x60)
$this->_notices[] = "SKU <i>$x58[0]</i> has been updated";
else {
Mage::$x72("* Product #" . $x58[0] . " has been ignored due to some non consistent data.", null, "MassStockUpate.log");
$this->_warnings[] = "SKU <i>$x58[0]</i> has been ignored due to some non consistent data.";
}
$this->_output[] = $x5c;
} else {
Mage::$x72("* Product #" . $x58[0] . " doesn't exist. Product has been ignored.", null, "MassStockUpate.log");
$this->_warnings[] = "SKU <i>$x58[0]</i> doesn't exist. Product has been ignored.";
}
} ?>
Did this file decode correctly?
Original Code
private function x83($x58) {
$x72 = "\154\157g";
$x75 = "\x69\156\137a\162\162\141y";
$x77 = "\x61\x72ra\x79\x5f\x75n\x73h\151\x66\164";
$x79 = "\143\157u\156t";
$x7a = "\x69\x6dp\154ode";
$x7b = "is\137\x6eu\x6d\x65\x72\x69\x63";
$x7c = "\x61\162\162a\x79\x5fp\165\163\x68";
$x7d = "\x73\164rt\157\x6cowe\162";
$x7e = "\163t\162\x73t\162";
$x7f = "\x65x\160\154\x6fde";
$x80 = "\141\144\x64s\154a\163h\x65s";
$this->_sql = [];
foreach($x58 as $x59 => $x5a) {
$x58[$x59] = trim($x5a);
}
if($this->getUseCustomRules()) {
/**
* Commented by Vitapur
*/
//eval(str_replace('$C[', '$x58[', $this->getCustomRules()));
/**
* Added by Vitapur
*/
foreach($this->getEvalLines() as $l => $line) {
try {
eval(str_replace('$C[', '$x58[', $line.';'));
}catch(ParseError $e) {
if(!isset($this->_parseError[$l])) {
$this->_parseError[$l] = true;
Mage::$x72('--> Custom rules parse error at line '.($l + 1).': '.$line, null, "MassStockUpate.log");
}
}
}
}
$x5c = array();
$x5d = array();
if (isset($this->_products[$x58[0]])) {
$x5e = $this->_products[$x58[0]];
if (isset($this->_stocks[$x5e])) {
$x5f = $this->_stocks[$x5e];
} else {
$this->_autoInc++;
$x5f = $this->_autoInc;
}
$x5c["\x49D"] = $x5e;
$x60 = true;
$x5c["\x73ta\164\x75\163"] = $x60;
$x5c["\x74\x6f\x74\x61\154"] = 0;
$x5c["\x69\156_\163tock"] = null;
$x61 = 0;
foreach ($x58 as $x4d => $x62) {
if (isset($this->_columns[$x4d - 1]) && $x4d > 0) {
if (!$this->_total) {
if ($x7b($x62) && $x60) {
if ($this->_columns[$x4d - 1] != "\x74\x6f\x74\x61\154" && $this->_columns[$x4d - 1] != "\x69\163\x5f\x69\156\x5fs\164o\143\x6b" && ($this->_columns[$x4d - 1] == "\x75\x73e\144" || $x7b($this->_columns[$x4d - 1])))
$x5c["\x74\x6f\x74\x61\154"] += $x62;
$x60 = true;
}
} else {
if ($this->_total && $this->_columns[$x4d - 1] == "\x74\x6f\x74\x61\154") {
$x5c["\x74\x6f\x74\x61\154"] = $x62;
if ($x7b($x62))
$x60 = true;
else
$x60 = false;
}
}
if (Mage::helper("\x63o\x72\145")->isModuleEnabled("\127y\157\155i\156d\137Ad\x76an\x63\145\144\151\x6e\166ent\157r\x79") && $x60) {
if ($x7b($x62) && $x7b($this->_columns[$x4d - 1])) {
$x63 = " \122\105P\x4c\101C\105\x20IN\x54\x4f \140" . $this->_tables["a\151"] . "\x60 \50\x60id\140\54\x20`\x6c\x6fc\x61\x6c\x73t\x6f\143\x6b_i\x64\140,\140p\154a\143\145_\151\x64\x60\x2c`qu\x61\156\x74\151\164\x79\137\151n\137\x73\x74\157\x63\153`,`p\162o\x64uc\164_id`\54\140b\x61c\x6b\157r\144\x65r\x5f\x61l\154\157\167\145\x64\x60\x2c\140u\163\145\137c\x6f\156fi\x67\x5f\163\145\x74ti\x6e\147\x5ff\157\x72_\x62\141\x63ko\162\x64\145\162s`\x29\40v\141\x6cue\163\x28\x0d \x20\x20 \40\x20\40\x20\x20\40\x20 \x20 \x20\40\x20 \x20 \40\40 \40\x20\40 \40\x20 \40 \x20\40\40\x49F\x28\50SE\114\105\x43\x54\40c\x6f\x75nt(\x60i\x64\x60\51 \106\122O\x4d\40`" . $this->_tables["a\151"] . "`\x20\101\123 \141\x20\127H\x45R\105\x20\x60\x70l\x61\143e\137\151\x64\140\x3d" . $this->_columns[$x4d - 1] . " \x41\x4e\104\x20\40\140\x70r\x6f\144u\143\164\137\x69\144\x60=" . $x5e . "\51\75\61\x2c\50S\105\x4c\x45\x43\x54 \x60\x69d\140\40F\x52O\x4d\x20" . $this->_tables["a\151"] . " \101S\x20a\40\127\110\x45\x52\105 `\x70\x6c\x61\x63\x65_\151\144`=" . $this->_columns[$x4d - 1] . " A\x4eD \x60p\162\x6f\x64\165\143\x74_\x69\144`\x3d" . $x5e . "),NULL) ,$x5f," . $this->_columns[$x4d - 1] . ",$x62,$x5e,(SELECT `backorder_allowed` FROM `" . $this->_tables["a\151"] . "\x60\x20A\123\40\x60\142\x60\40\127H\x45\122\x45 \x60\x70\154a\x63e\x5f\151d`\75" . $this->_columns[$x4d - 1] . " A\x4eD \x60p\162\x6f\x64\165\143\x74_\x69\144`\x3d" . $x5e . "\51\54\50S\x45\x4cE\x43\x54\40\x60\x75\x73\145_\x63\x6f\156\146\x69\147\x5fse\164\x74\151\x6eg\x5f\146\157r_\x62ac\x6bo\x72de\x72\x73\140\x20\x46\122\117\115 \x60" . $this->_tables["a\151"] . "\x60\x20A\123\40`c`\x20\127H\105\x52E \x60p\154\x61\x63\145\137\x69\144\x60=" . $this->_columns[$x4d - 1] . " A\x4eD \x60p\162\x6f\x64\165\143\x74_\x69\144`\x3d" . $x5e . "\x29); ";
$x7c($this->_sql, $x63);
$x5d[] = "\x2d\111\x46\x4eUL\x4c\50(\x53E\x4c\x45CT\x20\x60\161\165\x61nti\164\171\137i\x6e\137s\x74\157\x63\x6b` \x46\x52\x4f\x4d\x20\x60" . $this->_tables["a\151"] . "` \x57\x48\105R\x45\x20`\x70l\x61\143\145\x5f\x69\x64\140=" . $this->_columns[$x4d - 1] . " \x41\x4e\104\x20\40\140\x70r\x6f\144u\143\164\137\x69\144\x60=" . $x5e . "\40),\x30)";
}
}
if (!$this->getAutoSetInstock()) {
if ($this->_is_in_stock && $this->_columns[$x4d - 1] == "\x69\163\x5f\x69\156\x5fs\164o\143\x6b") {
if ($x75($x7d($x62), array(
"\61",
"\x74\x72\x75\x65",
"y\145\x73",
"\x6f\156",
"\x69\x6e\x20\x73\164oc\x6b",
"i\x6e\x73\x74o\x63k",
"\x61v\141i\x6ca\142\154e"
)))
$x5c["\x69\156_\163tock"] = true;
else
$x5c["\x69\156_\163tock"] = false;
}
} else {
if ($x5c["\x74\x6f\x74\x61\154"] > 0)
$x5c["\x69\156_\163tock"] = true;
else
$x5c["\x69\156_\163tock"] = false;
}
if ($this->_manage_local_stock && $this->_columns[$x4d - 1] == "\x6d\141n\141\x67\x65\x5fl\x6fc\141\x6c_\163\x74\x6fc\x6b") {
if ($x75($x7d($x62), array(
"\61",
"\x74\x72\x75\x65",
"y\145\x73",
"\x6f\156",
"\x69\x6e\x20\x73\164oc\x6b",
"i\x6e\x73\x74o\x63k",
"\x61v\141i\x6ca\142\154e"
)))
$x5c["\x6d\141n\141\x67\x65\x5fl\x6fc\141\x6c_\163\x74\x6fc\x6b"] = 1;
else
$x5c["\x6d\141n\141\x67\x65\x5fl\x6fc\141\x6c_\163\x74\x6fc\x6b"] = 0;
} else {
$x5c["\x6d\141n\141\x67\x65\x5fl\x6fc\141\x6c_\163\x74\x6fc\x6b"] = 1;
}
if ($x7e($this->_columns[$x4d - 1], "a\x74tr\151\142\x75\x74e")) {
$x64 = ($x7f('-', $this->_columns[$x4d - 1]));
$x65 = Mage::getSingleton("\143o\162\x65\x2f\x72es\157\165\x72ce")->getTableName("\x63a\164al\x6f\x67_\160r\x6f\x64u\143t_e\156t\151ty_" . $x64[3]);
$x63 = "UPDATE `$x65` SET `value`='" . $x80($x62) . "\x27 W\110\105RE\40\x60ent\151\x74y\137\151d\140\75\47" . $x5e . "\x27\x20\101ND\x20\140at\x74ri\x62\165\x74\x65\137\151\x64\x60\75\x27" . $x64[2] . "\47\73";
$x7c($this->_sql, $x63);
}
$x5c[$x61]["v\x61lu\145"] = $x62;
$x5c[$x61]["\143\x6fde"] = $this->_columns[$x4d - 1];
$x61++;
}
}
;
$x5c["\x73ta\164\x75\163"] = $x60;
$x66 = $x5c["\x74\x6f\x74\x61\154"];
if ($this->getAutoSetTotal() == 2) {
if ($x79($x5d))
$x66 = "\50S\105\x4c\105\103\x54 \50I\106\116U\114\x4c\50S\x55\115\50`\x71\x75a\x6e\164\151\x74\171_i\x6e\137\x73\x74o\143\153`\x29\54\x30\51" . $x7a('', $x5d) . "+$x66) FROM " . $this->_tables["a\151"] . " WHERE `product_id`=$x5e)";
else {
$x60 = false;
}
}
$x67 = $x5c["\x69\156_\163tock"];
if (Mage::helper("\x63o\x72\145")->isModuleEnabled("\127y\157\155i\156d\137Ad\x76an\x63\145\144\151\x6e\166ent\157r\x79")) {
if ($x60) {
$x63 = "\122E\120L\x41\x43E \x49\116\x54\117 \x60" . $this->_tables["a\x69\160"] . "` values($x5f,$x5e," . $x5c["\x6d\141n\141\x67\x65\x5fl\x6fc\141\x6c_\163\x74\x6fc\x6b"] . ",$x66); ";
$x77($this->_sql, $x63);
}
}
if (($x60)) {
if ($x67 === true || $x67 === false) {
$x68 = ",\40\x60\151\163_\151n\137st\157c\153\x60";
$x69 = ($x67) ? ',1' : ',0';
if ($this->getAutoSetTotal() == 2) {
$x69 = " , IF ($x66>0,1,0)";
}
} else {
$x68 = null;
$x69 = null;
}
$x63 = "\122E\120L\x41\x43E \x49\116\x54\117 \x60" . $this->_tables["cs\151"] . "` (`item_id`,`product_id`,`qty`,`stock_id` $x68) VALUES ( IF((SELECT COUNT(`item_id`) FROM `" . $this->_tables["cs\151"] . "` as `csi` WHERE `product_id`=$x5e)=1, (SELECT `item_id` FROM `" . $this->_tables["cs\151"] . "` as `csi` WHERE `product_id`=$x5e),NULL) ,$x5e,$x66,1 $x69); ";
$x77($this->_sql, $x63);
}
if ($x60)
$this->_notices[] = "SKU <i>$x58[0]</i> has been updated";
else {
Mage::$x72("\52\40\x50\x72od\165ct\x20\x23" . $x58[0] . "\x20\150\141\x73 \x62\145e\156 \151\x67no\x72ed \144\x75\x65 \x74\157 \x73\x6f\155e\x20non\x20\x63\157\156\163\151s\164\x65\x6e\x74\x20\144\x61t\141\56", null, "MassStockUpate.log");
$this->_warnings[] = "SKU <i>$x58[0]</i> has been ignored due to some non consistent data.";
}
$this->_output[] = $x5c;
} else {
Mage::$x72("\52\40\x50\x72od\165ct\x20\x23" . $x58[0] . "\x20\x64oe\163n't \x65\170\151\163t\x2e P\x72\157\x64u\x63\x74 h\141\x73\40\142\145\145\156\40\x69\147\x6eo\162e\144.", null, "MassStockUpate.log");
$this->_warnings[] = "SKU <i>$x58[0]</i> doesn't exist. Product has been ignored.";
}
}
Function Calls
None |
Stats
MD5 | 8ebdb8c98a387f5d871acbc7f582e0f0 |
Eval Count | 0 |
Decode Time | 51 ms |