• Resolved macaw9

    (@macaw9)


    My site includes WP-Members with a login page, and the answer field for “Prove Your Humanity 5+1 = ” is gone with v6.6 & 6.6.1. I re-installed v6.5 and the answer field returned. Checked on Chrome, Firefox & Edge. Running WP 4.9.8.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The problem is with the input field for the jetpack_protect_num value.

    In /modules/protect/math-fallback.php, in the math_form() method, the input field is defined and contains line breaks after each attribute of the HTML tag. The problem is that there is no whitespace before the linebreak.

    This isn’t an issue when the used in something like wp-login.php (which is where this is most commonly used) because those line breaks are maintained. However, in order for something like WP-Members to allow the login_form action hook to work in a situation where the form HTML is assembled and returned for display, the output has to be buffered and collected to be added to a variable. ob_get_contents() is used for this. In that kind of instance, line breaks are not maintained.

    Because there is no whitespace between linebreaks, the result is a tag like this:

    
    <inputtype="text"id="jetpack_protect_answer"name="jetpack_protect_num"value=""size="2"style="width:30px;height:25px;vertical-align:middle;font-size:13px;"class="input" />

    All that is needed to resolve this is to add a space at each line break where the tag is defined (lines 133 to 140 of /modules/protect/math-fallback.php).

    Hopefully, the developers will consider this update for 6.6 so that this can continue to be used in front end applications that need to buffer output. Otherwise, it will remain incompatible.

    I’ve created a pull request on GitHub for this issue.
    https://github.com/Automattic/jetpack/pull/10306

    Plugin Contributor Richard Archambault

    (@richardmtl)

    Thanks for the PR, @cbutlerjr! I’ll mark this as Resolved then.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Prove Your Humanity answer field missing on WP-Members login page’ is closed to new replies.