strtr array replace issue...

[email protected] (Brad Freshour)
Newsgroups php.install
Message-ID <[email protected]>
Apache: 2.2.8 threaded
PHP: 5.2.4-2
mySQL: 5.051.a

Ubuntu 8.04 minimal with everything needed installed via apt-get.

Using SMF forum, I'm having an issue with the strtr command...  Here's
the code...

$ftp_file = strtr($filename, array ($_SESSION['pack_ftp']['root'] =>''));

The $_SESSION['pack_ftp']['root'] variable is an empty set: ''

Well, if the above strtr command was translated it would look like this:

strtr("/home/user/public_html/Packages/temp", array ('' =>''));

You would think that the return would be : /home/user/public_html/Packages/temp

However, it returns '' instead.

I can get around this by modifying the code to the site manually and
checking to see if $_SESSION['pack_ftp']['root'] == '' and if it does
assign it something crazy, like $_SESSION['pack_ftp']['root'] =
'%%%%%'

However, the code works on another site I have that's hosted for me
(shared hosting).

Anyone have any ideas?

I was wondering if it was related to this: http://bugs.php.net/bug.php?id=27457
But that seems like an old bug...

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.