--- sources/reference.inc	2009-10-15 13:13:20.000000000 -0500
+++ sources/reference.inc.new	2009-10-15 13:13:17.000000000 -0500
@@ -187,7 +187,7 @@ function filefield_source_reference_get_
   $files = array();
   foreach ($fields as $field) {
     $db_info = content_database_info($field);
-    $result = db_query("SELECT f.* FROM {" . $db_info['table'] . "} c INNER JOIN {files} f ON c." . $db_info['columns']['fid']['column'] . " = f.fid WHERE f.filename LIKE '%s%%' AND status = 1", $filename);
+    $result = db_query("SELECT f.* FROM {" . $db_info['table'] . "} c INNER JOIN {files} f ON c." . $db_info['columns']['fid']['column'] . " = f.fid WHERE f.filename LIKE '%%%s%%' AND status = 1", $filename);
     while ($file = db_fetch_object($result)) {
       $files[$file->fid] = $file;
     }
