Suggestion: If leading whitespace is allowed in
queries, then the queries can (optionally) be formatted
more nicely, e.g.:
$result = $db->query("
SELECT a,b
FROM x
WHERE z
");
(The lines of the query are indented above, but that
may not show up here.)
I think this is more readable for long or complex queries.
Suggested change:
Insert at beginning of XoopsMySQLDatabaseProxy::query()
in class/database/mysqldatabase.php:
$sql = ltrim($sql);
An equivalent solution would be to revert to using
preg_match, rather than substr, and allow leading
whitespace in the regex pattern:
preg_match("/^\sSELECT./i", $sql)
Logged In: YES
user_id=882380
Changed to accepted and ok for 2.0.7 release.
Logged In: YES
user_id=841117
Fixed, ready for review