{"action":"created","issue":{"url":"https://api.github.com/repos/mybb/mybb/issues/1933","labels_url":"https://api.github.com/repos/mybb/mybb/issues/1933/labels{/name}","comments_url":"https://api.github.com/repos/mybb/mybb/issues/1933/comments","events_url":"https://api.github.com/repos/mybb/mybb/issues/1933/events","html_url":"https://github.com/mybb/mybb/issues/1933","id":63871970,"number":1933,"title":"is_numeric check in Mysql update_query","user":{"login":"zingaburga","id":430322,"avatar_url":"https://avatars.githubusercontent.com/u/430322?v=3","gravatar_id":"","url":"https://api.github.com/users/zingaburga","html_url":"https://github.com/zingaburga","followers_url":"https://api.github.com/users/zingaburga/followers","following_url":"https://api.github.com/users/zingaburga/following{/other_user}","gists_url":"https://api.github.com/users/zingaburga/gists{/gist_id}","starred_url":"https://api.github.com/users/zingaburga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zingaburga/subscriptions","organizations_url":"https://api.github.com/users/zingaburga/orgs","repos_url":"https://api.github.com/users/zingaburga/repos","events_url":"https://api.github.com/users/zingaburga/events{/privacy}","received_events_url":"https://api.github.com/users/zingaburga/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mybb/mybb/labels/1.8","name":"1.8","color":"5319e7"},{"url":"https://api.github.com/repos/mybb/mybb/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/mybb/mybb/labels/p:normal","name":"p:normal","color":"FBE379"},{"url":"https://api.github.com/repos/mybb/mybb/labels/s:confirmed","name":"s:confirmed","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mybb/mybb/milestones/11","html_url":"https://github.com/mybb/mybb/milestones/1.8.6","labels_url":"https://api.github.com/repos/mybb/mybb/milestones/11/labels","id":1026368,"number":11,"title":"1.8.6","description":"","creator":{"login":"Sama34","id":1786584,"avatar_url":"https://avatars.githubusercontent.com/u/1786584?v=3","gravatar_id":"","url":"https://api.github.com/users/Sama34","html_url":"https://github.com/Sama34","followers_url":"https://api.github.com/users/Sama34/followers","following_url":"https://api.github.com/users/Sama34/following{/other_user}","gists_url":"https://api.github.com/users/Sama34/gists{/gist_id}","starred_url":"https://api.github.com/users/Sama34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sama34/subscriptions","organizations_url":"https://api.github.com/users/Sama34/orgs","repos_url":"https://api.github.com/users/Sama34/repos","events_url":"https://api.github.com/users/Sama34/events{/privacy}","received_events_url":"https://api.github.com/users/Sama34/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":0,"state":"open","created_at":"2015-03-17T23:25:48Z","updated_at":"2015-04-12T18:41:15Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2015-03-24T01:12:26Z","updated_at":"2015-04-14T10:50:11Z","closed_at":null,"body":"From inc/db_mysql(i).php\r\n\r\n\t\t\t\tif(is_numeric($value))\r\n\t\t\t\t{\r\n\t\t\t\t\t$query .= $comma.\"`\".$field.\"`={$value}\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$query .= $comma.\"`\".$field.\"`={$quote}{$value}{$quote}\";\r\n\t\t\t\t}\r\n\r\nThis is only done in `update_query` and not anywhere else (even in Postgres/Sqlite drivers).  \r\nIt's problematic anyway, since is_numeric can return true for strings like \"0x0\", which can cause query errors.\r\n\r\nI'm not in a convenient place to check the commit history for why the change was made, but I thought I'd just point it out anyway."},"comment":{"url":"https://api.github.com/repos/mybb/mybb/issues/comments/92765975","html_url":"https://github.com/mybb/mybb/issues/1933#issuecomment-92765975","issue_url":"https://api.github.com/repos/mybb/mybb/issues/1933","id":92765975,"user":{"login":"zingaburga","id":430322,"avatar_url":"https://avatars.githubusercontent.com/u/430322?v=3","gravatar_id":"","url":"https://api.github.com/users/zingaburga","html_url":"https://github.com/zingaburga","followers_url":"https://api.github.com/users/zingaburga/followers","following_url":"https://api.github.com/users/zingaburga/following{/other_user}","gists_url":"https://api.github.com/users/zingaburga/gists{/gist_id}","starred_url":"https://api.github.com/users/zingaburga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zingaburga/subscriptions","organizations_url":"https://api.github.com/users/zingaburga/orgs","repos_url":"https://api.github.com/users/zingaburga/repos","events_url":"https://api.github.com/users/zingaburga/events{/privacy}","received_events_url":"https://api.github.com/users/zingaburga/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T10:50:11Z","updated_at":"2015-04-14T10:50:11Z","body":"Oh I see what you mean - sorry I didn't read it correctly.\r\nIf the caller needs to always manually escape the binary fields, then it would make sense to completely remove the check (like in the pgsql driver), something like:\r\n\r\n\tif(isset($mybb->binary_fields[$table][$field]) && $mybb->binary_fields[$table][$field])\r\n\t{\r\n\t\t$array[$field] = $value;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$array[$field] = \"'{$value}'\";\r\n\t}\r\n\r\nMakes more sense I suppose, since regular behaviour requires manual escaping anyway.\r\nIn which case, your code would still work."}}