mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
handle empty paths
This commit is contained in:
parent
b538cf38d0
commit
83388c4ffc
1 changed files with 5 additions and 0 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
namespace Icewind\SMB;
|
namespace Icewind\SMB;
|
||||||
|
|
||||||
|
use Icewind\SMB\Exception\InvalidPathException;
|
||||||
use Icewind\SMB\Exception\InvalidResourceException;
|
use Icewind\SMB\Exception\InvalidResourceException;
|
||||||
|
|
||||||
class NativeShare extends AbstractShare {
|
class NativeShare extends AbstractShare {
|
||||||
|
|
@ -195,9 +196,13 @@ class NativeShare extends AbstractShare {
|
||||||
*
|
*
|
||||||
* @throws \Icewind\SMB\Exception\NotFoundException
|
* @throws \Icewind\SMB\Exception\NotFoundException
|
||||||
* @throws \Icewind\SMB\Exception\InvalidTypeException
|
* @throws \Icewind\SMB\Exception\InvalidTypeException
|
||||||
|
* @throws \Icewind\SMB\Exception\InvalidPathException
|
||||||
* @throws \Icewind\SMB\Exception\InvalidResourceException
|
* @throws \Icewind\SMB\Exception\InvalidResourceException
|
||||||
*/
|
*/
|
||||||
public function get($source, $target) {
|
public function get($source, $target) {
|
||||||
|
if (!$target) {
|
||||||
|
throw new InvalidPathException('Invalid target path: Filename cannot be empty');
|
||||||
|
}
|
||||||
$targetHandle = @fopen($target, 'wb');
|
$targetHandle = @fopen($target, 'wb');
|
||||||
if (!$targetHandle) {
|
if (!$targetHandle) {
|
||||||
$error = error_get_last();
|
$error = error_get_last();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue