{"action":"created","issue":{"url":"https://api.github.com/repos/aces/Loris/issues/1828","repository_url":"https://api.github.com/repos/aces/Loris","labels_url":"https://api.github.com/repos/aces/Loris/issues/1828/labels{/name}","comments_url":"https://api.github.com/repos/aces/Loris/issues/1828/comments","events_url":"https://api.github.com/repos/aces/Loris/issues/1828/events","html_url":"https://github.com/aces/Loris/pull/1828","id":155758748,"number":1828,"title":"Only use htmlspecialchars on non-null values in Database class","user":{"login":"nicolasbrossard","id":6844033,"avatar_url":"https://avatars.githubusercontent.com/u/6844033?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolasbrossard","html_url":"https://github.com/nicolasbrossard","followers_url":"https://api.github.com/users/nicolasbrossard/followers","following_url":"https://api.github.com/users/nicolasbrossard/following{/other_user}","gists_url":"https://api.github.com/users/nicolasbrossard/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasbrossard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasbrossard/subscriptions","organizations_url":"https://api.github.com/users/nicolasbrossard/orgs","repos_url":"https://api.github.com/users/nicolasbrossard/repos","events_url":"https://api.github.com/users/nicolasbrossard/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasbrossard/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aces/Loris/labels/BugFix","name":"BugFix","color":"f7c6c7"}],"state":"open","locked":false,"assignee":{"login":"jstirling91","id":2818503,"avatar_url":"https://avatars.githubusercontent.com/u/2818503?v=3","gravatar_id":"","url":"https://api.github.com/users/jstirling91","html_url":"https://github.com/jstirling91","followers_url":"https://api.github.com/users/jstirling91/followers","following_url":"https://api.github.com/users/jstirling91/following{/other_user}","gists_url":"https://api.github.com/users/jstirling91/gists{/gist_id}","starred_url":"https://api.github.com/users/jstirling91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstirling91/subscriptions","organizations_url":"https://api.github.com/users/jstirling91/orgs","repos_url":"https://api.github.com/users/jstirling91/repos","events_url":"https://api.github.com/users/jstirling91/events{/privacy}","received_events_url":"https://api.github.com/users/jstirling91/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/aces/Loris/milestones/8","html_url":"https://github.com/aces/Loris/milestones/16.1","labels_url":"https://api.github.com/repos/aces/Loris/milestones/8/labels","id":1620542,"number":8,"title":"16.1","description":"","creator":{"login":"driusan","id":498329,"avatar_url":"https://avatars.githubusercontent.com/u/498329?v=3","gravatar_id":"","url":"https://api.github.com/users/driusan","html_url":"https://github.com/driusan","followers_url":"https://api.github.com/users/driusan/followers","following_url":"https://api.github.com/users/driusan/following{/other_user}","gists_url":"https://api.github.com/users/driusan/gists{/gist_id}","starred_url":"https://api.github.com/users/driusan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/driusan/subscriptions","organizations_url":"https://api.github.com/users/driusan/orgs","repos_url":"https://api.github.com/users/driusan/repos","events_url":"https://api.github.com/users/driusan/events{/privacy}","received_events_url":"https://api.github.com/users/driusan/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":5,"state":"open","created_at":"2016-03-03T16:19:22Z","updated_at":"2016-05-19T15:00:32Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-05-19T15:00:21Z","updated_at":"2016-05-19T20:15:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aces/Loris/pulls/1828","html_url":"https://github.com/aces/Loris/pull/1828","diff_url":"https://github.com/aces/Loris/pull/1828.diff","patch_url":"https://github.com/aces/Loris/pull/1828.patch"},"body":"If you don't do that, nulls are transformed into '' (empty strings), which can have undesirable consequences."},"comment":{"url":"https://api.github.com/repos/aces/Loris/issues/comments/220439387","html_url":"https://github.com/aces/Loris/pull/1828#issuecomment-220439387","issue_url":"https://api.github.com/repos/aces/Loris/issues/1828","id":220439387,"user":{"login":"nicolasbrossard","id":6844033,"avatar_url":"https://avatars.githubusercontent.com/u/6844033?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolasbrossard","html_url":"https://github.com/nicolasbrossard","followers_url":"https://api.github.com/users/nicolasbrossard/followers","following_url":"https://api.github.com/users/nicolasbrossard/following{/other_user}","gists_url":"https://api.github.com/users/nicolasbrossard/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasbrossard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasbrossard/subscriptions","organizations_url":"https://api.github.com/users/nicolasbrossard/orgs","repos_url":"https://api.github.com/users/nicolasbrossard/repos","events_url":"https://api.github.com/users/nicolasbrossard/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasbrossard/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T20:15:55Z","updated_at":"2016-05-19T20:15:55Z","body":"No it really is class Database that is behaving badly. Look at method\n_nullScores() in NDB_BVL_Instrument and imagine that you have a set of\nscore columns defined as nullable int(11). If you try to null all scores\nwith this method, it will issue an update statement on all the score\nfields, trying to set them to '' (empty string, because of the buggy\nhtmlspecialchars call) and this will eventually set all the scores to 0,\nwhich is not what you want.\n\nHope this makes sense. If not we can talk about it tomorrow.\n\nCheers,\nNick\n\n\nOn Thu, May 19, 2016 at 3:47 PM, Dave MacFarlane <notifications@github.com>\nwrote:\n\n> Are you sure the problem you're trying to solve isn't QuickForm turning\n> empty text boxes into ''?\n>\n> I'm not sure that our database wrappers have ever dealt with nulls.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/aces/Loris/pull/1828#issuecomment-220431142>\n>\n"}}