0

I have ajax login form, and a lost password link that gets it's url with wp_lostpassword_url() function.

When I validate the page I get

Error: & did not start a character reference. (& probably should have been escaped as &.)

On line where that link is. Can that be fixed somehow?

I have woocommerce active so it sends me to woocommerce page for login.

I could create a custom function that will send user to default forgotten password page

mysite.com/theme/wp-login.php?action=lostpassword

But that would be a last resort solution.

EDIT:

https://github.com/woothemes/woocommerce/search?utf8=%E2%9C%93&q=wc_lostpassword_url

The function has to be escaped properly with esc_url().

1
  • Is this a woocommerce issue? – dingo_d Feb 27 '15 at 12:40
0

Please post the line of code that uses wp_lostpassword_url()

(Can't comment not enough rep :()

6
  • It's just <a class="lost" href="<?php echo wp_lostpassword_url(); ?>"><?php esc_attr_e('Lost your password?','theme') ?></a> – dingo_d Feb 27 '15 at 13:00
  • Can you try <a class="lost" href="<?php echo urlencode(wp_lostpassword_url()); ?>"><?php esc_attr_e('Lost your password?','theme') ?></a> – Jason Murray Feb 27 '15 at 13:07
  • urlencode messed up my url, but apparently esc_url() fixed the issue :) Thanks for the tip :) – dingo_d Feb 27 '15 at 13:19
  • No problem. Wonder what the issue is. I know WooCommerce pages do parse code differently such as line breaks etc. – Jason Murray Feb 27 '15 at 13:24
  • It turns out that it's just how it should go: github.com/woothemes/woocommerce/… – dingo_d Feb 27 '15 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.