3 ms·
The commented out function - if a verbatim copy of deployed code was in fact presented - seems to not include function name and opening brace, but does comment
by Jedd 5y ago
The commented out function - if a verbatim copy of deployed code was in fact presented - seems to not include function name and opening brace, but does comment out the function proper and closing brace, which, and it's been a while since I did anything with PHP, would mean a syntax error on run, right?
- Gaelan 5y agoHere's the snippet from the article: function get($urlPath, $queryParams=null, $ouputFormat='xml'){ // if(!authenticateAsOwner($queryParams)) // { // header("HTTP/1.0 401 Unauthorized"); // return; // } The closing brace there corresponds to the if. The rest of the body of the function, and its closing brace, are outside the snippet included in the article.
- Jedd 5y agoAh, thanks - I'd missed that.
- wizzwizz4 5y agoIt comments out the `if` block, but not the rest of the function.
- alexwasserman 5y agoSnippet supplied in the article: function get($urlPath, $queryParams=null, $ouputFormat='xml'){ // if(!authenticateAsOwner($queryParams)) // { // header("HTTP/1.0 401 Unauthorized"); // return; // } That if statement is checking for authentication before running the rest of the function. Just the if check is commented out. Assuming here the rest of that function would come below it, with a closing brace. ie: function get($urlPath, $queryParams=null, $ouputFormat='xml'){ // if(!authenticateAsOwner($queryParams)) // { // header("HTTP/1.0 401 Unauthorized"); // return; // } do; something; here; then; }
- Sanzig 5y agoThe commented-out closing brace is for the if statement, not the whole function. The rest of the function was snipped, you can see the whole thing here: https://paste.debian.net/plainh/7630c424 https://paste.debian.net/plainh/7630c424
- deleted 5y ago[deleted]