implode error updating photo description implode error updating photo description
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

implode error updating photo description

Started by gtgillis, March 21, 2012, 10:48:24 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

gtgillis

While viewing any photo I click on "Edit File Information" below the photo to show the edit form. When I try to add text to a photo description I get the following error.

An error has occurred:

(This text is only displayed to users in the group 'Root')

2 - implode(): Invalid arguments passed @ /var/www/coppermine/edit_one_pic.php line 116


I am running 1.5.18.

Joe Carver

That line is looking at keywords.
    $keywords = implode($CONFIG['keyword_separator'], $keywords_new);

I could not reproduce the effect.
Remove / change the keywords.
Look at interference from plugins and your theme.
Otherwise post a link to your Coppermine so someone can take a look.

Αndré

What's your keyword separator setting?
What have you entered in the keywords field? Have you entered anything at all?

gtgillis

Quote from: Joe Carver on March 22, 2012, 02:08:27 AM
That line is looking at keywords.
    $keywords = implode($CONFIG['keyword_separator'], $keywords_new);

I could not reproduce the effect.
Remove / change the keywords.
Look at interference from plugins and your theme.
Otherwise post a link to your Coppermine so someone can take a look.

I was only entering text in the description. I did not use keywords when I got the error. Oddly, when I enter a keyword and a description it saves just fine. I'll keep looking.

gtgillis

Quote from: Αndré on March 22, 2012, 09:54:10 AM
What's your keyword separator setting?
What have you entered in the keywords field? Have you entered anything at all?

I have Enable clickable keywords in search checked and Keyword separator set to space.

Αndré

Works as expected for me with that settings. I assume it's a server-sided issue, but we can try to fix it anyway.

Please open edit_one_pic.php, find
$keywords = explode($CONFIG['keyword_separator'], trim(html_entity_decode($keywords)));
and below, add
$keywords_new = array();

Please report if it works as expected for you.

gtgillis

Quote from: Αndré on March 22, 2012, 03:23:26 PM
Works as expected for me with that settings. I assume it's a server-sided issue, but we can try to fix it anyway.

Please open edit_one_pic.php, find
$keywords = explode($CONFIG['keyword_separator'], trim(html_entity_decode($keywords)));
and below, add
$keywords_new = array();

Please report if it works as expected for you.

That fixed it! Thanks.
Now I guess the question is why did this work?

Αndré

The function implode expects an array as second parameter. If you haven't entered a keyword, $keywords_new is undefined. With the new line we define $keywords_new as array regardless if keywords have been submitted or not.

However, this is the first time for me that PHP behaves like that (the error message is not from Coppermine by the way).

gtgillis

Quote from: Αndré on March 22, 2012, 03:48:21 PM
The function implode expects an array as second parameter. If you haven't entered a keyword, $keywords_new is undefined. With the new line we define $keywords_new as array regardless if keywords have been submitted or not.

However, this is the first time for me that PHP behaves like that (the error message is not from Coppermine by the way).

I am using PHP version 5.3.6-13ubuntu3.6.

I am marking this as solved. Thanks again.

Αndré