mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-26 12:46:03 +03:00
Code cleanup for Attatchment::saveAs()
This commit is contained in:
parent
b0c372ee6d
commit
6a581535e4
@ -194,14 +194,16 @@ class Attachment
|
|||||||
{
|
{
|
||||||
$dirname = dirname($path);
|
$dirname = dirname($path);
|
||||||
if (file_exists($path)) {
|
if (file_exists($path)) {
|
||||||
if (!is_writable($path))
|
if (!is_writable($path)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
} elseif (!is_dir($dirname) || !is_writable($dirname)) {
|
} elseif (!is_dir($dirname) || !is_writable($dirname)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($filePointer = fopen($path, 'w')) == false)
|
if (($filePointer = fopen($path, 'w')) == false) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($this->encoding) {
|
switch ($this->encoding) {
|
||||||
case 3:
|
case 3:
|
||||||
|
Loading…
Reference in New Issue
Block a user