Guest User

Untitled

a guest
Oct 4th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.21 KB | None | 0 0
  1.     public function getFormInformation( $tabIndex = 1 ) {
  2.  
  3.         if ( isset( $this->captchaFallback ) && $this->captchaFallback ) {
  4.             $captcha = $this->getCaptcha();
  5.             $index = $this->storeCaptcha( $captcha );
  6.  
  7.             return [
  8.                 'html' => "<p><label for=\"wpCaptchaWord\">{$captcha['question']} = </label>" .
  9.                           Xml::element( 'input', [
  10.                               'name' => 'wpCaptchaWord',
  11.                               'class' => 'mw-ui-input',
  12.                               'id' => 'wpCaptchaWord',
  13.                               'size' => 5,
  14.                               'autocomplete' => 'off',
  15.                               'tabindex' => $tabIndex
  16.                           ] ) . // tab in before the edit textarea
  17.                           "</p>\n" . Xml::element( 'input', [
  18.                         'type' => 'hidden',
  19.                         'name' => 'wpCaptchaId',
  20.                         'id' => 'wpCaptchaId',
  21.                         'value' => $index
  22.                     ] )
  23.             ];
  24.         } else {
  25.             $this->captchaFallback = true;
  26.             //create Invisible captcha
  27.             return [
  28.                 'html' => "<button type=\"button\" onclick='document.getElementsByTagName(wpCaptchaFallback).value = false'>pass<\button>".
  29.                           "<script></script>".
  30.                           Xml::element( 'input', [
  31.                               'type' => 'hidden',
  32.                               'name' => 'wpCaptchaFallback',
  33.                               'id' => 'wpCaptchaFallback',
  34.                               'value' => $this->captchaFallback
  35.                           ] )
  36.             ];
  37.  
  38.         }
  39.     }
Add Comment
Please, Sign In to add comment