tslocum / PyIB

Python Image Board
https://github.com/downloads/tslocum/PyIB-Standalone/pyib_r66.zip
GNU General Public License v3.0
33 stars 5 forks source link

cross thread references broken by multiple boards #2

Closed Dunecat closed 9 years ago

Dunecat commented 13 years ago

I was implementing the cross thread references code on my installation of pyib, and found that the database query can potentially return the wrong result due to the fact that boardid is not specified in the WHERE clause, breaking the link.

The fix is very simple:

in formatting.py:

Old (broken) Code: line 119: parentid = FetchOne("SELECT parentid FROM posts WHERE id = '%s' LIMIT 1" % postid)["parentid"]

New (fixed) Code line 119: parentid = FetchOne("SELECT parentid FROM posts WHERE id = '%s' AND boardid = '%s' LIMIT 1" % (postid, board['id']))["parentid"]

Regards, Dunecat