a user pointed out a problem with URLs to his CMSimple site posted on Facebook. If he wants to post e.g. the URL http://www.example.com/?page/subpage Facebook replaces this by http://www.example.com/?page%2Fsubpage, but this link gives a "404: Not found".
On Wikipedia it is explained, that:
This holds for the commonly used uri_seperators ":" and "/", and probably also for all other reasonable uri_seperators (as otherwise clashes with page titles could be expected).Reserved characters that have no reserved purpose in a particular context may also be percent-encoded but are not semantically different from those that are not.
So IMO it's up to CMSimple to cater for URLs that have url-encoded those uri_separators. AFAIK technically this could be done by a rewrite rule (e.g. by mod_rewrite) or in CMSimple's source code, the latter being more generally useful and more convenient, as the actual uri_seperator is known. This can be done in /cmsimple/cms.php around line 130 (might depend on the actual version), by inserting:
Code: Select all
$su = substr($su, 0, $cf['uri']['length']); // after this line
$su = preg_replace('/'.urlencode($cf['uri']['seperator']).'/iU', $cf['uri']['seperator'], $su); // insert this one
If anybody sees problems with this approach, or even does have a better way to solve the issue, I'm looking forward to read about it.
Christoph