Avoid warning if maintenance file does not exist in maintenance plugin - refs BT#12478

pull/2487/head
Yannick Warnier 9 years ago
parent a2dbff0c0b
commit 3ba8fd0184
  1. 12
      plugin/edit_htaccess/plugin.php

@ -1,5 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Maintenance mode facilitator plugin
* @package chamilo.plugin
*/
//the plugin title
$plugin_info['title'] = 'Edit htaccess';
@ -95,7 +100,10 @@ if ($editFile && api_is_platform_admin()) {
);
$form->addButtonSave(get_lang('Save'));
$content = file_get_contents($maintenanceHtml);
$content = '';
if (is_file($maintenanceHtml)) {
$content = file_get_contents($maintenanceHtml);
}
if (empty($content)) {
$content = '<html><head><title></title></head><body></body></html>';
}
@ -106,7 +114,7 @@ if ($editFile && api_is_platform_admin()) {
$append = api_get_configuration_value('url_append');
$default = '
RewriteCond %{REQUEST_URI} !'.$append.'/maintenance.html$
RewriteCond %{REQUEST_URI} !'.$append.'/maintenance.html$
RewriteCond %{REMOTE_HOST} !^'.$implode.'
RewriteRule \.*$ '.$append.'/maintenance.html [R=302,L]
';

Loading…
Cancel
Save