Index: trunk/extensions/SemanticForms/includes/SF_Utils.inc |
— | — | @@ -266,10 +266,12 @@ |
267 | 267 | } |
268 | 268 | } else { |
269 | 269 | $cur_value = str_replace("_", " ", $row['page_title']); |
270 | | - if ($substring == null) |
271 | | - $pages[] = $cur_value; |
272 | | - else |
273 | | - $pages[] = array('title' => $cur_value); |
| 270 | + if (! in_array($cur_value, $pages)) { |
| 271 | + if ($substring == null) |
| 272 | + $pages[] = $cur_value; |
| 273 | + else |
| 274 | + $pages[] = array('title' => $cur_value); |
| 275 | + } |
274 | 276 | // return if we've reached the maximum number of allowed values |
275 | 277 | if (count($pages) > $sfgMaxAutocompleteValues) |
276 | 278 | return $pages; |