use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Photo;
*
* Question: Do we really need these three methods?
*/
- if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
+ if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
header('HTTP/1.1 304 Not Modified');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header('Etag: ' . $_SERVER['HTTP_IF_NONE_MATCH']);
$direct_cache = false;
}
+ if (empty($_REQUEST['url'])) {
+ System::httpExit(400, ["title" => L10n::t('Bad Request.')]);
+ }
+
if (!$direct_cache) {
$urlhash = 'pic:' . sha1($_REQUEST['url']);