在 Debug 一个问题,原有系统是 shopex ,代码是加密的,没法调试,在 showmycode 那个网站可以解密,但是解密之后的文件运行有问题,感觉不应该是解密的问题,但也想不出还有什么不对的。。。
错误信息: PHP Fatal error: Call to a member function base_url() on a non-object
出错的代码在下面构造函数中:
public function mdl_storager( )
{
$this->system = $system;
$this->base_url = $this->system->base_url( );
$this->class_name = defined( "WITH_STORAGER" ) ? constant( "WITH_STORAGER" ) : "fs_storage";
require_once( PLUGIN_DIR."/functions/".$this->class_name.".php" );
$this->worker = new $this->class_name( );
if ( defined( "HOST_MIRRORS" ) )
{
$host_mirrors = preg_split( "/[,\\s]+/", constant( "HOST_MIRRORS" ) );
if ( is_array( $host_mirrors ) && isset( $host_mirrors[0] ) )
{
$this->host_mirrors =& $host_mirrors;
$this->host_mirrors_count = count( $host_mirrors ) - 1;
}
}
}
上面的 modoel 是从这里引用的:
public function save( $brand_id, $aData )
{
$storager =& $this->system->loadModel( "system/storager" );
$oTemplate = $this->system->loadModel( "system/template" );
if ( $_FILES )
{
$aData['brand_logo'] = $storager->save_upload( $_FILES['brand_logo'], "brand" );
}
.... ......
1
pubby 2016-08-25 21:24:26 +08:00
$this->system = $system; // 这个 $system 哪来的?
|
2
blues9 OP @pubby
解密出来就是这样子。。我也很奇怪,对 php 了解不多,难道有什么特殊的注入机制?还是解密出了问题? 加密后的代码我传到百度云盘上了,大家帮看看吧: https://pan.baidu.com/s/1kVAUDCz |