Skip to content

Commit

Permalink
Today I Learnt: you can't check consts for empty
Browse files Browse the repository at this point in the history
Doesn't work at all, interestingly for different reasons across PHP versions - http://3v4l.org/06f2E
  • Loading branch information
ozh committed May 25, 2015
1 parent 6358215 commit 1921d0f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions includes/functions-http.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ function yourls_http_post_body( $url, $headers = array(), $data = array(), $opti
function yourls_http_get_proxy() {
$proxy = false;

if( defined( 'YOURLS_PROXY' ) && !empty( YOURLS_PROXY ) ) {
if( defined( 'YOURLS_PROXY' ) ) {
$proxy = YOURLS_PROXY;
// Username (?) and password can be defined as an empty string : no check for empty()
if( defined( 'YOURLS_PROXY_USERNAME' ) && defined( 'YOURLS_PROXY_PASSWORD' ) ) {
$proxy = array( YOURLS_PROXY, YOURLS_PROXY_USERNAME, YOURLS_PROXY_PASSWORD );
}
Expand Down

0 comments on commit 1921d0f

Please sign in to comment.