{"action":"created","issue":{"url":"https://api.github.com/repos/opencart/opencart/issues/4901","repository_url":"https://api.github.com/repos/opencart/opencart","labels_url":"https://api.github.com/repos/opencart/opencart/issues/4901/labels{/name}","comments_url":"https://api.github.com/repos/opencart/opencart/issues/4901/comments","events_url":"https://api.github.com/repos/opencart/opencart/issues/4901/events","html_url":"https://github.com/opencart/opencart/pull/4901","id":178620849,"number":4901,"title":"Request::clean() early return for array types","user":{"login":"pine3ree","id":3229979,"avatar_url":"https://avatars.githubusercontent.com/u/3229979?v=3","gravatar_id":"","url":"https://api.github.com/users/pine3ree","html_url":"https://github.com/pine3ree","followers_url":"https://api.github.com/users/pine3ree/followers","following_url":"https://api.github.com/users/pine3ree/following{/other_user}","gists_url":"https://api.github.com/users/pine3ree/gists{/gist_id}","starred_url":"https://api.github.com/users/pine3ree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pine3ree/subscriptions","organizations_url":"https://api.github.com/users/pine3ree/orgs","repos_url":"https://api.github.com/users/pine3ree/repos","events_url":"https://api.github.com/users/pine3ree/events{/privacy}","received_events_url":"https://api.github.com/users/pine3ree/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-22T14:10:37Z","updated_at":"2016-10-03T17:12:06Z","closed_at":"2016-10-03T04:22:48Z","pull_request":{"url":"https://api.github.com/repos/opencart/opencart/pulls/4901","html_url":"https://github.com/opencart/opencart/pull/4901","diff_url":"https://github.com/opencart/opencart/pull/4901.diff","patch_url":"https://github.com/opencart/opencart/pull/4901.patch"},"body":"...and remove unnecessary assignment for scalar types."},"comment":{"url":"https://api.github.com/repos/opencart/opencart/issues/comments/251165551","html_url":"https://github.com/opencart/opencart/pull/4901#issuecomment-251165551","issue_url":"https://api.github.com/repos/opencart/opencart/issues/4901","id":251165551,"user":{"login":"pine3ree","id":3229979,"avatar_url":"https://avatars.githubusercontent.com/u/3229979?v=3","gravatar_id":"","url":"https://api.github.com/users/pine3ree","html_url":"https://github.com/pine3ree","followers_url":"https://api.github.com/users/pine3ree/followers","following_url":"https://api.github.com/users/pine3ree/following{/other_user}","gists_url":"https://api.github.com/users/pine3ree/gists{/gist_id}","starred_url":"https://api.github.com/users/pine3ree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pine3ree/subscriptions","organizations_url":"https://api.github.com/users/pine3ree/orgs","repos_url":"https://api.github.com/users/pine3ree/repos","events_url":"https://api.github.com/users/pine3ree/events{/privacy}","received_events_url":"https://api.github.com/users/pine3ree/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T17:12:06Z","updated_at":"2016-10-03T17:12:06Z","body":"check it out: http://www.pine3ree.com/test/oc-clean.php\r\n\r\n```php\r\n<?php\r\n\r\nfunction oc_clean($data) {\r\n    if (is_array($data)) {\r\n        foreach ($data as $key => $value) {\r\n            unset($data[$key]);\r\n            $data[oc_clean($key)] = oc_clean($value);\r\n        }\r\n    } else {\r\n        $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');\r\n    }\r\n\r\n    return $data;\r\n}\r\n\r\nfunction p3_clean($data) {\r\n    if (is_array($data)) {\r\n        foreach ($data as $key => $value) {\r\n            unset($data[$key]);\r\n            $data[p3_clean($key)] = p3_clean($value);\r\n        }\r\n\r\n        return $data;\r\n    }\r\n\r\n    return htmlspecialchars($data, ENT_COMPAT, 'UTF-8');\r\n}\r\n\r\n$data = array(\r\n    '&' => '&',\r\n    '<' => '>',\r\n    '<' => '<',\r\n    '\"' => '\"',\r\n    'nested' => array(\r\n        '&' => '&',\r\n        '<' => '>',\r\n        '<' => '<',\r\n        '\"' => '\"',\r\n    ),\r\n);\r\n\r\n$oc_data = oc_clean($data);\r\n$p3_data = p3_clean($data);\r\n\r\nheader('Content-Type:text/plain; charset=utf-8');\r\necho 'RESULTS ARE ' . ($oc_data === $p3_data ? '' :  'NOT ') . 'IDENTICAL' . PHP_EOL . PHP_EOL;\r\n\r\necho 'oc_clean($data) => ' . print_r($oc_data, true) . PHP_EOL;\r\necho 'p3_clean($data) => ' . print_r($p3_data, true) . PHP_EOL;\r\n```"}}
{"actor":{"display_login":"pine3ree"}}