Skip to content

Base64 encoding does not work #4

@blablabla1234678

Description

@blablabla1234678

I am trying to use base64 encoded image, but it runs on this error:

Typed property SimpleCaptcha\Builder::$image must not be accessed before initialization

#0 /.../vendor/s1syphos/php-simple-captcha/src/Builder.php(1016): SimpleCaptcha\Builder->gd2img()
#1 /.../vendor/s1syphos/php-simple-captcha/src/Builder.php(1031): SimpleCaptcha\Builder->output()
#2 /.../vendor/s1syphos/php-simple-captcha/src/Builder.php(1046): SimpleCaptcha\Builder->fetch()
#3 /.../presentation/template/registration.php(23): SimpleCaptcha\Builder->inline()

All I do is instantiating the Builder class with the captcha string (only English characters and numbers) and calling the inline method:

        return $this->renderer->render($response, 'registration.php', [
            'csrf' => $this->csrf, 
            'captcha' => new CaptchaBuilder($this->security->getCaptcha()), 
            'values' => $values, 
            'errors' => $errors
        ]);
<img src="<?php $html->addAttribute($captcha->inline()); ?>" />

I guess the bug is in your code. https://stackoverflow.com/a/59265626/607033

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions