Quote from: matthewdawkins at Dec 05, 2008, 05:43 AM
I’ve had a look around, and it looks like this function is being called a lot, i.e. every time something is outputted to the page. This seems like overkill to me - surely we only need to check for and remove those illegal characters when they’re being added? Clearly I can’t just remove the :htmlent PHx bit from all the templates, because those illegal characters are stored in the database. Is there a way of doing the htmlentities bit when we’re adding the title and description to the db instead, so we only have to do it once?
Yes, you could put it in the code where MaxiGallery put’s data to the database. But I cannot force it to do that, because some may want html content in the database and shown in frontend. If you use cached snippet call in your maxigallery installation, it’s not a problem even if htmlentities is called for each text output. But yes, I haven’t spent much time in optimizing MaxiGallery and I suggest to always use cached output for that reason. Of course with some display types, you cannot use caching (normal display mode or with paging).
But the root problem that you are having is that why PHx :htmlent modifier stopped working. And that’s probably because when you updated to new MODx version, you updated your Ditto version too and the PHx in that doesn’t work for you. You might want to try and install PHx as a plugin, so the versions from different components are not used and see where that gets you. Some plugin version should work for you if it has been working previously.
It could be also that your server provider updated PHP version and that made this happen. I’m not also sure if $modx->config[’etomite_charset’] is valid any more, you might want to change it to
I’m betting that if you change the line in assets/snippets/ditto/classes/phx.parser.class.inc.php:
$output = htmlentities($output,ENT_QUOTES,$modx->config[’etomite_charset’]); break;
to some of these, it’ll work (start from the top):
$output = htmlentities($output,ENT_QUOTES,$modx->config[’modx_charset’]); break;
$output = htmlentities($output,ENT_QUOTES,’UTF-8’); break;
$output = htmlentities($output,ENT_QUOTES); break;
$output = htmlentities($output); break;