10000 Escaping " in search queries in Load More Posts button by benlk · Pull Request #673 · WPBuddy/largo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Escaping " in search queries in Load More Posts button #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 14, 2015

Conversation

benlk
Copy link
Collaborator
@benlk benlk commented Apr 24, 2015

The Problem

This attempts to incorporate a fix for CUR-113:

After running this search, the "Load more posts" link at the bottom of the first page of results doesn't work.
http://current.org/?s=%22future+fund%22
However, it seems to work fine with other search terms, such as "NPR."

It fails on "future fund" and "future fund but not future fund.

Pressing the "Load more posts" button sends a query to the site with the following form data:

action:load_more_posts
paged:2
is_home:false
is_series_landing:false
last:26553
query[post__not_in]:
query[s]:\"future fund\"

This fix escapes the query vars with JSON.stringify() on the LMP.query args array:

action:load_more_posts
paged:2
is_home:false
is_series_landing:false
last:26553
query:{"post__not_in":null,"s":"\\\"future fund\\\""}

And then strips the slashes before running the query.

However, tests are failing, regarding the value of the paged parameter, and it appears to be affecting the pagination of posts on category pages.

This PR is a WIP until those get fixed.

@rnagle rnagle self-assigned this Jul 13, 2015
@rnagle rnagle merged commit 030571d into develop Jul 14, 2015
@rnagle rnagle deleted the CUR-113-stripslashes-on-LMP branch July 14, 2015 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0