Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-21554 MNet: fixed SQL usage to check a record existence

The solution backported from 2.0 and independently suggested by Penny,
too.
  • Loading branch information...
commit 4a7b983bbffd388377e21f850af23363c55153f5 1 parent 5fa5c2e
David Mudrák authored December 09, 2010

Showing 1 changed file with 2 additions and 3 deletions. Show diff stats Hide diff stats

  1. 5  mnet/xmlrpc/client.php
5  mnet/xmlrpc/client.php
@@ -149,7 +149,7 @@ function send($mnet_peer) {
149 149
             // Find methods that we subscribe to on this host
150 150
             $sql = "
151 151
                 SELECT
152  
-                    *
  152
+                    r.id
153 153
                 FROM
154 154
                     {$CFG->prefix}mnet_rpc r,
155 155
                     {$CFG->prefix}mnet_service2rpc s2r,
@@ -161,8 +161,7 @@ function send($mnet_peer) {
161 161
                     h2s.subscribe = '1' AND
162 162
                     h2s.hostid in ({$id_list})";
163 163
 
164  
-            $permission = get_record_sql($sql);
165  
-            if ($permission == false) {
  164
+            if (!record_exists_sql($sql)) {
166 165
                 global $USER;
167 166
                 $this->error[] = '7:User with ID '. $USER->id .
168 167
                                  ' attempted to call unauthorised method '.

0 notes on commit 4a7b983

Please sign in to comment.
Something went wrong with that request. Please try again.