elementor / elementor/static-html-output

Critical error when <img srcset="">

Open
#129 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
PHP
Stars
128
Forks
35
PR merge metrics
No merged PRs in 30d

Description

I'm not entirely sure why some of my images acquired an empty srcset="", but it is crashing the build due to HTMLProcessor.php line 635 expecting a string. I was able to work around this by getting rid of that blank attribute, but it is seems it could plausibly happen when someone else is using a site layout tool like I was which stuck those in there for some unknown reason. Here is the full log w/ stack trace:

```
Notice: Undefined offset: 0 in /sites/[website]/files/wp-content/plugins/static-html-output-plugin/src/HTMLProcessor.php on line 631
Notice: Undefined offset: 1 in /sites/[website]/files/wp-content/plugins/static-html-output-plugin/src/HTMLProcessor.php on line 632
Fatal error: Uncaught TypeError: Argument 1 passed to StaticHTMLOutput\HTMLProcessor::isInternalLink() must be of the type string, null given, called in /sites/[website]/files/wp-content/plugins/static-html-output-plugin/src/HTMLProcessor.php on line 635 and defined in /sites/[website]/files/wp-content/plugins/static-html-output-plugin/src/HTMLProcessor.php:864
Stack trace:
#0 /sites/[website]/files/wp-content/plugins/static-html-output-plugin/src/HTMLProcessor.php(635): StaticHTMLOutput\HTMLProcessor->isInternalLink()
#1 /sites/[website]/files/wp-content/plugins/static-html-output-plugin/src/HTMLProcessor.php(454): StaticHTMLOutput\HTMLProcessor->processImageSrcSet()
#2 /sites/[website]/files/wp-content/plugins/static-html-output-plugin/src/SiteCrawler.php(331): StaticHTMLOutput\HTMLProcessor->processHTML()
#3 /sites/[website]/files/wp-content/plugins/static-html-output-plugin/src/SiteCrawler.php(203): StaticHTMLOutput\SiteCrawler->loadFileForProcess in /sites/[website]/files/wp-content/plugins/static-html-output-plugin/src/HTMLProcessor.php on line 864
Error: There has been a critical error on your website.Learn more about debugging in WordPress. There has been a critical error on your website.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.