security: faza 3 - error handling w krytycznych sciezkach
- cron.php: przywrocono E_WARNING i E_DEPRECATED (wyciszono tylko E_NOTICE i E_STRICT) - IntegrationsRepository: try-catch po zapisie tokenow Apilo - blad DB nie sklada false po cichu - ProductRepository/ArticleRepository: error_log gdy safeUnlink wykryje sciezke poza upload/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user