forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: Andi on December 12, 2004, 02:46:00 pm

Title: problem in search.inc.php
Post by: Andi on December 12, 2004, 02:46:00 pm
Hi :)

search.inc.php,v 1.12 2004/12/08 19:19:03 nibbler999 Exp

By clicking in the keywordmanager on one of the keywords in keywordlist, the following error occurs:
Quote
Fatal error: Cannot use string offset as an array in D:\Localhost\dev-Coppermine\vkpmx\vkpmx\html\modules\Gallery\include\search.inc.php on line 47

I've change this code from:
Code: [Select]
............
$type = " {$_POST['type']} ";

$_POST['params']['pic_hdr_ip']  = $_POST['params']['pic_raw_ip'];

if ($search_string && isset($_POST['params'])) {
$sql = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE ";
$split_search = explode(' ', $search_string);
..........

to this:
Code: [Select]
.....
$type = " {$_POST['type']} ";

if ($search_string && isset($_POST['params'])) {
$_POST['params']['pic_hdr_ip']  = $_POST['params']['pic_raw_ip'];
$sql = "SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE ";
$split_search = explode(' ', $search_string);
......

and it's ok.... ;)
Title: Re: problem in search.inc.php
Post by: Nibbler on December 13, 2004, 02:29:14 pm
The keywords system is not compatible with the new search yet.

Edit: should now work as of thumbnails.php v1.23
Title: Re: problem in search.inc.php
Post by: Joachim Müller on December 14, 2004, 07:44:54 am
fix confirmed.

Joachim
Title: Re: changing search form method from "get" to "post"
Post by: Joachim Müller on December 17, 2004, 08:57:17 am
@Nibbler: is there any particular reason (possible security related) to change the search form method from get to post in your advanced search form for cpg1.4.x? I used to post links on my board to URLs that contained a search query (e.g. http://www.mydomain.tld/coppermine/thumbnails.php?album=search&type=full&search=foo+bar) quite often - I find this very helpfull, as I use the keywords to describe who is on the pics. Could the form method be switched back to "get" if there are no security related issues?

Joachim
Title: Re: problem in search.inc.php
Post by: Nibbler on December 17, 2004, 11:05:08 am
It should still work with get requests, I just find posts are neater, especially with the increased amount of options being used. The url you posted works on my test gallery, do you get an error with that ?
Title: Re: problem in search.inc.php
Post by: Joachim Müller on December 17, 2004, 06:19:48 pm
No, the url works fine for me as well - it's just that others won't know how to create such an URL, that's why I'm suggesting to use "GET" instead of post - it's part of search form success stories, e.g. google's.

Joachim