php.js
php.js copied to clipboard
--fixed #72
Error fixed:
XMLHttpRequest cannot load ./cfg/php.ini due to access control checks. - line 15372
TypeError: undefined is not an object (evaluating 'lvl.replace') - 12108
TypeError: undefined is not an object (evaluating 'variables_order.indexOf') - line 12143
What changed?
// Line: 12108
if (isNaN( this.$ini.PHP.error_reporting - 0)) {
var lvl = this.$ini.PHP.error_reporting; // ISSUE #72
["E_ERROR",
"E_RECOVERABLE_ERROR",
"E_WARNING",
"E_PARSE" ,
"E_NOTICE" ,
"E_STRICT",
"E_DEPRECATED",
"E_CORE_ERROR",
"E_CORE_WARNING",
"E_COMPILE_ERROR",
"E_COMPILE_WARNING",
"E_USER_ERROR",
"E_USER_WARNING",
"E_USER_NOTICE",
"E_USER_DEPRECATED",
"E_ALL"].forEach(function( err ){
lvl = lvl.replace(err, PHP.Constants[ err ]);
});
this.$ini.PHP.error_reporting = eval(lvl);
}
this.error_reporting(new PHP.VM.Variable( this.$ini.PHP.error_reporting ));
// Section PHP
// |------> post_max_size
if ( (post_max_size = PHP.Utils.Filesize(this.$ini.PHP.post_max_size)) > opts.RAW_POST.length || post_max_size == 0 ) {
if (this.$ini.enable_post_data_reading != 0) {
$('_POST').$ = PHP.VM.Array.fromObject.call( this, ( variables_order.indexOf("P") !== -1 ) ? opts.POST : {} ).$;
$('HTTP_RAW_POST_DATA').$ = opts.RAW_POST;
} else {
$('_POST').$ = PHP.VM.Array.fromObject.call( this, {} ).$;
}
} else {
$('_POST').$ = PHP.VM.Array.fromObject.call( this, {} ).$;
if (this.$ini.always_populate_raw_post_data == 1 ) {
ENV[ PHP.Compiler.prototype.ERROR ]( "Unknown: POST Content-Length of " + opts.RAW_POST.length + " bytes exceeds the limit of " + post_max_size + " bytes in Unknown on line 0", PHP.Constants.E_WARNING );
ENV[ PHP.Compiler.prototype.ERROR ]( "Cannot modify header information - headers already sent in Unknown on line 0", PHP.Constants.E_WARNING );
} else {
ENV[ PHP.Compiler.prototype.ERROR ]( "POST Content-Length of " + opts.RAW_POST.length + " bytes exceeds the limit of " + post_max_size + " bytes in Unknown on line 0", PHP.Constants.E_WARNING );
}
}
// Line: 12143
ENV.$Array = new PHP.VM.Array( ENV );
var variables_order = this.$ini.PHP.variables_order;