Skip to content

Problem with https images #23

@quentinchauveau

Description

@quentinchauveau

Hi,

I am working with zend 2 and WebinoImageThumb, and i realize there is a bug with https image.
If i put an https image, i get a "Image file not found:" error from this code:

protected function fileExistsAndReadable ()
{
		if ($this->isDataStream === true)
		{
			return;
		}

		if (stristr($this->fileName, 'http://') !== false)
		{
			$this->remoteImage = true;
			return;
		}

		if (!file_exists($this->fileName))
		{
			$this->triggerError('Image file not found: ' . $this->fileName);
		}
		elseif (!is_readable($this->fileName))
		{
			$this->triggerError('Image file not readable: ' . $this->fileName);
		}
}

So i changed it:

if (stristr($this->fileName, 'http://') !== false || stristr($this->fileName, 'https://') !== false)
{
	$this->remoteImage = true;
	return;
}

I wonder if there is any reason that https wasn't considered here?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions