| Conditions | 6 |
| Paths | 9 |
| Total Lines | 36 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function preProcess() { |
||
| 29 | global $conf; |
||
| 30 | |||
| 31 | if($conf['sitemap'] < 1 || !is_numeric($conf['sitemap'])) { |
||
| 32 | throw new FatalException('Sitemap generation is disabled', 404); |
||
| 33 | } |
||
| 34 | |||
| 35 | $sitemap = Sitemap::getFilePath(); |
||
|
|
|||
| 36 | if(Sitemap::sitemapIsCompressed()) { |
||
| 37 | $mime = 'application/x-gzip'; |
||
| 38 | } else { |
||
| 39 | $mime = 'application/xml; charset=utf-8'; |
||
| 40 | } |
||
| 41 | |||
| 42 | // Check if sitemap file exists, otherwise create it |
||
| 43 | if(!is_readable($sitemap)) { |
||
| 44 | Sitemap::generate(); |
||
| 45 | } |
||
| 46 | |||
| 47 | if(is_readable($sitemap)) { |
||
| 48 | // Send headers |
||
| 49 | header('Content-Type: ' . $mime); |
||
| 50 | header('Content-Disposition: attachment; filename=' . \dokuwiki\Utf8\PhpString::basename($sitemap)); |
||
| 51 | |||
| 52 | http_conditionalRequest(filemtime($sitemap)); |
||
| 53 | |||
| 54 | // Send file |
||
| 55 | //use x-sendfile header to pass the delivery to compatible webservers |
||
| 56 | http_sendfile($sitemap); |
||
| 57 | |||
| 58 | readfile($sitemap); |
||
| 59 | exit; |
||
| 60 | } |
||
| 61 | |||
| 62 | throw new FatalException('Could not read the sitemap file - bad permissions?'); |
||
| 63 | } |
||
| 64 | |||
| 66 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.