Piwigo.org

You are not logged in. (Register / Login)

Announcement

#1 2010-10-04 19:52:52

PhotoPeter
Guest

Options for "Photo properties" are stored incorrectly.

Hi,

just a post for people who run into the same problem:

I had the problem, that the settings for "Photo properties" in the "Display" tab in "Configuration" -> "Options" were not stored. When I changed them, I got the message, that the changes were saved and an error message, about an error in line 360 of the admin/configuration.php that told me, the deserialization did not work.

So I looked at the database and found a string with a lot of slashes.

The problem was: In line 171 in the admin/configuration.php the values are stored with slashes ("addslashes(...)") in line 360 of the same file, no slashes are expected (and neither are they in the picture view.)
So I changed the line from:

      $_POST['picture_informations'] = addslashes(serialize($_POST['picture_informations']));

to:

      $_POST['picture_informations'] = serialize($_POST['picture_informations']);

And everything works now.

I'm not sure if the addslashes was necessary in the first place. But be careful with this.

#2 2010-10-08 01:07:07

plg
Piwigo Team
Location: Paris, France, Europe
Registered: 2002-04-05
Posts: 11714
Website

Re: Options for "Photo properties" are stored incorrectly.

Thank you for reporting the issue PhotoPeter.

I wonder why you have the problem. As fas as I know, you're the first to have this problem.

If you revert to the standard code, do you reproduce the bug?


Latest blog post on Piwigo.com: Piwigo 2.5 on Piwigo.com (March 7th, 2013)

Offline

#3 2011-06-18 16:56:19

PhotoPeter
Guest

Re: Options for "Photo properties" are stored incorrectly.

Hi,

I'm sorry for my late response.

I deinstalled piwigo a while ago and reinstalled it yesterday. The issue appeared again. And I could solve it with the same change in the code.

A few informations about my setup may help tracking the bug down:
Piwigo 2.2.3
lighttpd/1.4.28
PHP 5.3.5-1ubuntu7.2
sqlite 2.8.17

Maybe it's an issue with sqlite?

#4 2011-06-19 16:35:03

Scumpeter
Member
Registered: 1970-01-01
Posts: 3

Re: Options for "Photo properties" are stored incorrectly.

I just realised, I have the same problem with the menu. When I changed the order and saved it it had no effect. So I removed the addslashes from line 146 in admin/menubar.php and now it works.

Heres the diff:

Code:

146c146
<   SET value=\''.addslashes(serialize($mb_conf_db)).'\'
---
>   SET value=\''.serialize($mb_conf_db).'\'

p.s.: I'm PhotoPeter. I just finnaly made an account.

Offline

#5 2011-06-20 13:00:23

flop25
Piwigo Team
Registered: 1970-01-01
Posts: 3369
Website

Re: Options for "Photo properties" are stored incorrectly.

maybe it's the same problem as here : [Forum, post 122155 by flop25 in topic 17563] [sqlite] Theme activation on 2.2.1 fails
Can you replace and tell us if it's working ?

Btw can you post an entry in the bugtracker please ? http://piwigo.org/bugs thx


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

#6 2011-06-20 15:25:41

Scumpeter
Member
Registered: 1970-01-01
Posts: 3

Re: Options for "Photo properties" are stored incorrectly.

Yep. Seems to be the same problem. Using pwg_db_real_escape_string() seems to work.

Here's the bug report: http://piwigo.org/bugs/view.php?id=2355

Offline

#7 2011-06-20 15:59:01

flop25
Piwigo Team
Registered: 1970-01-01
Posts: 3369
Website

Re: Options for "Photo properties" are stored incorrectly.

thx a lot !


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

Board footer

Powered by FluxBB

About this website · Donate · Contact Piwigo project © 2002-2013