diff --git a/src/ogr2ogr.php b/src/ogr2ogr.php index cc2aef1..c748230 100644 --- a/src/ogr2ogr.php +++ b/src/ogr2ogr.php @@ -397,8 +397,8 @@ private function _setCommand() : string $this->_command = sprintf( 'ogr2ogr %s %s %s %s', $options, - escapeshellarg($this->_destination), - escapeshellarg($this->_source), + preg_match('/^[a-z]{2,}:/', $this->_destination) === 1 ? $this->_destination : escapeshellarg($this->_destination), + preg_match('/^[a-z]{2,}:/', $this->_source) === 1 ? $this->_source : escapeshellarg($this->_source), implode(' ', $this->_layers) ); diff --git a/src/ogrinfo.php b/src/ogrinfo.php index 7ddd235..7d443fa 100644 --- a/src/ogrinfo.php +++ b/src/ogrinfo.php @@ -183,7 +183,7 @@ private function _setCommand() : string $this->_command = sprintf( 'ogrinfo %s %s %s', $options, - escapeshellarg($this->_source), + preg_match('/^[a-z]{2,}:/', $this->_source) === 1 ? $this->_source : escapeshellarg($this->_source), implode(' ', $this->_layers) );