Skip to content

Commit

Permalink
Fix session unserialize issue when not using composer autoloader with…
Browse files Browse the repository at this point in the history
… example form and session adapter
  • Loading branch information
dapphp committed May 30, 2020
1 parent 6cf6002 commit 01966d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions StorageAdapter/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Securimage\StorageAdapter;

use Securimage\StorageAdapter\AdapterInterface;

class Session implements AdapterInterface
{
protected $session_name;
Expand Down
4 changes: 4 additions & 0 deletions example_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

require_once __DIR__ . '/securimage.php';

// if not using Composer, must require these before using session
require_once __DIR__ . '/CaptchaObject.php';
require_once __DIR__ . '/StorageAdapter/AdapterInterface.php';

session_start(); // this MUST be called prior to any output including whitespaces and line breaks!

$GLOBALS['DEBUG_MODE'] = 1;
Expand Down
2 changes: 1 addition & 1 deletion securimage.php
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ public function __construct($options = array())
}
}

if (!class_exists('Securimage\CaptchaObject')) {
if (!class_exists(\Securimage\CaptchaObject::class)) {
// not using Composer autoloader
require_once __DIR__ . '/CaptchaObject.php';
require_once __DIR__ . '/StorageAdapter/AdapterInterface.php';
Expand Down

0 comments on commit 01966d7

Please sign in to comment.