🕸📝Fergus Duniho wrote on Tue, Jul 3, 2018 09:39 PM UTC:
I temporarily altered taginfo.php to test some things, and I found out that even if I have it print $_REQUEST or $_GET as the very first thing it does, it has already converted the %2B to a space. An additional urlencode will not help, because the problem is that "chess%2Bcompounds" has already become "chess compounds". It must be that the apache RewriteRule command, which is used to create the semantic URL in .htaccess does URL decoding on its input. What works is to replace %2B with %252B. %25 is the code for the % sign, so that this converts to %2B, which will then convert to +. What fixed this is to use str_replace() on the output of urlencode(), like so:
I temporarily altered taginfo.php to test some things, and I found out that even if I have it print $_REQUEST or $_GET as the very first thing it does, it has already converted the %2B to a space. An additional urlencode will not help, because the problem is that "chess%2Bcompounds" has already become "chess compounds". It must be that the apache RewriteRule command, which is used to create the semantic URL in .htaccess does URL decoding on its input. What works is to replace %2B with %252B. %25 is the code for the % sign, so that this converts to %2B, which will then convert to +. What fixed this is to use str_replace() on the output of urlencode(), like so:
str_replace("%2B", "%252B", urlencode($key))