Posts: 22
Threads: 3
Joined: Aug 2011
Hey all.
I'm using GetSimple now for several years and I find it really easy to use. But when I wanted to upgrade my version of GetSimple (3.0) to the newest 3.3.1, I experienced some problems. There were some issues with the caching methods namely the following error:
Quote:Warning: SimpleXMLElement::addChild(): unterminated entity reference -restaurant in /home/wa/domains/wa.nl/public_html/admin/inc/caching_functions.php on line 286
After some searching on the internet I found out that the addChild method had some problems were it wouldn't escape the characters:
http://stackoverflow.com/a/17028414. So after changing the line 286 from:
PHP Code:
$pages->addChild('url', $id);
To the following lines:
PHP Code:
$pages->addChild('url');
$pages->url = $id;
Maybe it can help someone else or maybe it can be implemented in the core code.[/php]
Posts: 6,266
Threads: 181
Joined: Sep 2011
are you using simplexmlextended ?
show your code, what were you adding ? Whats the string ?
oh i see now, this is php and addchild issue
very odd
but you say this changed after upgrading? I dont recall changing anything in there.
https://github.com/GetSimpleCMS/GetSimpleCMS/issues/782
Posts: 22
Threads: 3
Joined: Aug 2011
This is purely the GetSimple core (3.3.1) and the only changes I made are the above. So what do you want me to show exactly?
Posts: 6,266
Threads: 181
Joined: Sep 2011
Do you know how to reproduce, you have a slug or something with a & in it ?
I just realized you upgraded from 3.0, so yeah there is no telling what changed there.
Ill probably fix this in 3.3.2 soon, Ii can't imagine it breaking anything.
Posts: 22
Threads: 3
Joined: Aug 2011
2014-03-16, 04:59:50
(This post was last modified: 2014-03-16, 05:00:22 by pchulpleusden.)
Probably it has something to do with special chars indeed. I probably have some slug with special chars in it, because the website is partly Asian.
It's no problem for me anymore, but I thought maybe I can help someone else with it.
The Stackoverflow link also is pointing to the special chars, because of it not escaping:
http://www.php.net/manual/en/simplexmlel...php#112204. By the way, there were also some problems with the template_functions.php file, were the same error had come up. But I unfortunately forgot to note the line numbers, but I think it's some where between line 1000 and 1200 where the sitemap is created. Hopefully it helps a bit.
By the way I must say I also changed servers (and PHP-versions), so maybe it has something to do with that as well. The old version was PHP 5.3.8 and the new version is PHP 5.3.17.
Posts: 6,266
Threads: 181
Joined: Sep 2011
I think I found the problem here.
Page cache contains the url twice, one not as cdata.
Code:
<item>
<url>admin-1</url>
<pubDate><![CDATA[Wed, 12 Mar 2014 12:53:04 -0500]]></pubDate>
<title><![CDATA[admin]]></title>
<url><![CDATA[admin-1]]></url>
<meta><![CDATA[]]></meta>
<metad><![CDATA[]]></metad>
<menu><![CDATA[admin]]></menu>
<menuStatus><![CDATA[]]></menuStatus>
<template><![CDATA[template.php]]></template>
<parent><![CDATA[]]></parent>
<private><![CDATA[]]></private>
<author><![CDATA[user]]></author>
<creDate><![CDATA[Wed, 12 Mar 2014 12:52:54 -0500]]></creDate>
<user><![CDATA[user]]></user>
<menuOrder><![CDATA[1]]></menuOrder>
<slug><![CDATA[admin-1]]></slug>
<filename><![CDATA[admin-1.xml]]></filename>
</item>
Now to figure out is this is new, or when it was introduced.
Posts: 6,266
Threads: 181
Joined: Sep 2011
new issue replaced this one
https://github.com/GetSimpleCMS/GetSimpleCMS/issues/784
I imagine this should fix the issue, or rather make it invalid.
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2014-03-18, 00:43:59)shawn_a Wrote: Now to figure out is this is new, or when it was introduced.
:-o
Not new, since 3.1
This commit:
https://github.com/GetSimpleCMS/GetSimpl...0ba8c43b6e