Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Error and warning #5

Open
marsaultgaetan opened this issue Nov 6, 2023 · 1 comment
Open

Fatal Error and warning #5

marsaultgaetan opened this issue Nov 6, 2023 · 1 comment

Comments

@marsaultgaetan
Copy link

Hi,
Using the iloveimg-php library I encounter :

  • 1 PHP error that I've corrected in the file iloveimg-php/src/ImageTask.php :

    • In function toBrowser()

      • line 263 header("Content-Type:application/pdf")
        changed by header("content-type:application/pdf")
      • line 264 header("Content-Disposition:attachment; filename=\"" . $this->outputFileName . "\"");
        changed by header("content-disposition:attachment; filename=\"" . $this->outputFileName . "\"");
      • line 271 header("Content-Type: application/zip);
        changed by header("content-type: application/zip);
      • line 272 header("Content-Disposition: attachment; filename=\"" . $this->outputFileName . "\"");
        changed by header("content-disposition:attachment; filename=\"" . $this->outputFileName . "\"");
      • line 273 header("Content-Length: " . $size);
        changed by header("lontent-length: " . $size);
    • In function downloadFile($task)

      • line 293 if(preg_match("/filename\*\=utf-8\'\'([\W\w]+)/", $response->headers['Content-Disposition'], $matchesUtf)) {
        changed by if(preg_match("/filename\*\=utf-8\'\'([\W\w]+)/", $response->headers['content-disposition'], $matchesUtf)) {
      • line 296 preg_math('/ .*filename=\"([\W\w]+)\"/', $response->headers['Content-Disposition'], $matches);
        changed by preg_math('/ .*filename=\"([\W\w]+)\"/', $response->headers['content-disposition'], $matches);
  • 1 PHP warning in the file iloveimg-php/src/Exceptions/ExtendedExceptions.php :

    • line 20 __construct($message, $code = 0, Exception $previous = null, $response) : the function is no longer correct, you can't have a parameter without a default value ($response) after parameters that have a default value.

Is it possible you to update your library to fix this error and this warning please ? Thanks !

@maztch
Copy link
Collaborator

maztch commented Nov 9, 2023

Content-Type (and headers) - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type, it's case insensitive. It's not an issue.

regext should be insensitive, change the header is not the solution. I'll set it to insensitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants