You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wp_parse_url is a new function available in WordPress 4.4. The oauth1 server plugin requires the function. If you are using this with example client with WP < 4.4, the server will fatal.
A temporary workaround is to add the following as an MU plugin to the server:
<?php/** * wp_parse_url is only available in WP 4.4. This ensures the function is available regardles of the WP version. */if ( ! function_exists( 'wp_parse_url' ) ) {
functionwp_parse_url( $url ) {
$parts = @parse_url( $url );
if ( ! $parts ) {
// < PHP 5.4.7 compat, trouble with relative paths including a scheme break in the pathif ( '/' == $url[0] && false !== strpos( $url, '://' ) ) {
// Since we know it's a relative path, prefix with a scheme/host placeholder and try againif ( ! $parts = @parse_url( 'placeholder://placeholder' . $url ) ) {
return$parts;
}
// Remove the placeholder values
unset( $parts['scheme'], $parts['host'] );
} else {
return$parts;
}
}
// < PHP 5.4.7 compat, doesn't detect schemeless URL's host fieldif ( '//' == substr( $url, 0, 2 ) && ! isset( $parts['host'] ) ) {
$path_parts = explode( '/', substr( $parts['path'], 2 ), 2 );
$parts['host'] = $path_parts[0];
if ( isset( $path_parts[1] ) ) {
$parts['path'] = '/' . $path_parts[1];
} else {
unset( $parts['path'] );
}
}
return$parts;
}
}
Not sure that there is an action item here other than updating the docs.
The text was updated successfully, but these errors were encountered:
Indeed. Hence, "Not sure that there is an action item here other than updating the docs". Just wanted to document it for the next wayward soul just looking for some tokens in this lonely world.
wp_parse_url
is a new function available in WordPress 4.4. The oauth1 server plugin requires the function. If you are using this with example client with WP < 4.4, the server will fatal.A temporary workaround is to add the following as an MU plugin to the server:
Not sure that there is an action item here other than updating the docs.
The text was updated successfully, but these errors were encountered: