WordPress.org

Ready to get started?Download WordPress

Forums

amr users
[resolved] Search term altered upon pagination (7 posts)

  1. Sith Lord Goz
    Member
    Posted 2 years ago #

    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.

    http://wordpress.org/extend/plugins/amr-users/

  2. anmari
    Member
    Plugin Author

    Posted 2 years ago #

    HI sorry i missed this (I think wordpress.org 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.

  3. anmari
    Member
    Plugin Author

    Posted 2 years ago #

    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
    http://directories.wpusersplugin.com/list-with-url/

    and

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

  4. Sith Lord Goz
    Member
    Posted 2 years ago #

    @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 (test1@test.com, test2@test.com 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!

  5. anmari
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  6. anmari
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  7. Sith Lord Goz
    Member
    Posted 2 years ago #

    Great! Thank you for being such a responsive developer - you're a credit to WP :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic