<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>rui_hi</author_name>
  <author_url>https://blog.hatena.ne.jp/rui_hi/</author_url>
  <blog_title>Opensource days</blog_title>
  <blog_url>https://rui-hi.hatenadiary.org/</blog_url>
  <categories>
    <anon>PHP</anon>
  </categories>
  <description>PHP 5.4 beta 2が出ているところですが、ソースコード(html.c)を見ていて、XSS対策で使用される htmlspecialchars()の文字コード指定がPHP 5.3とは異なる動作をすることに気が付きました。内部文字コード(mbstring.internal_encoding)が使用される以下のようなシチュエーションです。 &lt;?php // test.php echo htmlspecialchars(&quot;foo&quot;,ENT_QUOTES,&quot;&quot;); mbstring.internal_encoding=&quot;SJIS-win&quot;と指定することにします。(推奨はできませんが、)外字対応（…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Frui-hi.hatenadiary.org%2Fentry%2F20111105%2F1320455951&quot; title=&quot;PHP 5.4におけるhtmlspecialchars()の問題 - Opensource days&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2011-11-05 10:19:11</published>
  <title>PHP 5.4におけるhtmlspecialchars()の問題</title>
  <type>rich</type>
  <url>https://rui-hi.hatenadiary.org/entry/20111105/1320455951</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
