Jump to content

Cubecart has wrong paths / instead of \


Guest GeeZuZz

Recommended Posts

Guest estelle

GeeZuZz.

Excuse various people's rant about windows servers. Nerds just can't resist a rant about Win vs Linux :)

Yes it appears there are some problems in browse.inc.php (ie. when adding a product or category - Browse Existing Images). I noticed this before but thought it might be because I am running PHP 5, which did create various warning/error messages in Admin.

I can't offer a solution, and I don't actually use this feature myself. But if you do figure out a solution please post it.

theorbo -- the function isn't missing. Its a standard PHP library function. The parameter that is being passed to the function is obviously dodgy. The code does various find and replaces of forward slashes, i.e. for unix, but obviously this particular piece of code is only designed to work on Linux.

Link to comment
Share on other sites

Guest theorbo

The thing I find most interesting is that I don't have "wamp" installed - which is a recognized variant of the "apache on windows" setup. I have xampp, also a recognized variant - not completely different but still not exactly the same as wamp.

I would suppose there's a setting in httpd.conf which needs tweaking. I'll have a look tomorrow after I get home from town (80 mile round trip, plus time for shopping - takes a while....)

If I figure something out, I'll post back....

Link to comment
Share on other sites

Guest estelle

You've been very helpful sunshine, I have noticed you all around the forum. The forums wouldn't work without people like you ;)

theorbo - I'm also running xampp. I haven't heard of wamp and don't know why it should make a difference, because I think either way if its running on Windows this particular part of the code isn't going to work. Because it does some processing of the root path based on forward slashes, but theres no handling for Windows backslashes.

Link to comment
Share on other sites

Guest theorbo

wamp is another version of the "let's run apache on windows" stuff. I had it first, but it's pretty iffy about how you install mySQL and phpMyAdmin to mesh with it, and I migrated to xampp on the advice of people on the WordPress support forum. Since I think xampp is maybe a fork of wamp, it's probably a holdover....

Only problem with "fixing" it for the local setup is that if you screw with it so it works okay locally, you run the risk of forgetting not to upload the "works locally" file and so screwing up the online setup. I probably won't mess with it myself - I don't use the local browse function anyway - vide my not knowing that it even popped that error!

Thanks for the info, estelle.

Link to comment
Share on other sites

Guest estelle

Thanks ;). Hmm, well I don't use it either, haha! I could be wrong, but I do think its a problem in the code, rather than a xampp/wamp configuration issue. So if anyone uses it and wants it fixed, feel free to log a Bug Report ;)

Link to comment
Share on other sites

  • 3 weeks later...
Guest consolegamer

For Windows users having trouble with browse.php, two simple changes need to be made to allow the paths to work.

// this code was originally trying to strip the path

// a simple change to find the last '/' accomplishes this for Windows paths

//$file = preg_replace("#//+#", '/', $file);

$file = substr($file, strpos($file, '/') + 1);

// this code was trying to find the above path

// again, a simple change to just set it for Windows

//$IMAGES_BASE_DIR = preg_replace("#//+#", '/', $GLOBALS['rootDir']."/images/uploads/");

$IMAGES_BASE_DIR = $GLOBALS['rootDir']."\\images\\uploads\\";

//$file = preg_replace("#$IMAGES_BASE_DIR#", '', $file);

As always, your mileage may vary, but it fixed my issues with browse.php. Now, I'm able to view images as I think it was intended.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...