Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<? use vendor\ekipisi\metabase\config as Config; class ControllerExtensionFeedMet..
Decoded Output download
<?
use vendor\ekipisi\metabase\config as Config; class ControllerExtensionFeedMetaBase extends Controller { public function index() { if ($this->config->get("feed_metabase_status") == "on") { $this->load->model("setting/setting"); $store_id = 0; if (isset($this->request->get["store_id"])) { $store_id = $this->request->get["store_id"]; } $config = $this->model_setting_setting->getSetting(Config::metabase_name_small, $store_id); if (!$config) { return; } $output = "<?xml version="1.0" encoding="utf-8"?>"; $output .= "<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0" xmlns:atom="http://www.w3.org/2005/Atom">"; $output .= "<channel>"; $output .= "<title>" . $this->config->get("config_name") . "</title>"; $output .= "<description>" . $this->config->get("config_meta_description") . "</description>"; $output .= "<link>" . $this->config->get("config_url") . "</link>"; $output .= "<atom:link href="" . $this->url->link("extension/feed/meta_base", "store_id=" . $store_id) . "" rel="self" type="application/rss+xml" />"; $this->load->model("catalog/category"); $this->load->model("catalog/product"); $this->load->model("extension/feed/meta_base"); $this->load->model("tool/image"); $currency_code = $this->config->get("feed_metabase_currency"); $currency_value = $this->currency->getValue($this->config->get("feed_metabase_currency")); $gtin = $config["feed_metabase_gtin"]; $product_data = array(); foreach ($config["feed_metabase_category"] as $category) { $filter_data = array("store_id" => $store_id, "language_id" => $config["feed_metabase_language"], "filter_category_id" => $category, "filter_filter" => false); $products = $this->model_extension_feed_meta_base->getProducts($filter_data); foreach ($products as $product) { if (!in_array($product["product_id"], $product_data)) { $product_data[] = $product["product_id"]; if (isset($config["feed_metabase_manufacturer"])) { if (!in_array($product["manufacturer_id"], $config["feed_metabase_manufacturer"])) { continue; } } $output .= "<item>"; if ($product["sku"]) { $output .= " <g:item_group_id><![CDATA[" . $product["sku"] . "]]></g:item_group_id>"; } $gtinno = 0; if ($gtin == "default") { if ($product["upc"]) { $gtinno = $product["upc"]; } else { if ($product["ean"]) { $gtinno = $product["ean"]; } else { if ($product["jan"]) { $gtinno = $product["jan"]; } else { if ($product["isbn"]) { $gtinno = $product["isbn"]; } else { $gtinno = $product["gtin"]; } } } } } else { if ($gtin == "upc") { $gtinno = $product["upc"]; } else { if ($gtin == "ean") { $gtinno = $product["ean"]; } else { if ($gtin == "jan") { $gtinno = $product["jan"]; } else { if ($gtin == "isbn") { $gtinno = $product["isbn"]; } } } } } $output .= "<g:gtin>" . $gtinno . "</g:gtin>"; if ($product["model"]) { $output .= " <g:model_number><![CDATA[" . $product["model"] . "]]></g:model_number>"; } $output .= "<g:id>" . $product["product_id"] . "</g:id>"; $output .= "<g:title><![CDATA[" . $product["name"] . "]]></g:title>"; if ($product["description"]) { $output .= "<g:description><![CDATA[" . $this->str_short(strip_tags(html_entity_decode($product["description"], ENT_QUOTES, "UTF-8")), 9999, 0, '') . "]]></g:description>"; } else { $output .= "<g:description><![CDATA[" . $this->str_short(strip_tags(html_entity_decode($product["name"], ENT_QUOTES, "UTF-8")), 9999, 0, '') . "]]></g:description>"; } $output .= "<g:link>" . $this->url->link("product/product", "product_id=" . $product["product_id"]) . "</g:link>"; if ($product["image"]) { $output .= "<g:image_link>" . $this->model_tool_image->resize($product["image"], $this->config->get("theme_" . $this->config->get("config_theme") . "_image_popup_width"), $this->config->get("theme_" . $this->config->get("config_theme") . "_image_popup_height")) . "</g:image_link>"; } else { $output .= " <g:image_link></g:image_link>"; } if ($config["feed_metabase_additional_image"]) { $images = $this->model_extension_feed_meta_base->getProductImages($product["product_id"]); foreach ($images as $image) { $output .= "<additional_image_link>" . $this->model_tool_image->resize($image["image"], $this->config->get("theme_" . $this->config->get("config_theme") . "_image_popup_width"), $this->config->get("theme_" . $this->config->get("config_theme") . "_image_popup_height")) . "</additional_image_link>"; } } if ($product["manufacturer"]) { $output .= "<g:brand><![CDATA[" . html_entity_decode($product["manufacturer"], ENT_QUOTES, "UTF-8") . "]]></g:brand>"; } else { $output .= "<g:brand><![CDATA[" . html_entity_decode($this->config->get("config_name"), ENT_QUOTES, "UTF-8") . "]]></g:brand>"; } $output .= "<g:price>" . $this->currency->format($this->tax->calculate($product["price"], $product["tax_class_id"]), $currency_code, $currency_value, false) . " " . $currency_code . "</g:price>"; if ((double) $product["special"]) { $output .= "<g:sale_price>" . $this->currency->format($this->tax->calculate($product["special"], $product["tax_class_id"]), $currency_code, $currency_value, false) . " " . $currency_code . "</g:sale_price>"; } if ((double) $product["weight"]) { $output .= "<g:shipping_weight>" . $this->weight->format($product["weight"], $product["weight_class_id"]) . "</g:shipping_weight>"; } $output .= "<g:condition>new</g:condition>"; $output .= "<g:availability><![CDATA[" . ($product["quantity"] ? "in stock" : "out of stock") . "]]></g:availability>"; if ($product["mpn"]) { $output .= " <g:mpn><![CDATA[" . $product["mpn"] . "]]></g:mpn>"; } else { $output .= " <g:identifier_exists>false</g:identifier_exists>"; } $output .= "</item>"; } } } $output .= "</channel>"; $output .= "</rss>"; header("Content-type: text/xml; charset=utf-8"); echo trim($output); } } private function str_short($string, $length, $lastLength = 0, $symbol = "...") { $string = str_replace("
", '', $string); $string = str_replace("
", '', $string); $string = str_replace("\x9", '', $string); if (strlen($string) > $length) { $result = substr($string, 0, $length - $lastLength - strlen($symbol)) . $symbol; return $result . ($lastLength ? substr($string, -$lastLength) : ''); } return $string; } } ?>
Did this file decode correctly?
Original Code
<?
use vendor\ekipisi\metabase\config as Config; class ControllerExtensionFeedMetaBase extends Controller { public function index() { if ($this->config->get("feed_metabase_status") == "on") { $this->load->model("setting/setting"); $store_id = 0; if (isset($this->request->get["store_id"])) { $store_id = $this->request->get["store_id"]; } $config = $this->model_setting_setting->getSetting(Config::metabase_name_small, $store_id); if (!$config) { return; } $output = "<?xml version="1.0" encoding="utf-8"?>"; $output .= "<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0" xmlns:atom="http://www.w3.org/2005/Atom">"; $output .= "<channel>"; $output .= "<title>" . $this->config->get("config_name") . "</title>"; $output .= "<description>" . $this->config->get("config_meta_description") . "</description>"; $output .= "<link>" . $this->config->get("config_url") . "</link>"; $output .= "<atom:link href="" . $this->url->link("extension/feed/meta_base", "store_id=" . $store_id) . "" rel="self" type="application/rss+xml" />"; $this->load->model("catalog/category"); $this->load->model("catalog/product"); $this->load->model("extension/feed/meta_base"); $this->load->model("tool/image"); $currency_code = $this->config->get("feed_metabase_currency"); $currency_value = $this->currency->getValue($this->config->get("feed_metabase_currency")); $gtin = $config["feed_metabase_gtin"]; $product_data = array(); foreach ($config["feed_metabase_category"] as $category) { $filter_data = array("store_id" => $store_id, "language_id" => $config["feed_metabase_language"], "filter_category_id" => $category, "filter_filter" => false); $products = $this->model_extension_feed_meta_base->getProducts($filter_data); foreach ($products as $product) { if (!in_array($product["product_id"], $product_data)) { $product_data[] = $product["product_id"]; if (isset($config["feed_metabase_manufacturer"])) { if (!in_array($product["manufacturer_id"], $config["feed_metabase_manufacturer"])) { continue; } } $output .= "<item>"; if ($product["sku"]) { $output .= " <g:item_group_id><![CDATA[" . $product["sku"] . "]]></g:item_group_id>"; } $gtinno = 0; if ($gtin == "default") { if ($product["upc"]) { $gtinno = $product["upc"]; } else { if ($product["ean"]) { $gtinno = $product["ean"]; } else { if ($product["jan"]) { $gtinno = $product["jan"]; } else { if ($product["isbn"]) { $gtinno = $product["isbn"]; } else { $gtinno = $product["gtin"]; } } } } } else { if ($gtin == "upc") { $gtinno = $product["upc"]; } else { if ($gtin == "ean") { $gtinno = $product["ean"]; } else { if ($gtin == "jan") { $gtinno = $product["jan"]; } else { if ($gtin == "isbn") { $gtinno = $product["isbn"]; } } } } } $output .= "<g:gtin>" . $gtinno . "</g:gtin>"; if ($product["model"]) { $output .= " <g:model_number><![CDATA[" . $product["model"] . "]]></g:model_number>"; } $output .= "<g:id>" . $product["product_id"] . "</g:id>"; $output .= "<g:title><![CDATA[" . $product["name"] . "]]></g:title>"; if ($product["description"]) { $output .= "<g:description><![CDATA[" . $this->str_short(strip_tags(html_entity_decode($product["description"], ENT_QUOTES, "UTF-8")), 9999, 0, '') . "]]></g:description>"; } else { $output .= "<g:description><![CDATA[" . $this->str_short(strip_tags(html_entity_decode($product["name"], ENT_QUOTES, "UTF-8")), 9999, 0, '') . "]]></g:description>"; } $output .= "<g:link>" . $this->url->link("product/product", "product_id=" . $product["product_id"]) . "</g:link>"; if ($product["image"]) { $output .= "<g:image_link>" . $this->model_tool_image->resize($product["image"], $this->config->get("theme_" . $this->config->get("config_theme") . "_image_popup_width"), $this->config->get("theme_" . $this->config->get("config_theme") . "_image_popup_height")) . "</g:image_link>"; } else { $output .= " <g:image_link></g:image_link>"; } if ($config["feed_metabase_additional_image"]) { $images = $this->model_extension_feed_meta_base->getProductImages($product["product_id"]); foreach ($images as $image) { $output .= "<additional_image_link>" . $this->model_tool_image->resize($image["image"], $this->config->get("theme_" . $this->config->get("config_theme") . "_image_popup_width"), $this->config->get("theme_" . $this->config->get("config_theme") . "_image_popup_height")) . "</additional_image_link>"; } } if ($product["manufacturer"]) { $output .= "<g:brand><![CDATA[" . html_entity_decode($product["manufacturer"], ENT_QUOTES, "UTF-8") . "]]></g:brand>"; } else { $output .= "<g:brand><![CDATA[" . html_entity_decode($this->config->get("config_name"), ENT_QUOTES, "UTF-8") . "]]></g:brand>"; } $output .= "<g:price>" . $this->currency->format($this->tax->calculate($product["price"], $product["tax_class_id"]), $currency_code, $currency_value, false) . " " . $currency_code . "</g:price>"; if ((double) $product["special"]) { $output .= "<g:sale_price>" . $this->currency->format($this->tax->calculate($product["special"], $product["tax_class_id"]), $currency_code, $currency_value, false) . " " . $currency_code . "</g:sale_price>"; } if ((double) $product["weight"]) { $output .= "<g:shipping_weight>" . $this->weight->format($product["weight"], $product["weight_class_id"]) . "</g:shipping_weight>"; } $output .= "<g:condition>new</g:condition>"; $output .= "<g:availability><![CDATA[" . ($product["quantity"] ? "in stock" : "out of stock") . "]]></g:availability>"; if ($product["mpn"]) { $output .= " <g:mpn><![CDATA[" . $product["mpn"] . "]]></g:mpn>"; } else { $output .= " <g:identifier_exists>false</g:identifier_exists>"; } $output .= "</item>"; } } } $output .= "</channel>"; $output .= "</rss>"; header("Content-type: text/xml; charset=utf-8"); echo trim($output); } } private function str_short($string, $length, $lastLength = 0, $symbol = "...") { $string = str_replace("
", '', $string); $string = str_replace("
", '', $string); $string = str_replace("\x9", '', $string); if (strlen($string) > $length) { $result = substr($string, 0, $length - $lastLength - strlen($symbol)) . $symbol; return $result . ($lastLength ? substr($string, -$lastLength) : ''); } return $string; } } ?>
Function Calls
None |
Stats
MD5 | 7e824885516f636a4002713f56d6feb8 |
Eval Count | 0 |
Decode Time | 52 ms |