<?php
if (preg_match('/^[a-z0-9]+$/', $_GET['page'])) {
$page = realpath('includes/'.$_GET['page'].'.php');
$tpl = realpath('templates/'.$_GET['page'].'.html');
if ($page && $tpl) {
include $page;
include $tpl;
} else {
// log error!
}
} else {
// log error!
}
?>
これはどれほど安全だと言えますか?Stack Overflow の Gumbo が書いています。
動的インクルードの安全性
あなたの意見を聞きたいです。
乾杯