Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php if($this->getFileEnclosure() != "none") { while (false !..

Decoded Output download

<?php 
if($this->getFileEnclosure() != "none") { 
             
            while (false !== ($x53 = $x40->streamReadCsv($this->getFileSeparator(), $this->getFileEnclosure()))) { 
                 
                $x54 = array_splice($x53, $x4f, 1); 
                array_unshift($x53, $x54[0]); 
                $this->x83($x53); 
                 
                foreach($this->_sql as $x49) { 
                     
                    $x50->streamWrite(str_replace(["
", "  "], [" ",""], trim($x49)) . "
"); 
                     
                } 
                 
            } 
             
        }else { 
             
            while(false !== ($x53 = $x40->streamReadCsv($this->getFileSeparator()))) { 
                 
                $x54 = array_splice($x53, $x4f, 1); 
                array_unshift($x53, $x54[0]); 
                $this->x83($x53); 
                foreach ($this->_sql as $x49) { 
                     
                    $x50->streamWrite(str_replace(["
", "  "], [" ", " "], trim($x49)) . "
"); 
                     
                } 
                 
            } 
             
        } 
         
        Mage::log("--> File closed : " . $x41, null, "MassStockUpate.log"); 
         
        $x40->streamClose(); 
        if($this->getAutoSetTotal() == 2) { 
             
            $x50->streamWrite("ALTER  TABLE `" . $this->_tables["ai"] . "` ADD CONSTRAINT `CONST_advancedinventory_localstock_id` FOREIGN KEY (localstock_id) REFERENCES " . $this->_tables["aip"] . " (id) ON UPDATE CASCADE ON DELETE CASCADE;"); 
         
        } 
         
        $x50->streamClose(); 
         
        if (count($this->_warnings)) { 
             
            Mage::getSingleton("core/session")->addError(implode("<br>", ($this->_warnings))); 
        } 
         
        if(Mage::getStoreConfig("massstockupdate/settings/report_debug")) { 
         
            Mage::getSingleton("core/session")->addWarning("Debug mode enabled.No data have been updated.<br>MassStockUpate.log file has been created (log files must be enabled in system > configuration > developer)."); 
         
            return; 
         
        } 
         
        $x55 = Mage::getSingleton("core/resource")->getConnection("core_write"); 
        $x55->beginTransaction(); 
         
        $error = false; 
         
        Mage::log("--> Executing MySql queries", null, "MassStockUpate.log"); 
         
        $x40 = new Varien_Io_File(); 
        $x40->streamOpen($x41 . $x51, "r"); 
         
        while(false !== ($x49 = $x40->streamRead(102400))) { 
             
            try { 
             
                $x55->exec($x49); 
             
            }catch(Mage_Core_Exception $x57) { 
                 
                Mage::log(" failed -->" . $x49, null, "MassStockUpate.log"); 
                $error = true; 
             
            }catch(Exception $x57) { 
                 
                Mage::log(" failed -->" . $x49, null, "MassStockUpate.log"); 
                Mage::log($x57->getMessage(), null, "MassStockUpate.log");  
                 
                $error = true; 
             
            } 
             
        } 
         
        if($error) { 
             
            Mage::log("--> MySql Rollback", null, "MassStockUpate.log"); 
             
            $x55->rollback(); 
             
            return false; 
             
        } 
         
        Mage::log("--> MySql Commit", null, "MassStockUpate.log"); 
        $x55->commit(); 
         
        $this->setImportedAt(Mage::getSingleton("core/date")->gmtDate("Y-m-d H:i:s"))->save(); 
         
        $x40->open(['path' => 'var/tmp']); 
        $x40->rm($x51); ?>

Did this file decode correctly?

Original Code

<?php
if($this->getFileEnclosure() != "none") {
            
            while (false !== ($x53 = $x40->streamReadCsv($this->getFileSeparator(), $this->getFileEnclosure()))) {
                
                $x54 = array_splice($x53, $x4f, 1);
                array_unshift($x53, $x54[0]);
                $this->x83($x53);
                
                foreach($this->_sql as $x49) {
                    
                    $x50->streamWrite(str_replace(["\x0a", "\40 "], ["\40",""], trim($x49)) . "\x0a");
                    
                }
                
            }
            
        }else {
            
            while(false !== ($x53 = $x40->streamReadCsv($this->getFileSeparator()))) {
                
                $x54 = array_splice($x53, $x4f, 1);
                array_unshift($x53, $x54[0]);
                $this->x83($x53);
                foreach ($this->_sql as $x49) {
                    
                    $x50->streamWrite(str_replace(["\x0a", "\40 "], ["\40", "\40"], trim($x49)) . "\x0a");
                    
                }
                
            }
            
        }
        
        Mage::log("--> File closed : " . $x41, null, "MassStockUpate.log");
        
        $x40->streamClose();
        if($this->getAutoSetTotal() == 2) {
            
            $x50->streamWrite("\x41L\x54\105\x52\40\40\x54\x41B\114\105 \x60" . $this->_tables["a\151"] . "\x60\x20\x41\104\104 \103\117\116\123\124R\101INT \x60\x43ONST_\141\144\x76\x61nced\x69n\166en\x74\x6f\x72\171\137l\x6f\143al\x73\x74o\x63k_\x69\144\x60 F\117\122E\x49\107\x4e KEY (l\157\x63\141\154s\164\157c\153\137\x69\x64\x29\x20R\105FER\105N\x43\x45S\x20" . $this->_tables["a\x69\160"] . " \x28\151\144\51\x20\x4f\x4e \125\x50\x44A\x54\105 \103\101\x53\103\101\x44E\x20\x4fN \104E\114\x45T\105 \x43\x41S\x43\101DE\73");
        
        }
        
        $x50->streamClose();
        
        if (count($this->_warnings)) {
            
            Mage::getSingleton("c\157r\145\57\x73\x65s\163\151\x6f\156")->addError(implode("\74\142\x72\76", ($this->_warnings)));
        }
        
        if(Mage::getStoreConfig("m\x61sss\164o\x63\153u\x70d\141\x74\x65\x2fs\x65t\x74\x69n\x67s\x2f\x72\x65p\157\162\x74\x5f\144\x65\x62\165\147")) {
        
            Mage::getSingleton("c\157r\145\57\x73\x65s\163\151\x6f\156")->addWarning("\x44e\x62u\x67 \x6d\x6f\x64\x65 \145\x6e\x61\x62\x6c\145\144\56\x4e\x6f\40d\x61\x74a\x20h\x61ve\40be\145n \165pd\141t\x65d.\74\x62\x72\x3eM\141\x73\x73\123\164\x6f\143\153Up\141t\x65\x2e\154\157g\x20\x66il\145\40\x68\141\163\40\142e\145\x6e\x20c\162e\x61\164\x65d\40\x28\154\x6f\x67\40f\151\154\x65\163\x20m\x75s\x74\40\x62\145\x20e\x6e\141\x62le\x64\x20\x69\156\x20s\171\163\x74\145m \x3e\x20co\156fi\x67\x75\162\141\164i\157n\x20> dev\x65\154\x6f\x70e\162\x29\56");
        
            return;
        
        }
        
        $x55 = Mage::getSingleton("\143o\162\x65\x2f\x72es\157\165\x72ce")->getConnection("\143\157\162\x65\137\167\x72\151\164e");
        $x55->beginTransaction();
        
        $error = false;
        
        Mage::log("--> E\170e\x63uti\156g\x20\115\171\123\x71\154\x20\x71\x75e\162\151\145s", null, "MassStockUpate.log");
        
        $x40 = new Varien_Io_File();
        $x40->streamOpen($x41 . $x51, "\x72");
        
        while(false !== ($x49 = $x40->streamRead(102400))) {
            
            try {
            
                $x55->exec($x49);
            
            }catch(Mage_Core_Exception $x57) {
                
                Mage::log(" \146\141\151l\145\144\40\x2d-\x3e" . $x49, null, "MassStockUpate.log");
                $error = true;
            
            }catch(Exception $x57) {
                
                Mage::log(" \146\141\151l\145\144\40\x2d-\x3e" . $x49, null, "MassStockUpate.log");
                Mage::log($x57->getMessage(), null, "MassStockUpate.log"); 
                
                $error = true;
            
            }
            
        }
        
        if($error) {
            
            Mage::log("\55-\x3e MyS\x71\154\40\x52o\154l\142ack", null, "MassStockUpate.log");
            
            $x55->rollback();
            
            return false;
            
        }
        
        Mage::log("\55\x2d>\40M\171\x53ql\40C\x6f\x6d\x6d\151\x74", null, "MassStockUpate.log");
        $x55->commit();
        
        $this->setImportedAt(Mage::getSingleton("cor\x65/\144\141\164e")->gmtDate("\131-\155-d H:\x69:\163"))->save();
        
        $x40->open(['path' => 'var/tmp']);
        $x40->rm($x51);

Function Calls

None

Variables

None

Stats

MD5 c8db277d7cbe063192198b79d1c859d6
Eval Count 0
Decode Time 57 ms