UseBB Community

The official board for UseBB help and discussion

UseBB Community » Bug Reports » [FIXED] Undefined index: PATH_TRANSLATED / SCRIPT_FILENAME

[FIXED] Undefined index: PATH_TRANSLATED / SCRIPT_FILENAME

Page: 1

Author Post
Member
Registered: Apr 2004
Posts: 1
Hello,

I justed installed UseBB as a test on my localhost. I wanted to test the ACP upload module. But it failed. I got the following error:


In file admin_modules.php on line 92:

E_NOTICE - Undefined index: PATH_TRANSLATED

I opened the file and I saw that UseBB was trying to use the variable $_SERVER['PATH_TRANSLATED'];. I opened phpinfo(); on my localhost and I saw no $_SERVER['PATH_TRANSLATED']; there. I started to look for an alternative and I found $_SERVER['SCRIPT_FILENAME'];. That worked like a charm :). So the bugfix is:

1. open <UseBB-path>/sources/admin_modules.php
2. Change line 92 from
if ( copy($acp_module['tmp_name'], dirname($_SERVER['PATH_TRANSLATED']).'/sources/modules/'.$acp_module['name']) )

to
if ( copy($acp_module['tmp_name'], dirname($_SERVER['SCRIPT_FILENAME']).'/sources/modules/'.$acp_module['name']) )

3. save the file
4. done. You can upload ACP modules again

I had this problem on a server with the following specifications:
UseBB 1.0.3
PHP 5.1.6-pl8-gentoo
MySQL 5.0.26
Apache 2.0.59-r1
Gentoo Linux, kernel 2.6.18-gentoo-r1

I hope this helps somebody :)
« Last edit by Dietrich on Sun Mar 11, 2007 11:27 pm. »
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
Fixed in CVS. Thanks for reporting.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Nov 2006
Posts: 3
I host UseBB on a Windows 2003 server with PHP4. After the fixing, now I must change it back to
if ( copy($acp_module['tmp_name'], dirname($_SERVER['PATH_TRANSLATED']).'/sources/modules/'.$acp_module['name']) )
because I get an error on the same line after the fixing. So it depends on the configuration of PHP on the server which one must used.
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
Could you download and test the following file on your setup? Thanks.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Nov 2006
Posts: 3
I have test the file on my setup and now it works fine (without changing anything) for me. Thanks a lot.
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
Marking as fixed again, the code should work on all PHP 4.1+ versions. :)
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog

Page: 1

UseBB Community » Bug Reports » [FIXED] Undefined index: PATH_TRANSLATED / SCRIPT_FILENAME

UseBB Community is powered by UseBB 1 Forum Software