diff --git a/ChangeLog b/ChangeLog index da29a4ea75..662172dc7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,6 +37,7 @@ phpMyAdmin - ChangeLog - issue #13387 Fixed inline editing of hex values - issue #13382 Fixed size of index edit dialog - issue #13489 Fixed rendering SQL lint errors +- issue #13468 Avoid breakage if set_time_limit is disabled 4.7.2 (2017-06-29) - issue #13314 Make theme selection keep current server diff --git a/export.php b/export.php index 1775abf6f3..54a3c2ec9b 100644 --- a/export.php +++ b/export.php @@ -10,6 +10,7 @@ use PhpMyAdmin\Core; use PhpMyAdmin\Encoding; use PMA\libraries\plugins\ExportPlugin; use PhpMyAdmin\Url; +use PhpMyAdmin\Util; use PhpMyAdmin\Sanitize; /** @@ -295,7 +296,7 @@ if (!empty($_REQUEST['aliases'])) { /** * Increase time limit for script execution and initializes some variables */ -@set_time_limit($cfg['ExecTimeLimit']); +Util::setTimeLimit(); if (! empty($cfg['MemoryLimit'])) { @ini_set('memory_limit', $cfg['MemoryLimit']); } diff --git a/import.php b/import.php index bea76f5d84..b98cbed3a1 100644 --- a/import.php +++ b/import.php @@ -14,6 +14,7 @@ use PMA\libraries\plugins\ImportPlugin; use PhpMyAdmin\Response; use PhpMyAdmin\Sql; use PhpMyAdmin\Url; +use PhpMyAdmin\Util; /* Enable LOAD DATA LOCAL INFILE for LDI plugin */ if (isset($_POST['format']) && $_POST['format'] == 'ldi') { @@ -291,7 +292,7 @@ if (strlen($db) > 0) { $GLOBALS['dbi']->selectDb($db); } -@set_time_limit($cfg['ExecTimeLimit']); +Util::setTimeLimit(); if (! empty($cfg['MemoryLimit'])) { @ini_set('memory_limit', $cfg['MemoryLimit']); } diff --git a/libraries/classes/Util.php b/libraries/classes/Util.php index 82f7791fdb..3bbf0b41ca 100644 --- a/libraries/classes/Util.php +++ b/libraries/classes/Util.php @@ -4890,4 +4890,17 @@ class Util } return date($format); } + + /** + * Wrapper around php's set_time_limit + * + * @return void + */ + public static function setTimeLimit() + { + // The function can be disabled in php.ini + if (function_exists('set_time_limit')) { + @set_time_limit($GLOBALS['cfg']['ExecTimeLimit']); + } + } }