• Resolved Palpatine1976

    (@palpatine1976)


    It seems that certain characters in the search field get converted upon searching execution, resulting in zero results for pages > 1.

    To reproduce – create a bunch of entries that all share a search term (such as @test.com as the email address)

    Search on “test.com”

    Several pages of results come back – all is good. However, now to go Page 2 (or click NEXT) – you see the search term has become “test-com”, which returns no results. Looks like a search hook/filter has replaced ‘.’ for ‘-‘. This is surely a bug?

    Great plugin tho! If this bug is fixed in the plus version, please let me know and I’ll upgrade.

    https://www.ads-software.com/extend/plugins/amr-users/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author anmari

    (@anmari)

    HI sorry i missed this (I think www.ads-software.com updated all the feed urls and now I am not seeing them in my feed reader… )

    sounds weird – not deliberate at all – will look into it.

    Plugin Author anmari

    (@anmari)

    Hi Sith Lord Goz,

    I am unable to recreate what you are describing.

    Please check you are update to date with all versions and that nothing else is interfering.

    I don’t want to display emails publicly, so can offer a public test on the url (shouldn’t make any difference to the searching). I have of course tested locally with emails with links and without links.

    See
    https://directories.wpusersplugin.com/list-with-url/

    and

    https://directories.wpusersplugin.com/list-with-url/?su=farm.com

    Thread Starter Palpatine1976

    (@palpatine1976)

    @anmari

    Hi there! Thanks for the follow up on this. I can however confirm this is a bug in amr-users. If you check out the steps below, you should be able to recreate it:

    * Completely clean WordPress 3.3.x or 3.4 install
    * No other plugins or customization
    * Install & activate amr-users
    * Create say 6 dummy user accounts ([email protected], [email protected] etc.)
    * Go into Admin screen -> Users -> Users: Details report
    * Set results per page to be less than the total # of dummy users (so say 4)
    * Enter search term “test.com”
    * It will show 4 of the 6 records, and show a “Next” button (and a Page 2 button)
    * Click either NEXT or Page 2.. you’ll see the querystring now reads “test-com” – and no records are returned

    Again, this bug only happens when you paginate to pages of results. The initial view is fine. I bet if you created a bunch of test account in your link in your post, and clicked “page 2” it would do the same thing.

    Hopefully it’s not a tough bug!

    Plugin Author anmari

    (@anmari)

    Hi,

    Yup – credit to you – thanks.
    I thought about for a while and realised it must be the sanitisation/validation doing something.

    There was a different sanitisation on non-page ‘1’s when the paginated links (so it can remember the search text). This sanitisation is TOO tight.

    Change line 572 of ameta-includes.php from

    $search = sanitize_title($_REQUEST['su']);

    to

    $search = filter_var ($_REQUEST['su'], FILTER_SANITIZE_STRING );

    to be consistent.

    This will go up in the next update.

    Plugin Author anmari

    (@anmari)

    actually on further thought to be more wordpress consistent.

    the wordpress search uses strip_tags (more or less same thing), so this should use that too

    $search = strip_tags ($_REQUEST['su']);

    Next update will have both bits of sanitisation changed to that.

    Thread Starter Palpatine1976

    (@palpatine1976)

    Great! Thank you for being such a responsive developer – you’re a credit to WP ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: amr users] Search term altered upon pagination’ is closed to new replies.