Commit b27b7dd
Fix TypeError in ImageModal when file does not exist
The ImageBeforeProduceHTML hook passes File|false for the $file
parameter. When a page references a non-existent file, $file is false.
ImageModal::__construct() has a strict File type hint, causing a
TypeError.
Add a guard to skip modal replacement when the file does not exist,
letting MediaWiki render its normal missing-file link instead.
Bug: #711 parent 21785bb commit b27b7dd
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
143 | 146 | | |
144 | 147 | | |
145 | 148 | | |
| |||
0 commit comments