Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • The are a Second problem with this plugin is it have a problen when you have a URL with ‘ ‘(space) o ‘~’. The problem is the function static urlencode_rfc3986 in class WP_REST_OAuth1 in unit class-wp-rest-oauth1.php, the definition is

    protected static function urlencode_rfc3986( $value ) {
    return str_replace( array( ‘+’, ‘%7E’ ), array( ‘ ‘, ‘~’ ), rawurlencode( $value));
    }

    But really no make this function, because the str_replace need change the array, the new definition work:

    protected static function urlencode_rfc3986( $value ) {
    return str_replace( array( ‘ ‘, ‘~’ ), array( ‘+’, ‘%7E’ ), rawurlencode( $value ) );
    }

    The problem is very simple, in the unit oauth1-authorize.php you have the tag
    <button type=”submit” name=”wp-submit” value=”authorize” class=”button button-primary button-large”/><?php _e(‘Authorize’); ?></button>
    <button type=”submit” name=”wp-submit” value=”cancel” class=”button button-large”><?php _e(‘Cancel’); ?></button>

    This First Submit button send a value equal “Authorize” and no “authorize”, the same for the Second Button, it send “Cancel” and no “cancel”, this very important for the unit class-wp-rest-oauth1-ui.php where receive the value in switch

    switch ( $_POST[‘wp-submit’] ) {
    case ‘authorize’: …
    case ‘cancel’: ….
    default: ….
    }

    You need change in this unit the cases for :

    switch ( $_POST[‘wp-submit’] ) {
    case ‘Authorize’: …
    case ‘Cancel’: ….
    default: ….
    }

    Or change the tag the unit oauth1-authorize.php for <input value=…./>

    I test this, it is OK, it Work!!!

Viewing 2 replies - 1 through 2 (of 2 total)