non-admin-approved images showing up in albums with keywords set non-admin-approved images showing up in albums with keywords set
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

non-admin-approved images showing up in albums with keywords set

Started by donnoman, November 25, 2005, 12:52:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

donnoman

Ambiguous order of operations in an sql clause were allowing non-admin-approved images to be shown in albums that had a keyword set.

Problem SQL example:

SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords, title, caption,hits,owner_id,owner_name from cpg140_pictures WHERE (aid='3'  ) OR (keywords like '%Everybody%'  ) AND approved='YES'  ORDER BY filename ASC  LIMIT 0 ,12


Fixed SQL example:

SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords, title, caption,hits,owner_id,owner_name from cpg140_pictures WHERE ((aid='3'  ) OR (keywords like '%Everybody%'  )) AND approved='YES'  ORDER BY filename ASC  LIMIT 0 ,12


fix committed.

Titooy

This is certainly related : the picture count in the categories list and the overal stats includes non-admin-approved images. While it's shown correctly on the album's picture count.