-
-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow user to explicitly use a local file for html content.
Sometimes it is necessary to have all the html contents in a local file rather than on a url or in a PHP string due to memory limits. The introduced function htmlFromFilePath makes it clear you are intending to set the html from a local file, and there for if the input is not being generated by the user themselves, they should validate the file path is allowed before allowing it to be used.
- Loading branch information
1 parent
e7041d0
commit 554c3e5
Showing
4 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Spatie\Browsershot\Exceptions; | ||
|
||
use Exception; | ||
|
||
class FileDoesNotExistException extends Exception | ||
{ | ||
public function __construct($file) | ||
{ | ||
parent::__construct("The file `{$file} does not exist"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters