diff --git a/autoload/Domain/Article/ArticleRepository.php b/autoload/Domain/Article/ArticleRepository.php index bd1a360..fb71159 100644 --- a/autoload/Domain/Article/ArticleRepository.php +++ b/autoload/Domain/Article/ArticleRepository.php @@ -850,6 +850,8 @@ class ArticleRepository $full = realpath('../' . ltrim($src, '/')); if ($full && strpos($full, $base . DIRECTORY_SEPARATOR) === 0 && is_file($full)) { unlink($full); + } elseif ($full) { + error_log( '[shopPRO] safeUnlink: ścieżka poza upload/: ' . $src ); } } diff --git a/autoload/Domain/Integrations/IntegrationsRepository.php b/autoload/Domain/Integrations/IntegrationsRepository.php index 545269d..8b9f478 100644 --- a/autoload/Domain/Integrations/IntegrationsRepository.php +++ b/autoload/Domain/Integrations/IntegrationsRepository.php @@ -159,10 +159,15 @@ class IntegrationsRepository if ( empty( $response['accessToken'] ) ) return false; - $this->saveSetting( 'apilo', 'access-token', $response['accessToken'] ); - $this->saveSetting( 'apilo', 'refresh-token', $response['refreshToken'] ); - $this->saveSetting( 'apilo', 'access-token-expire-at', $response['accessTokenExpireAt'] ); - $this->saveSetting( 'apilo', 'refresh-token-expire-at', $response['refreshTokenExpireAt'] ); + try { + $this->saveSetting( 'apilo', 'access-token', $response['accessToken'] ); + $this->saveSetting( 'apilo', 'refresh-token', $response['refreshToken'] ); + $this->saveSetting( 'apilo', 'access-token-expire-at', $response['accessTokenExpireAt'] ); + $this->saveSetting( 'apilo', 'refresh-token-expire-at', $response['refreshTokenExpireAt'] ); + } catch ( \Exception $e ) { + error_log( '[shopPRO] Apilo: błąd zapisu tokenów: ' . $e->getMessage() ); + return false; + } return true; } diff --git a/autoload/Domain/Product/ProductRepository.php b/autoload/Domain/Product/ProductRepository.php index c546bd0..ddef888 100644 --- a/autoload/Domain/Product/ProductRepository.php +++ b/autoload/Domain/Product/ProductRepository.php @@ -2140,6 +2140,8 @@ class ProductRepository $full = realpath('../' . ltrim($src, '/')); if ($full && strpos($full, $base . DIRECTORY_SEPARATOR) === 0 && is_file($full)) { unlink($full); + } elseif ($full) { + error_log( '[shopPRO] safeUnlink: ścieżka poza upload/: ' . $src ); } } diff --git a/cron.php b/cron.php index a6bed4f..b98557d 100644 --- a/cron.php +++ b/cron.php @@ -1,5 +1,5 @@