mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 08:34:39 +00:00
mvc: this looks unsafe, adapt to what exec_safe() is doing
This commit is contained in:
parent
b2b926d7ad
commit
a65b09f051
@ -1,8 +1,7 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
/*
|
||||
* Copyright (C) 2015 Deciso B.V.
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -25,8 +24,8 @@
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OPNsense\Core;
|
||||
|
||||
use Phalcon\Logger\Adapter\Syslog;
|
||||
@ -142,9 +141,13 @@ class Backend
|
||||
*/
|
||||
public function configdpRun($event, $params = array(), $detach = false, $timeout = 120)
|
||||
{
|
||||
if (!is_array($params)) {
|
||||
/* just in case there's only one parameter */
|
||||
$params = array($params);
|
||||
}
|
||||
|
||||
foreach ($params as $param) {
|
||||
// quote parameters
|
||||
$event .= ' "' . str_replace('"', '\\"', $param) . '"';
|
||||
$event .= ' ' . escapeshellarg($param);
|
||||
}
|
||||
|
||||
return $this->configdRun($event, $detach, $timeout);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user