mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Test for null names passed to these functions as a safety precaution.
This commit is contained in:
parent
098820e224
commit
8bf2e9e539
@ -114,6 +114,9 @@ function stop_service($name) {
|
||||
global $config;
|
||||
global $rcfileprefix;
|
||||
|
||||
if (empty($name))
|
||||
return;
|
||||
|
||||
if ($config['installedpackages']['service']) {
|
||||
foreach($config['installedpackages']['service'] as $service) {
|
||||
if(strtolower($service['name']) == strtolower($name)) {
|
||||
@ -147,6 +150,9 @@ function stop_service($name) {
|
||||
function restart_service($name) {
|
||||
global $config;
|
||||
|
||||
if (empty($name))
|
||||
return;
|
||||
|
||||
stop_service($name);
|
||||
start_service($name);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user