On my web hosting with

open_basedir (set to my homedir)
safe_mode On
safe_mode_gid On

i had problem with configure garland theme into new colors. I have get numerous errors related with mkdir() and copy() files.
I have examine this problem and i get this solution:

In color.module is on line 214

  $paths['target'] = $paths['color'] .'/'. $id .'/';

On my hosting function mkdir() don't allow this but if i change

  $paths['target'] = $paths['color'] .'/'. $id;

mkdir() work with no problem.

There is $paths['target'] used too in some more lines - i moddified this lines with $paths['target'] . '/' and now works color.module without problem.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

havran’s picture

Status: Needs work » Needs review
FileSize
2.1 KB

Patch attached.

Steven’s picture

Status: Needs review » Needs work

Or you could just add the slash to the target path after doing the mkdir. That way, you avoid inserting slashes everywhere. Also, the code style is bad.

havran’s picture

Status: Needs work » Needs review
FileSize
1 KB

Ok, i have attached modified patch.

havran’s picture

Status: Needs review » Reviewed & tested by the community

Please get some attention for this simple task. :) I had downloaded latest version of Drupal 5 (dev) and this error is still here. This simple patch working.

Dries’s picture

Code looks good now but I can't reproduce the problem. Maybe someone else can test this patch?

havran’s picture

Maybe is problem in my webhosting specific PHP and/or Apache configuration. Simple example - mkdir('some/new/directory/') for some reason don't working, do not create directory and i get errors - mkdir('some/new/directory') working perfect.

havran’s picture

After some searching on Google

http://www.google.com/search?q=php+mkdir+trailing+slash+problem&ie=utf-8...

Maybe i have source of this problem, my provider has modified PHP

This server is protected with the Suhosin Patch 0.9.5
Copyright (c) 2006 Hardened-PHP Project

But I think use no trailing slash in mkdir() is not bad idea.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Looks like this was committed.

drumm’s picture

Status: Fixed » Reviewed & tested by the community

No, it hasn't, I just confused myself.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Doesn't hurt anything by being there, code style is good, and it fixes some versions of PHP. COmmitted to HEAD.

havran’s picture

Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)
dkatzman’s picture

Version: 5.0-beta1 » 5.0
Priority: Normal » Critical
Status: Closed (fixed) » Active

This SAFE MODE THING is so frustrating guys... After MONTHS noone has come up with a usable (by all) unswer to this and the derived problems (like changing colors to Garland)?

I tried the fix here but the code in my color.module was already identical to the fix you propose... Guess I have an updated version...

Any new ideas? Thanks in advance!

D. KATZMAN, MBA
CEO, The Mythos Group
# www.secretia.com
# www.unmentor.com
# www.mythos.es
# www.jewishculturela.org
# www.profesorblog.com
# www.drbolsa.com
# www.certifik.org

Heine’s picture

Version: 5.0 » 5.0-beta1
Priority: Critical » Normal
Status: Active » Closed (fixed)

Please open a new issue about your problem. And please, cut back on the signature.