Support » Plugin: Simple Page Ordering » URL Encoding Bug

  • Resolved Andy Stratton

    (@theandystratton)


    When more than one query var is in the admin URL, clicking Sort By Order double encodes some ampersands, it seems to be due to the plugin calling url_encode() then add_query_arg() also calling url_encode() to the second argument.

    simple-page-ordering.php, line 286 can go from:

    $query_string = add_query_arg( 'orderby', urlencode( 'menu_order title' ), $query_string );

    to:

    $query_string = add_query_arg( 'orderby', 'menu_order title', $query_string );

    I noticed this when sorting by published or by a taxonomy then attempting to Sort By Order.

    https://wordpress.org/plugins/simple-page-ordering/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jake Goldman

    (@jakemgold)

    10up Engineer

    Fixed. Good find!

    I’m up-to-date but I still have this issue. I feel like the onus is a little more on WP than on SPO, but the only way I was able to resolve it was by removing the esc_url() from the function you changed, so:

    $query_string = esc_url( remove_query_arg( array( 'orderby', 'order' ) ) ); becomes $query_string = remove_query_arg( array( 'orderby', 'order' ) );

    There’s a whole bunch of escaping happening in the WP core, and I haven’t run into any issues from removing this. But I don’t know if it’s something that *everyone* would want to do — just a heads up for anybody dealing with this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘URL Encoding Bug’ is closed to new replies.