我有这段代码,它适用于 PHP 5.2
if (realpath ( __FILE__ ) == realpath ( (isset ( $_SERVER ['PATH_TRANSLATED'] ) ? $_SERVER ['PATH_TRANSLATED'] : $_SERVER ['ORIG_PATH_TRANSLATED']) )) {
$path_parts = pathinfo ( __FILE__ );
trigger_error ( 'Direct call of file' . $path_parts ['basename'], E_USER_ERROR );
}
但在 5.3.3 中我有错误:
PHP 通知:未定义索引:/var/www/user/data/www/site/plugins/system/u24_je_plg_lytebox.php 第 16 行中的 ORIG_PATH_TRANSLATED
应该如何改变?谢谢!