fl4p / WP-Filebase

WP-Filebase
http://wpfilebase.com/
34 stars 35 forks source link

classes/item.php line 135 - condition fails - false >=0 - prevents (at least) category sorting #35

Closed Obliquely closed 8 years ago

Obliquely commented 8 years ago

In classes/item.phpline 135, you are testing the result of strpos($order_sql, ',') by using >=0. When strpos returns false, the test succeeds, and the first character of $order_sql is removed. The error occurs if, for example, you have sortcats="cat_order" in a shortcode. Replacing the line with the following, prevents various warnings being issued and also makes the sort work again: if ($p !== false && $p >= 0)

fl4p commented 8 years ago

You are right. if ($p !== false) will do it too. Will fix this with next update. Thanks!