forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: hschnit on October 23, 2005, 09:07:51 am

Title: issues with xp_publish if not in http root.
Post by: hschnit on October 23, 2005, 09:07:51 am
Hey all,

I encountered some issues with xp_publish.php in the 1.4.1 dev version when the gallery is not installed in the root of the http server.
I saw in the file a bunch of location where the url is constructed this way: 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']
I don't know if it's my PHP version (4.3.10) or apache (2.0) but that didn't work for me.
if I replace by something like that all is ok: 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/' . $_SERVER['PHP_SELF']
Hope that helps...

Here is my full modifications in order to make xp_publish.php work for me (cvs diff):
# cvs diff xp_publish.php
Index: xp_publish.php
===================================================================
RCS file: /cvsroot/coppermine/devel/xp_publish.php,v
retrieving revision 1.30
diff -r1.30 xp_publish.php
464c464
<                 postTag.setAttribute('href', '<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?cmd=add_picture'?>&amp;album=' + selform.album.value);
---
>                 postTag.setAttribute('href', '<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/' . $_SERVER['PHP_SELF'] . '?cmd=add_picture&album='?>' + selform.album.value);
478c478
<         htmluiTag.text = '<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/'?>';
---
>         htmluiTag.text = '<?php echo 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/'?>';
528c528
<     $lines[] = '"href"="' . "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?cmd=publish"';
---
>     $lines[] = '"href"="' . $_SERVER['HTTP_REFERER'] . '?cmd=publish"';
632c632
<             '{POST_ACTION}' => $_SERVER['PHP_SELF'] . '?cmd=create_album',
---
>             '{POST_ACTION}' => dirname($_SERVER['REQUEST_URI']) . '/' .  $_SERVER['PHP_SELF'] . '?cmd=create_album',
652c652
<             '{POST_ACTION}' => $_SERVER['PHP_SELF'] . '?cmd=create_album',
---
>             '{POST_ACTION}' => dirname($_SERVER['REQUEST_URI']) . '/' .  $_SERVER['PHP_SELF'] . '?cmd=create_album',
895c895
< ?>
\ No newline at end of file
---
> ?>



--Herve.

Title: Re: issues with xp_publish if not in http root.
Post by: toreS on October 23, 2005, 12:17:51 pm
Confrimed - it now works on my set-up:
Apache/1.3.33
php 4.4.0
Mysql 4.0.24
Gallery is not stored in root.
Fixes two problems:
- it generates the correct reg file
- the upload actually works

Tested upload into existing gallery and creation of new gallery.

Fantastic!!
 :D
Title: Re: issues with xp_publish if not in http root.
Post by: Joachim Müller on October 23, 2005, 02:57:08 pm
Could a dev who actually has WinXP look into this issue please?
Title: Re: issues with xp_publish if not in http root.
Post by: Nibbler on November 20, 2005, 10:41:05 pm
Committed fixes similar to those suggested above, please test and report back.
Title: Re: issues with xp_publish if not in http root.
Post by: kjpuck on November 22, 2005, 02:22:11 am
Now I can login and create albums, but it doesnt upload pictures. I get no error message.
Title: Re: issues with xp_publish if not in http root.
Post by: Joachim Müller on November 22, 2005, 06:53:51 am
not a valid testing report. You appear to be looking for support, although cpg1.4.x currently goes unsupported.
Title: Re: issues with xp_publish if not in http root.
Post by: Joachim Müller on August 10, 2006, 08:21:18 am
No reports - issue appear to have been fixed. Marking thread accordingly.