Search code examples
escapingseometa-tagszend-framework3canonical-link

Zend Framework 3 - Meta tags weirdly escaped - impact on canonical url?


I got the following source code generated by Zend Framework 3 HeadMeta view helper:

<meta http-equiv="X-UA-Compatible" content="IE&#x3D;edge">

Example code: <?php echo $this->headMeta()->appendHttpEquiv('X-UA-Compatible', 'IE=edge'); ?>.

Happens also with links using HeadLink view helper:

<link href="&#x2F;vendor&#x2F;flag-icon-css&#x2F;css&#x2F;flag-icon.min.css" media="screen" rel="stylesheet" type="text&#x2F;css">
<link href="&#x2F;vendor&#x2F;bootstrap-select&#x2F;dist&#x2F;css&#x2F;bootstrap-select.min.css" media="screen" rel="stylesheet" type="text&#x2F;css">
<link href="&#x2F;artist&#x2F;franz-ackermann" rel="canonical">

Example code: <?php echo $this->headLink()->appendStylesheet('/css/styles.css', 'all'); ?>.

Why the meta tags are escaped in that extreme way? I compared with other pages such as wikipedia and noticed that they are using just plain readable characters (not the unicode pendants for slashes, equal-signs etc.).

How can I turn it off? Does the escaping of the canonical url has an impact in how the urls are getting processed / display by Google? Or does Google understand the escaped variants?


Solution

  • The view helper uses escapeAttribute() helper to escape output.

    Might look a little odd to read but will work just fine.