|
38 | 38 | 'places-hero' => 'Places to visit banner', |
39 | 39 | 'services-hero' => 'What we hire banner', |
40 | 40 |
|
| 41 | + // The home page, top to bottom. |
| 42 | + 'home-hero' => 'Home page background', |
| 43 | + 'why-us-1' => 'Why hire from us — large photo', |
| 44 | + 'why-us-2' => 'Why hire from us — small photo', |
| 45 | + 'open-road' => 'Open road band', |
| 46 | + |
41 | 47 | // The panel on the home page listing the towns served. |
42 | 48 | 'coast' => 'Areas we serve panel', |
| 49 | + |
| 50 | + // The six cards under "What we hire", on the home page and on /services. |
| 51 | + // Named after the page each one links to, which is what the site asks for. |
| 52 | + 'cars' => 'Card: self drive cars', |
| 53 | + 'bikes' => 'Card: bike rental', |
| 54 | + 'wedding-cars' => 'Card: wedding cars', |
| 55 | + 'tourist-vehicles' => 'Card: tourist vehicles', |
| 56 | + 'monthly' => 'Card: monthly rental', |
| 57 | + 'nri' => 'Card: for NRI visitors', |
| 58 | + |
| 59 | + // The three "How it works" steps. |
| 60 | + 'step-1' => 'How it works: step 1', |
| 61 | + 'step-2' => 'How it works: step 2', |
| 62 | + 'step-3' => 'How it works: step 3', |
43 | 63 | ]; |
44 | 64 |
|
45 | 65 | function site_image_dir(): string |
@@ -105,9 +125,11 @@ function site_image_save(string $slot, array $file, int $userId): ?string |
105 | 125 | // Our name, never the uploader's: a filename from a browser can contain |
106 | 126 | // path separators, and writing outside this directory is the one thing |
107 | 127 | // that must not be possible. |
108 | | - // Hyphens kept: stripping them turned cars-hero into carshero, which is |
109 | | - // still unique but tells a reader nothing. brand.php's pattern allows them. |
110 | | - $name = sprintf('b%s-%s.%s', preg_replace('/[^a-z-]/', '', $slot), |
| 128 | + // Hyphens and digits kept: stripping hyphens turned cars-hero into |
| 129 | + // carshero, and stripping digits turned step-1, step-2 and step-3 into |
| 130 | + // three files all called step-. Still unique, and it tells a reader |
| 131 | + // nothing. brand.php's pattern allows both. |
| 132 | + $name = sprintf('b%s-%s.%s', preg_replace('/[^a-z0-9-]/', '', $slot), |
111 | 133 | bin2hex(random_bytes(8)), $extension); |
112 | 134 |
|
113 | 135 | if (!move_uploaded_file((string) $file['tmp_name'], site_image_dir() . '/' . $name)) { |
|
0 commit comments