Files
progcode/web/public/assets/editorial/2018/php-upload-trust-signals.svg
T
huncode 90692f0f16
Build and deploy / deploy (push) Successful in 15s
raise editorial quality gate and revise 2018 spring
2026-07-31 09:20:37 +03:00

87 lines
5.9 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 900" role="img" aria-labelledby="title desc">
<title id="title">Границы доверия при загрузке файла</title>
<desc id="desc">Диаграмма показывает клиентские метаданные, результат PHP, Fileinfo и решение приложения.</desc>
<defs>
<linearGradient id="panel" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#ffffff"/>
<stop offset="1" stop-color="#f5f8fb"/>
</linearGradient>
<filter id="soft-shadow" x="-20%" y="-20%" width="140%" height="140%">
<feDropShadow dx="0" dy="12" stdDeviation="16" flood-color="#142b3d" flood-opacity=".10"/>
</filter>
<marker id="flow-arrow" viewBox="0 0 12 12" refX="11" refY="6" markerWidth="10" markerHeight="10" orient="auto">
<path d="M 0 1 L 11 6 L 0 11 z" fill="#47687b"/>
</marker>
<style>
.title { font: 700 44px Inter, Arial, sans-serif; fill: #17324a; }
.subtitle { font: 400 23px Inter, Arial, sans-serif; fill: #597080; }
.lane { font: 700 17px Inter, Arial, sans-serif; letter-spacing: 2.2px; }
.box-title { font: 700 27px Inter, Arial, sans-serif; fill: #17324a; }
.box-copy { font: 400 20px Inter, Arial, sans-serif; fill: #466174; }
.mono { font: 600 18px Menlo, Consolas, monospace; fill: #2f6174; }
.small { font: 600 16px Inter, Arial, sans-serif; fill: #6b7d8d; }
</style>
</defs>
<rect width="1600" height="900" fill="#f5f8fb"/>
<rect x="0" y="0" width="500" height="900" fill="#fff4ed"/>
<rect x="500" y="0" width="520" height="900" fill="#eef5fb"/>
<rect x="1020" y="0" width="580" height="900" fill="#eef8f4"/>
<text x="94" y="104" class="title">Загрузка — это не один сигнал, а несколько границ</text>
<text x="94" y="146" class="subtitle">Слева — то, что заявил клиент. Справа — то, на чём приложение строит решение.</text>
<text x="106" y="226" class="lane" fill="#c5682d">СВЕДЕНИЯ КЛИЕНТА</text>
<text x="605" y="226" class="lane" fill="#4579a8">РЕЗУЛЬТАТ PHP</text>
<text x="1125" y="226" class="lane" fill="#27846e">РЕШЕНИЕ ПРИЛОЖЕНИЯ</text>
<line x1="500" y1="184" x2="500" y2="774" stroke="#d78253" stroke-width="3" stroke-dasharray="10 12"/>
<line x1="1020" y1="184" x2="1020" y2="774" stroke="#65a18f" stroke-width="3" stroke-dasharray="10 12"/>
<g filter="url(#soft-shadow)">
<rect x="106" y="278" width="300" height="130" rx="20" fill="url(#panel)"/>
<text x="138" y="326" class="box-title">Имя и расширение</text>
<text x="138" y="364" class="mono">avatar.jpg</text>
<text x="138" y="394" class="box-copy">Удобны для интерфейса.</text>
<rect x="106" y="452" width="300" height="130" rx="20" fill="url(#panel)"/>
<text x="138" y="500" class="box-title">Content-Type</text>
<text x="138" y="538" class="mono">image/jpeg</text>
<text x="138" y="568" class="box-copy">Это поле multipart-части.</text>
</g>
<g filter="url(#soft-shadow)">
<rect x="606" y="278" width="310" height="130" rx="20" fill="url(#panel)"/>
<text x="638" y="326" class="box-title">Доставка</text>
<text x="638" y="364" class="mono">UPLOAD_ERR_OK</text>
<text x="638" y="394" class="box-copy">PHP принял файл целиком.</text>
<rect x="606" y="452" width="310" height="130" rx="20" fill="url(#panel)"/>
<text x="638" y="500" class="box-title">Временный файл</text>
<text x="638" y="538" class="mono">tmp_name · size</text>
<text x="638" y="568" class="box-copy">Есть что проверять на сервере.</text>
</g>
<g filter="url(#soft-shadow)">
<rect x="1126" y="278" width="354" height="130" rx="20" fill="url(#panel)"/>
<text x="1158" y="326" class="box-title">Fileinfo</text>
<text x="1158" y="364" class="mono">finfo_file()</text>
<text x="1158" y="394" class="box-copy">Определяет тип временного файла.</text>
<rect x="1126" y="452" width="354" height="130" rx="20" fill="url(#panel)"/>
<text x="1158" y="500" class="box-title">Белый список</text>
<text x="1158" y="538" class="mono">JPEG / PNG / 2 МБ</text>
<text x="1158" y="568" class="box-copy">Правило конкретного сценария.</text>
</g>
<path d="M406 343 C475 343 516 343 606 343" fill="none" stroke="#d78253" stroke-width="6" stroke-linecap="round" marker-end="url(#flow-arrow)"/>
<path d="M406 517 C480 517 532 517 606 517" fill="none" stroke="#d78253" stroke-width="6" stroke-linecap="round" marker-end="url(#flow-arrow)"/>
<path d="M916 343 C985 343 1051 343 1126 343" fill="none" stroke="#4e8ab8" stroke-width="6" stroke-linecap="round" marker-end="url(#flow-arrow)"/>
<path d="M916 517 C985 517 1051 517 1126 517" fill="none" stroke="#4e8ab8" stroke-width="6" stroke-linecap="round" marker-end="url(#flow-arrow)"/>
<rect x="106" y="665" width="1374" height="102" rx="22" fill="#ffffff" stroke="#cfdfd9" stroke-width="2"/>
<circle cx="156" cy="716" r="19" fill="#27846e"/>
<path d="M147 716 l7 7 l14 -17" fill="none" stroke="#ffffff" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
<text x="203" y="708" class="box-title">Практическое правило</text>
<text x="203" y="742" class="box-copy">Имя и клиентский MIME-тип не определяют допуск. Они становятся полезными только после того, как серверный анализ и белый список дали ответ.</text>
<text x="106" y="829" class="small">Отдельная проверка размеров дополняет контракт изображения, но не заменяет проверку типа.</text>
</svg>