如你所见,这是我正在开发的项目。
我没用模板引擎,决定手搓模板解决。
然后……我懒得做伪静态了,于是注意到问题:从模板目录访问可以代替index.php+GET参数。
我就想到这么个神秘的解决方法。
<?php
$currentErrorReporting = error_reporting();
error_reporting($currentErrorReporting & ~E_WARNING);
$current_script = basename($_SERVER['SCRIPT_NAME']);
if ($current_script !== 'index.php') {
exit();
}
?>
神经……