You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue
Calls made to get_users with the compare flag of 'EXISTS' for the single item of group_id are resulting in an invalid query being produced that fails with MySQL, there is likely a deep issue with the dynamic query generation in Wordpress in this file wordpress\wp-includes\class-wp-meta-query.php when using EXISTS for single values in some setups. Which results in this invalid query SELECT * FROM artnetnews.wp_usermeta WHERE meta_key = '_leaky_paywall_group_member' AND CAST(meta_value AS CHAR) EXISTS '2228566' ORDER BY CAST(meta_value AS CHAR see line 773 of web/app/plugins/leaky-paywall-group-accounts/functions.php attached
The query has a CAST followed by an EXISTS which is invalid
Recommended action
Since group_id is a single value, I recommend changing the compare flag to = from EXISTS and resolves the problem with our version of Wordpress and MySQL.
Wordpress version
5.9.4
MySQL Version
5.6
Leaky Paywall Group Account Plugin Version
1.4.1
File
web/app/plugins/leaky-paywall-group-accounts/functions.php
Issue
Calls made to
get_users
with the compare flag of'EXISTS'
for the single item of group_id are resulting in an invalid query being produced that fails with MySQL, there is likely a deep issue with the dynamic query generation in Wordpress in this filewordpress\wp-includes\class-wp-meta-query.php
when using EXISTS for single values in some setups. Which results in this invalid querySELECT * FROM artnetnews.wp_usermeta WHERE meta_key = '_leaky_paywall_group_member' AND CAST(meta_value AS CHAR) EXISTS '2228566' ORDER BY CAST(meta_value AS CHAR
see line 773 of web/app/plugins/leaky-paywall-group-accounts/functions.php attachedThe query has a
CAST
followed by anEXISTS
which is invalidRecommended action
Since
group_id
is a single value, I recommend changing the compare flag to=
fromEXISTS
and resolves the problem with our version of Wordpress and MySQL.Attached files
class-wp-meta-query.zip
Image of the issue on the Group Accounts page with the stock plugin
Image of the Group Accounts page with the modification (fixed)
Other links
https://developer.wordpress.org/reference/classes/wp_meta_query/__construct/
The text was updated successfully, but these errors were encountered: