• Resolved frankleeceo

    (@frankleeceo)


    Hello Tobias, thank you for the awesome extension. I understand that there are character sanitations with the Get Parameter extension, however the && logic operators do not get passed even after adding the & symbol as mentioned in the other threads.

    Is there any lines of code that I could add into the plugin to pass through the logic operators available in the row filter?

    Thank you for the help!
    Frank

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Could you clarify which modifications you made to the files? Thanks!
    It might be necessary to also allow the semicolon ;, as a & in a URL usually gets encoded as &.

    Regards,
    Tobias

    • This reply was modified 7 years, 7 months ago by Tobias B?thge.
    Thread Starter frankleeceo

    (@frankleeceo)

    Hello, no trouble at all. Thank you for the help!

    I edited the file tablepress-shortcode-filter-get-parameter.php

    $filter_term = preg_replace( ‘#[^a-z0-9 &;]#i’, ”, $filter_term );

    I then tested the get parameter URL with parameters like

    https://example.net/test/?table_filter=1&&b
    https://example.net/test/?table_filter=1&&b

    It appears that only the string before the symbols are accepted, and the && and anything following is completely disregarded.

    Thank you!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    ah, now I see what’s happening. The problem here is that the & character in a URL has a special meaning. It’s the separator between multiple query variables in the URL.

    We might therefore have to “url encode” it, so that it’s not recognized as a & in the URL.
    For that, please try again with
    https://example.net/test/?table_filter=1%26%26b

    This might mean that you have to allow the % as well, and it might be necessary to add a line like
    $filter_term = urldecode( $filter_term );
    after that preg_replace line.

    Regards,
    Tobias

    Thread Starter frankleeceo

    (@frankleeceo)

    I have tested the solution. It works as expected, thank you! You are the best!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Get Parameter Plus Row Filtering Logic Operator’ is closed to new replies.