{"action":"opened","issue":{"url":"https://api.github.com/repos/vitmalina/w2ui/issues/823","labels_url":"https://api.github.com/repos/vitmalina/w2ui/issues/823/labels{/name}","comments_url":"https://api.github.com/repos/vitmalina/w2ui/issues/823/comments","events_url":"https://api.github.com/repos/vitmalina/w2ui/issues/823/events","html_url":"https://github.com/vitmalina/w2ui/issues/823","id":59210883,"number":823,"title":"Advanced search ends with issue (1.4.2)","user":{"login":"MarkusAholainen","id":11226790,"avatar_url":"https://avatars.githubusercontent.com/u/11226790?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkusAholainen","html_url":"https://github.com/MarkusAholainen","followers_url":"https://api.github.com/users/MarkusAholainen/followers","following_url":"https://api.github.com/users/MarkusAholainen/following{/other_user}","gists_url":"https://api.github.com/users/MarkusAholainen/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkusAholainen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkusAholainen/subscriptions","organizations_url":"https://api.github.com/users/MarkusAholainen/orgs","repos_url":"https://api.github.com/users/MarkusAholainen/repos","events_url":"https://api.github.com/users/MarkusAholainen/events{/privacy}","received_events_url":"https://api.github.com/users/MarkusAholainen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-27T09:33:14Z","updated_at":"2015-02-27T09:33:14Z","closed_at":null,"body":"Hi,\r\n\r\nThanks for the great web framework!\r\n\r\nThere is an issue on the w2ui-1.4.2.js line 2316 (function localSearch).\r\n\r\nNow the ends with matches also with strings that are one character shorter than the search string regardless of the content. E.g. record value \"Apple\" will give errorneous match with ends with search string \"Banana\". There is fix below.\r\n\r\nis\r\n--\r\n  case 'ends':\r\n  case 'ends with': // need for back compatib.                                                                                                                                                     if (val1.indexOf(val2) == val1.length - val2.length) fl++; // do not hide record                                                       \r\n --\r\nFixed version\r\n--\r\n  case 'ends':\r\n  case 'ends with': // need for back compatib.                                                                                                                                                     if (val1.indexOf(val2) >= 0 && val1.indexOf(val2) == val1.length - val2.length) fl++; // do not hide record                                                       \r\n --\r\n \r\nRegards,\r\n  Markus Aholainen"}}