#35892 closed defect (bug) (invalid)
Small issue in "get_calendar" function
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Widgets | Keywords: | |
Focuses: | Cc: |
Description
In the "get_calendar" function (wp-includes/general-template.php) the following wpdb method with a SQL command is called:
'get_var("SELECT 1'
This will not work as "get_var" does not support that:
https://core.trac.wordpress.org/ticket/4090
The error is tiny. However, this seems to be a common mistake if you google for:
"get_var" "SELECT 1"
I either suggest to enable this functionality in the "get_var" method or fix it in get_calendar function as well as describe the issue in the codex (https://codex.wordpress.org/Class_Reference/wpdb#SELECT_a_Variable).
Change History (3)
Note: See
TracTickets for help on using
tickets.
Thanks for the bug report!
The query in
get_calendar()
is written asSELECT 1 as test...
, which does work correctly withmysqli_fetch_object()
.It would require significant re-engineering and edge case handling in WPDB to handle the
SELECT 1...
case, which doesn't seem to have much payoff when there are simple workarounds available.