Aldian Aldian - 1 month ago 5
PHP Question

Why is this html code not correctly interpreted?

I am a bit curious about this HTML code (Firebug's view):

<td>1&#8211;1 of 1 record found matching your query (<a href="rss.php?where=title%20RLIKE%20%22physics%22" title="track newly added records matching your current query by subscribing to this RSS feed">RSS</a>&nbsp;|&nbsp;<a href="query_history.php" title="recall a previous query from your current session">history</a>):</td>


I was trying to install refbase. I used the snapshot version because of SQL problems with the current release. While testing I got this view (Firebug console is opened on purpose to show how the code is interpreted, but I see the same on chromium for instance):

.

view with code not interpreted correctly

.

Then I clicked in the firebug view and added a single
space
character somewhere, and did escape to let it as it was. But after having added the
space
, the view changed into this:

.

enter image description here

.

So basically I changed nothing but the code is now correctly interpreted. That's really weird. I googled a bit about this, but I think I might not have found the appropriate keywords.

Could someone explain me the reason behind this weird behaviour and how to fix it? BTW this Here is the complete php source producing this page. Look on line 796.

EDIT:
Thanks to LGSon I noticed that it is a Firebug's trap: it interprets the
&amp;
stuff to show nice html code and then when you edit-it, it becomes the real code. That's tricky indeed, but when checking page source you can see the real HTML:

<td>1&amp;#8211;1 of 1 record found matching your query (&lt;a href=&quot;rss.php?where=title%20RLIKE%20%22physics%22&quot; title=&quot;track newly added records matching your current query by subscribing to this RSS feed&quot;&gt;RSS&lt;/a&gt;&amp;nbsp;|&amp;nbsp;&lt;a href=&quot;query_history.php&quot; title=&quot;recall a previous query from your current session&quot;&gt;history&lt;/a&gt;):</td>

Answer

It should be 1&#8211;1

Sample

1&#8211;1