Subversion Repositories php_users

Rev

Rev 42 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 42 Rev 46
Line 147... Line 147...
147
       * 
147
       * 
148
       * @param string $string The string to be fixed
148
       * @param string $string The string to be fixed
149
       * @return string A copy of the string, ready for SQL
149
       * @return string A copy of the string, ready for SQL
150
       */
150
       */
151
      protected function escapeString ( $string ) {
151
      protected function escapeString ( $string ) {
-
 
152
         if ( strlen( $string ) == 0 ) {
-
 
153
            $string = 'null';
152
         if ( ! is_numeric( $string ) ) {
154
         } elseif ( ! is_numeric( $string ) ) {
153
            $string = $this->dbConnection->real_escape_string( $string );
155
            $string = $this->dbConnection->real_escape_string( $string );
154
            $string = "'$string'";
156
            $string = "'$string'";
155
         }
157
         }
156
         return $string;
158
         return $string;
157
      }
159
      }
Line 194... Line 196...
194
                  $this->configuration['tables']['users']['fields'][$key]['dbColumn']
196
                  $this->configuration['tables']['users']['fields'][$key]['dbColumn']
195
                  ) . '= ' . $this->escapeString( $value );
197
                  ) . '= ' . $this->escapeString( $value );
196
            }
198
            }
197
            $query .= ' where ' . implode( ' and ', $temp );
199
            $query .= ' where ' . implode( ' and ', $temp );
198
         }
200
         }
-
 
201
         $query .= ' order by isnull(removed) desc, login';
199
         return $query;
202
         return $query;
200
      }
203
      }
201
      
204
      
202
      /**
205
      /**
203
       * Get a record from the database
206
       * Get a record from the database