瀏覽代碼

adding no-image image and fixing displaying of images

Medowar 1 月之前
父節點
當前提交
97924f949c
共有 4 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      .htaccess
  2. 二進制
      assets/no-image.jpg
  3. 1 1
      index.php
  4. 1 1
      product.php

+ 2 - 2
.htaccess

@@ -14,8 +14,8 @@ Options -Indexes
     # Block hidden files/folders except ACME challenge path.
     RewriteRule "(^|/)\.(?!well-known/)" - [F]
 
-    # Deny direct access to writable data directory (centralized, no data/.htaccess needed).
-    RewriteRule ^data(?:/|$) - [F,L]
+    # Deny direct access to writable data directory except uploads.
+    RewriteRule ^data/(?!uploads/)(?:/|$) - [F,L]
 </IfModule>
 
 <IfModule mod_authz_core.c>

二進制
assets/no-image.jpg


+ 1 - 1
index.php

@@ -68,7 +68,7 @@ $categoryOption["id"]
                             $imageUrl,
                         ); ?>" alt="<?php echo escape($product["name"]); ?>">
                     <?php else: ?>
-                        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='200'%3E%3Crect fill='%233a4150' width='250' height='200'/%3E%3Ctext x='50%25' y='50%25' text-anchor='middle' dy='.3em' fill='%23c7ccd6'%3EKein Bild%3C/text%3E%3C/svg%3E" alt="Kein Bild">
+                        <img src="assets/no-image.jpg" alt="Kein Bild verfügbar">
                     <?php endif; ?>
                 </a>
                 <div class="product-card-content">

+ 1 - 1
product.php

@@ -81,7 +81,7 @@ include __DIR__ . "/includes/header.php";
                 $imageUrl,
             ); ?>" alt="<?php echo escape($product["name"]); ?>">
         <?php else: ?>
-            <div class="product-placeholder">Kein Bild verfügbar</div>
+            <img class="product-image" src="assets/no-image.jpg" alt="Kein Bild verfügbar">
         <?php endif; ?>
     </div>