Browse Source

fix captcha key name in session storage

main
ghost 7 months ago
parent
commit
836650ec87
  1. 12
      src/server.php

12
src/server.php

@ -88,7 +88,7 @@ $server->setWelcome(
); );
// Set captcha value to the session code // Set captcha value to the session code
$session[$connect]['captcha'] = $captcha->getPhrase(); $session[$connect]['code'] = $captcha->getPhrase();
// Create ASCII confirmation code // Create ASCII confirmation code
$image = new \Ixnode\PhpCliImage\CliImage( $image = new \Ixnode\PhpCliImage\CliImage(
@ -112,7 +112,7 @@ $server->setWelcome(
(string) date('c'), (string) date('c'),
(string) $session[$connect]['host'], (string) $session[$connect]['host'],
(string) $session[$connect]['port'], (string) $session[$connect]['port'],
(string) $session[$connect]['captcha'] (string) $session[$connect]['code']
], ],
$config->nps->action->welcome->debug->template $config->nps->action->welcome->debug->template
) . PHP_EOL ) . PHP_EOL
@ -161,14 +161,14 @@ $server->setPending(
(string) $session[$connect]['host'], (string) $session[$connect]['host'],
(string) $session[$connect]['port'], (string) $session[$connect]['port'],
(string) $request, (string) $request,
(string) $session[$connect]['captcha'] (string) $session[$connect]['code']
], ],
$config->nps->action->pending->debug->template $config->nps->action->pending->debug->template
) . PHP_EOL ) . PHP_EOL
); );
} }
return $session[$connect]['captcha'] == $request ? implode(PHP_EOL, $config->nps->action->pending->message->success) . PHP_EOL return $session[$connect]['code'] == $request ? implode(PHP_EOL, $config->nps->action->pending->message->success) . PHP_EOL
: implode(PHP_EOL, $config->nps->action->pending->message->failure) . PHP_EOL; : implode(PHP_EOL, $config->nps->action->pending->message->failure) . PHP_EOL;
} }
); );
@ -217,7 +217,7 @@ $server->setHandler(
(string) $session[$connect]['host'], (string) $session[$connect]['host'],
(string) $session[$connect]['port'], (string) $session[$connect]['port'],
(string) str_replace('%', '%%', $request), (string) str_replace('%', '%%', $request),
(string) $session[$connect]['captcha'], (string) $session[$connect]['code'],
(string) mb_strlen($content), (string) mb_strlen($content),
(string) PHP_EOL . $content, (string) PHP_EOL . $content,
], ],
@ -226,7 +226,7 @@ $server->setHandler(
); );
} }
return $session[$connect]['captcha'] == $request ? implode(PHP_EOL, $config->nps->action->handler->message->success) . PHP_EOL return $session[$connect]['code'] == $request ? implode(PHP_EOL, $config->nps->action->handler->message->success) . PHP_EOL
: implode(PHP_EOL, $config->nps->action->handler->message->failure) . PHP_EOL; : implode(PHP_EOL, $config->nps->action->handler->message->failure) . PHP_EOL;
} }
); );

Loading…
Cancel
Save