Project: moodle
Issue MDL-41316: Spam cleaner  using ORACLE
I’m using Oracle and when I click on Site administration / ► Reports / ► Spam cleaner I get this error: ORA-00933: SQL command not properly ended SELECT u.*, p.summary FROM d_user AS u, d_post AS p WHERE ( LOWER(p.summary) LIKE LOWER(:o_sumpat0) ESCAPE '\' OR LOWER(p.summary) LIKE LOWER(:o_sumpat1) ESCAPE '\' OR LOWER(p.summary) LIKE LOWER(:o_sumpat2) ESCAPE '\' OR LOWER(p.summary) LIKE LOWER(:o_sumpat3) ESCAPE '\' OR LOWER(p.summary) LIKE LOWER(:o_sumpat4) ESCAPE '\' OR LOWER(p.summary) LIKE LOWER(:o_sumpat5) ESCAPE '\' OR LOWER(p.summary) LIKE LOWER(:o_sumpat6) ESCAPE '\' OR LOWER(p.summary) LIKE LOWER(:o_sumpat7) ESCAPE '\' OR LOWER(p.summary) LIKE LOWER(:o_sumpat8) ESCAPE '\' ) AND u.deleted = 0 AND u.id=p.userid AND u.id <> :o_userid I resolved deleting aliases in table names changing admin/tool/spamcleaner/index.php in this way: @@ -179,12 +179,12 @@ function search_spammers($keywords) { $conditions7 = '( '.implode(' OR ', $keywordfull7).' )'; $sql = "SELECT * FROM {user} WHERE deleted = 0 AND id <> :userid AND $conditions"; // Exclude oneself $sql2 = "SELECT u.*, p.summary FROM {user} u, {post} AS p WHERE $conditions2 AND u.deleted = 0 AND u.id=p.userid AND u.id <> :userid"; $sql3 = "SELECT u.*, p.subject as postsubject FROM {user} u, {post} AS p WHERE $conditions3 AND u.deleted = 0 AND u.id=p.userid AND u.id <> :userid"; $sql4 = "SELECT u.*, c.content FROM {user} u, {comments} AS c WHERE $conditions4 AND u.deleted = 0 AND u.id=c.userid AND u.id <> :userid"; $sql5 = "SELECT u.*, m.fullmessage FROM {user} u, {message} m WHERE $conditions5 AND u.deleted = 0 AND u.id=m.useridfrom AND u.id <> :userid"; $sql6 = "SELECT u.*, fp.message FROM {user} u, {forum_posts} fp WHERE $conditions6 AND u.deleted = 0 AND u.id=fp.userid AND u.id <> :userid"; $sql7 = "SELECT u.*, fp.subject FROM {user} u, {forum_posts} fp WHERE $conditions7 AND u.deleted = 0 AND u.id=fp.userid AND u.id <> :userid";
Story points: 3