issues with xp_publish if not in http root. issues with xp_publish if not in http root.
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

issues with xp_publish if not in http root.

Started by hschnit, October 23, 2005, 09:07:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hschnit

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.


toreS

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

Joachim Müller

Could a dev who actually has WinXP look into this issue please?

Nibbler

Committed fixes similar to those suggested above, please test and report back.

kjpuck

Now I can login and create albums, but it doesnt upload pictures. I get no error message.

Joachim Müller

not a valid testing report. You appear to be looking for support, although cpg1.4.x currently goes unsupported.

Joachim Müller

No reports - issue appear to have been fixed. Marking thread accordingly.