URLのスクリプトタグを確認したい
例: URL に script タグがある場合、以下のシナリオは正常に機能しています。
<?php
$url = 'admin/content/test/<script>';
preg_match('<script>', $url, $match);
if (count($match) >= 1) {
print 'It executes';
}
?>
出力: It executes
しかし、私の場合、URLに文字列「product_description」がある場合、上記の条件も一致します
<?php
$url = 'admin/content/product_description/test';
preg_match('<script>', $url, $match);
if (count($match) >= 1) {
print 'It executes';
}
?>
出力: 実行します
URL のスクリプト タグを確認する正しい方法を提案してください。