--- a/app/Services/CarCatalogService.php +++ b/app/Services/CarCatalogService.php @@ -355,7 +355,7 @@ $order = 'ORDER BY s.sort_order IS NULL, s.sort_order, s.car_price, s.sale_model_code LIMIT 1'; $r = $this->db->query( "SELECT s.main_image_path p FROM cars_app.sale_models s - WHERE s.car_code = ? AND s.sale_model_code <> ? AND s.main_image_path IS NOT NULL AND s.main_image_path <> '' $order", [$carCode, $sm] + WHERE s.car_code = ? AND s.sale_model_code <> ? AND s.main_image_path IS NOT NULL AND s.main_image_path <> '' AND s.main_image_path NOT LIKE 'http%' $order", [$carCode, $sm] // 바깥 절대 주소(MB 26 · VW 5 트림 · 이용 허락 전 공식 사진)는 대체 후보에서 뺌 — imgUrl 이 자산 주소를 앞에 붙여 주소가 깨짐(11/26 브라우저 확인) )->getRowArray(); if ($r) return $this->imgUrl($r['p'], null, $makerCode); $o = $this->db->query( @@ -376,7 +376,7 @@ private function imgUrl(?string $local, ?string $remote, string $makerCode): ?string { - if ($local !== null && $local !== '') return self::ASSET_BASE . $local; + if ($local !== null && $local !== '' && !str_starts_with($local, 'http')) return self::ASSET_BASE . $local; // 사진 경로 칸의 바깥 절대 주소(MB 26 · VW 5 트림)는 안 씀 — 자산 주소를 앞에 붙이면 깨진 요청 · 그대로 쓰면 이용 허락 전 바깥 사진(11/26) · 바깥 주소 칸(remote) 허용 범위는 그대로 if ($remote !== null && $remote !== '') { if (str_starts_with($remote, 'http')) return $remote; if (isset(self::MAKER_WEB[$makerCode])) return self::MAKER_WEB[$makerCode] . $remote;