{"id":808,"date":"2025-08-04T16:24:46","date_gmt":"2025-08-04T07:24:46","guid":{"rendered":"https:\/\/nexive.tech\/?p=808"},"modified":"2025-08-04T16:25:50","modified_gmt":"2025-08-04T07:25:50","slug":"%e3%80%90%e3%82%b5%e3%82%af%e3%83%83%e3%81%a8%e8%a7%a3%e8%aa%ac%e3%80%91php-htmlspecialchars%e3%81%a8%e3%82%b5%e3%83%8b%e3%82%bf%e3%82%a4%e3%82%ba%e5%87%a6%e7%90%86%e3%81%ae%e5%bf%85%e8%a6%81%e6%80%a7","status":"publish","type":"post","link":"https:\/\/nexive.tech\/?p=808","title":{"rendered":"\u3010\u30b5\u30af\u30c3\u3068\u89e3\u8aac\u3011PHP htmlspecialchars\u3068\u30b5\u30cb\u30bf\u30a4\u30ba\u51e6\u7406\u306e\u5fc5\u8981\u6027"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>htmlspecialchars()<\/code> \u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3068\u52d5\u4f5c\u3092\u89e3\u8aac<\/li>\n\n\n\n<li>\u30b5\u30cb\u30bf\u30a4\u30ba\u3068\u30a8\u30b9\u30b1\u30fc\u30d7\u306e\u9055\u3044\u3092\u6574\u7406\u3057\u3001\u6df7\u540c\u3057\u3084\u3059\u3044\u30dd\u30a4\u30f3\u30c8\u3092\u660e\u78ba\u5316<\/li>\n\n\n\n<li>XSS\u5bfe\u7b56\u3068\u3057\u3066\u306e\u5b9f\u52d9\u7684\u306a\u9069\u7528\u5834\u9762\u3068\u6ce8\u610f\u70b9\u3092\u7d39\u4ecb<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">2. PHP\u306ehtmlspecialchars\u3068\u30b5\u30cb\u30bf\u30a4\u30ba\u51e6\u7406\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>PHP\u306b\u304a\u3051\u308b <code>htmlspecialchars()<\/code> \u306f\u3001HTML\u306b\u304a\u3044\u3066\u7279\u6b8a\u306a\u610f\u5473\u3092\u6301\u3064\u6587\u5b57\uff08\u4f8b\uff1a<code>&lt;<\/code>, <code>&gt;<\/code>, <code>&amp;<\/code>, <code>\"<\/code>, <code>'<\/code> \u306a\u3069\uff09\u3092\u5bfe\u5fdc\u3059\u308b HTML \u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u306b\u5909\u63db\u3059\u308b\u95a2\u6570\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30d6\u30e9\u30a6\u30b6\u306b\u3088\u308b\u610f\u56f3\u3057\u306a\u3044 HTML \u89e3\u91c8\u3092\u9632\u6b62\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u51e6\u7406\u306f\u3001\u4e3b\u306b XSS\uff08\u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30b9\u30af\u30ea\u30d7\u30c6\u30a3\u30f3\u30b0\uff09\u3068\u547c\u3070\u308c\u308b\u8106\u5f31\u6027\u306e\u5bfe\u7b56\u3068\u3057\u3066\u4f7f\u308f\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092 HTML \u306b\u57cb\u3081\u8fbc\u3080\u969b\u3001\u30a8\u30b9\u30b1\u30fc\u30d7\u51e6\u7406\u3092\u3057\u306a\u3044\u3068 <code>&lt;script&gt;<\/code> \u30bf\u30b0\u306a\u3069\u304c\u5b9f\u884c\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4e00\u65b9\u3067\u3001&#8221;\u30b5\u30cb\u30bf\u30a4\u30ba&#8221; \u3068\u306f\u300c\u5b89\u5168\u3067\u306a\u3044\u5165\u529b\u3092\u3001\u5b89\u5168\u306a\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u300d\u51e6\u7406\u306e\u7dcf\u79f0\u3067\u3059\u3002<code>htmlspecialchars()<\/code> \u306f\u305d\u306e\u4e00\u4f8b\u3067\u3042\u308a\u3001\u30b5\u30cb\u30bf\u30a4\u30ba\u306e\u4e00\u624b\u6bb5\u3067\u3059\u304c\u3001\u7528\u9014\u306b\u3088\u3063\u3066\u306f\u6b63\u898f\u8868\u73fe\u3084 <code>filter_var()<\/code> \u306a\u3069\u4ed6\u306e\u65b9\u6cd5\u3092\u4f75\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30b5\u30cb\u30bf\u30a4\u30ba\u3068\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306e\u9055\u3044\u3082\u91cd\u8981\u3067\u3059\u3002\u524d\u8005\u306f\u5165\u529b\u3092\u5b89\u5168\u306a\u5f62\u306b\u300c\u5909\u63db\u300d\u3059\u308b\u306e\u306b\u5bfe\u3057\u3001\u5f8c\u8005\u306f\u300c\u8a31\u53ef\u3059\u308b\u5024\u306e\u307f\u3092\u53d7\u3051\u5165\u308c\u308b\u300d\u5224\u5b9a\u51e6\u7406\u3067\u3059\u3002\u9069\u5207\u306a\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u306b\u306f\u3001\u4e21\u8005\u306e\u4f75\u7528\u304c\u6c42\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. \u8a73\u7d30\u89e3\u8aac<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092HTML\u306b\u5b89\u5168\u306b\u8868\u793a\u3057\u305f\u3044\u5834\u5408<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$user_input = '&lt;script>alert(\"XSS\")&lt;\/script>';\necho htmlspecialchars($user_input, ENT_QUOTES, 'UTF-8');\n\/\/ \u51fa\u529b\u7d50\u679c: &lt;script&gt;alert(&quot;XSS&quot;)&lt;\/script&gt;\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #9CDCFE\">$user_input<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&#39;&lt;script&gt;alert(&quot;XSS&quot;)&lt;\/script&gt;&#39;<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">htmlspecialchars<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">$user_input<\/span><span style=\"color: #D4D4D4\">, ENT_QUOTES, <\/span><span style=\"color: #CE9178\">&#39;UTF-8&#39;<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u51fa\u529b\u7d50\u679c: &lt;script&gt;alert(&quot;XSS&quot;)&lt;\/script&gt;<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><code>htmlspecialchars()<\/code> \u306f\u7b2c2\u5f15\u6570\u3067\u5909\u63db\u5bfe\u8c61\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<code>ENT_QUOTES<\/code> \u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u3068\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u306e\u4e21\u65b9\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u3067\u304d\u307e\u3059\u3002\u7b2c3\u5f15\u6570\u306b\u306f\u6587\u5b57\u30b3\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u3001UTF-8 \u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d5\u30a9\u30fc\u30e0\u306e\u518d\u8868\u793a\u306a\u3069\u3067\u3001\u5165\u529b\u5024\u3092\u305d\u306e\u307e\u307e\u57cb\u3081\u8fbc\u307f\u305f\u3044\u3068\u304d<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">HTML<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$input = '\u3053\u3093\u306b\u3061\u306f\"PHP\"';\n?>\n&lt;input type=\"text\" name=\"name\" value=\"&lt;?= htmlspecialchars($input, ENT_QUOTES, 'UTF-8') ?>\">\n&lt;?php\n\/\/ value\u5c5e\u6027\u306b\u5b89\u5168\u306b\u57cb\u3081\u8fbc\u307e\u308c\u308b\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D4D4D4\">$input = &#39;\u3053\u3093\u306b\u3061\u306f&quot;PHP&quot;&#39;;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">?&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #808080\">&lt;<\/span><span style=\"color: #569CD6\">input<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">type<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">&quot;text&quot;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">name<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">&quot;name&quot;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">value<\/span><span style=\"color: #D4D4D4\">=<\/span><span style=\"color: #CE9178\">&quot;<\/span><span style=\"color: #F44747\">&lt;<\/span><span style=\"color: #CE9178\">?= htmlspecialchars($input, ENT_QUOTES, &#39;UTF-8&#39;) ?&gt;&quot;<\/span><span style=\"color: #808080\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F44747\">&lt;<\/span><span style=\"color: #D4D4D4\">?php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">\/\/ value\u5c5e\u6027\u306b\u5b89\u5168\u306b\u57cb\u3081\u8fbc\u307e\u308c\u308b<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u30d5\u30a9\u30fc\u30e0\u306e\u518d\u8868\u793a\u3067\u306f\u3001HTML\u5c5e\u6027\u4e2d\u3067\u5b89\u5168\u306b\u51fa\u529b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<code>htmlspecialchars()<\/code> \u306b\u3088\u308b\u51e6\u7406\u306f\u5fc5\u9808\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">htmlspecialchars\u3068htmlentities\u306e\u9055\u3044<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>$str = '\u00a9 &amp; &lt; > \"';\necho htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n\/\/ \u2192 &copy; \u306f\u305d\u306e\u307e\u307e\u3001&amp; \u306f &amp; \u306b\u5909\u63db\n\necho htmlentities($str, ENT_QUOTES, 'UTF-8');\n\/\/ \u2192 &copy; \u3082 &amp;copy; \u306b\u5909\u63db\u3055\u308c\u308b\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #9CDCFE\">$str<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&#39;\u00a9 &amp; &lt; &gt; &quot;&#39;<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">htmlspecialchars<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">$str<\/span><span style=\"color: #D4D4D4\">, ENT_QUOTES, <\/span><span style=\"color: #CE9178\">&#39;UTF-8&#39;<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u2192 \u00a9 \u306f\u305d\u306e\u307e\u307e\u3001&amp; \u306f &amp; \u306b\u5909\u63db<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">echo<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">htmlentities<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">$str<\/span><span style=\"color: #D4D4D4\">, ENT_QUOTES, <\/span><span style=\"color: #CE9178\">&#39;UTF-8&#39;<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u2192 \u00a9 \u3082 &amp;copy; \u306b\u5909\u63db\u3055\u308c\u308b<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><code>htmlentities()<\/code> \u306f HTML \u306b\u5b58\u5728\u3059\u308b\u3059\u3079\u3066\u306e\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u306b\u5909\u63db\u3092\u8a66\u307f\u308b\u95a2\u6570\u3067\u3059\u3002\u901a\u5e38\u306e XSS \u5bfe\u7b56\u306b\u306f <code>htmlspecialchars()<\/code> \u3067\u5341\u5206\u3067\u3059\u304c\u3001\u3088\u308a\u53b3\u5bc6\u306a\u5909\u63db\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f <code>htmlentities()<\/code> \u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. \u3088\u304f\u3042\u308b\u30df\u30b9\u30fb\u8aa4\u89e3\u30fb\u843d\u3068\u3057\u7a74<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>htmlspecialchars()<\/code> \u3092\u4f7f\u308f\u305a\u306b\u76f4\u63a5\u51fa\u529b\u3059\u308b\u3068\u3001\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u304c\u305d\u306e\u307e\u307eHTML\u3068\u3057\u3066\u89e3\u91c8\u3055\u308c\u3001XSS\u306e\u539f\u56e0\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u30a8\u30b9\u30b1\u30fc\u30d7\u51e6\u7406\u3092\u3059\u3079\u304d\u5834\u6240\u3068\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3059\u3079\u304d\u5834\u6240\u3092\u6df7\u540c\u3059\u308b\u30b1\u30fc\u30b9\u3082\u591a\u304f\u898b\u3089\u308c\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u30a8\u30b9\u30b1\u30fc\u30d7\u51e6\u7406\u306e\u9069\u7528\u30bf\u30a4\u30df\u30f3\u30b0\u3092\u8aa4\u308b\u3068\u3001\u4fdd\u5b58\u3055\u308c\u308b\u30c7\u30fc\u30bf\u304c\u65e2\u306b\u5909\u63db\u6e08\u307f\u306b\u306a\u308a\u3001\u518d\u5229\u7528\u6642\u306b\u4e0d\u90fd\u5408\u304c\u751f\u3058\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\uff08\u4fdd\u5b58\u6642\u3067\u306f\u306a\u304f\u51fa\u529b\u6642\u306b\u51e6\u7406\u3059\u308b\u306e\u304c\u539f\u5247\uff09\u3002<\/li>\n\n\n\n<li>UTF-8\u4ee5\u5916\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u305f\u308a\u3001\u7121\u6307\u5b9a\u306e\u307e\u307e\u3060\u3068\u610f\u56f3\u3057\u306a\u3044\u5909\u63db\u7d50\u679c\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">5. \u307e\u3068\u3081<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>htmlspecialchars()<\/code> \u306fHTML\u51fa\u529b\u6642\u306eXSS\u5bfe\u7b56\u3068\u3057\u3066\u6709\u52b9\u306a\u624b\u6bb5<\/li>\n\n\n\n<li>\u51fa\u529b\u6642\u70b9\u3067\u306e\u30a8\u30b9\u30b1\u30fc\u30d7\u304c\u539f\u5247\u3067\u3001\u4fdd\u5b58\u6642\u306b\u306f\u51e6\u7406\u3092\u52a0\u3048\u306a\u3044\u306e\u304c\u671b\u307e\u3057\u3044<\/li>\n\n\n\n<li><code>ENT_QUOTES<\/code> \u3068 <code>UTF-8<\/code> \u3092\u660e\u793a\u3059\u308b\u3053\u3068\u3067\u5b89\u5168\u6027\u3092\u9ad8\u3081\u3089\u308c\u308b<\/li>\n\n\n\n<li>\u30b5\u30cb\u30bf\u30a4\u30ba\u30fb\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30a8\u30b9\u30b1\u30fc\u30d7\u306e\u9055\u3044\u3092\u7406\u89e3\u3057\u3001\u6b63\u3057\u304f\u4f7f\u3044\u5206\u3051\u308b\u3053\u3068\u304c\u91cd\u8981<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8 2. PHP\u306ehtmlspecialchars\u3068\u30b5\u30cb\u30bf\u30a4\u30ba\u51e6\u7406\u3068\u306f\uff1f PHP\u306b\u304a\u3051\u308b htmlspecialchars() \u306f\u3001HTML\u306b\u304a\u3044\u3066\u7279\u6b8a\u306a\u610f\u5473\u3092\u6301\u3064\u6587\u5b57\uff08\u4f8b\uff1a&lt;, &gt;, &#038; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":724,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[85],"tags":[],"class_list":["post-808","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=808"}],"version-history":[{"count":2,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/808\/revisions"}],"predecessor-version":[{"id":886,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/808\/revisions\/886"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/media\/724"}],"wp:attachment":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}