Backslash problem with xataface on windows?
Archived from the Xataface Users forum.
sophistry — Tue Mar 31, 2009 10:37 am
I’m having an issue where xataface is inserting “\/” or “\/\/” in the address string when running on an XP machine with MySQL 5.0.5, and xampp/apache.
Example:
http://localhost/\/index.php?-table=My_Table
http://localhost/\/\/index.php?-table=My_Table&-action=browse&-cursor=0&-skip=0&-limit=30&-mode=list
I don’t have an issue when loading other pages locally, just the xataface files. It fails to load, but if I take out the “\/\/”, it works fine (until I try to follow another link). Has anyone else experienced this and found a solution?
I checked my httpd.conf and index.php/conf.ini, but didn’t see any path problems or out-of-place 's. I’m pretty sure this is some kind of conversion problem in xataface, but I can’t figure out where.
Thanks,
Rory
sophistry — Thu Apr 02, 2009 7:58 am
For anyone having a similar problem, I finally found an old post with a fix in it…
In your init.php, replace the following line:
define(‘DATAFACE_SITE_URL’, $temp_site_url);
with this line:
define(‘DATAFACE_SITE_URL’, str_replace( ‘\’, ‘/’, dirname($_SERVER[‘PHP_SELF’])));
… which, in effect, will force all backslashes to become forward slashes in the URL.