Skip to content

Commit

Permalink
Merge pull request #1658 from WordPress-Coding-Standards/feature/wp-a…
Browse files Browse the repository at this point in the history
…lternativefunctions-allow-some-curl-functions

WP/AlternativeFunctions: allow calling `curl_version()`
  • Loading branch information
GaryJones authored Mar 7, 2019
2 parents 1ddc654 + a6dbd88 commit 5f27d8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions WordPress/Sniffs/WP/AlternativeFunctionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ public function process_matched_token( $stackPtr, $group_name, $matched_content
unset( $first_param );

break;

case 'curl_version':
// Curl version doesn't actually create a connection.
return;
}

if ( ! isset( $this->groups[ $group_name ]['since'] ) ) {
Expand Down
2 changes: 2 additions & 0 deletions WordPress/Tests/WP/AlternativeFunctionsUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ $output_stream = fopen( 'php://fd/3', 'w' ); // OK.
$fp = fopen("php://temp/maxmemory:$fiveMBs", 'r+'); // OK.
readfile( 'php://filter/resource=http://www.example.com' ); // Warning.
file_put_contents("php://filter/write=string.rot13/resource=example.txt","Hello World"); // Warning.

curl_version(); // OK.

0 comments on commit 5f27d8e

Please sign in to comment.