MDL-26177 compare 255 chars when checking custom field uniqueness
authorPetr Skoda <commits@skodak.org>
Wed, 2 Feb 2011 08:15:42 +0000 (09:15 +0100)
committerPetr Skoda <commits@skodak.org>
Wed, 2 Feb 2011 08:15:42 +0000 (09:15 +0100)
user/profile/lib.php

index 8fd0612..906f8ca 100644 (file)
@@ -136,7 +136,7 @@ class profile_field_base {
                     SELECT id, userid
                       FROM {user_info_data}
                      WHERE fieldid = ?
-                       AND ' . $DB->sql_compare_text('data') . ' = ?',
+                       AND ' . $DB->sql_compare_text('data', 255) . ' = ' . $DB->sql_compare_text('?', 255),
                     array($this->field->id, $value));
             if ($data) {
                 $existing = false;