HaschekSolutions / pictshare

:camera: PictShare is an open source image, mp4, pastebin hosting service with a simple resizing and upload API that you can host yourself. :rice_scene:
https://www.pictshare.net
Apache License 2.0
819 stars 123 forks source link

Fix for deprecated features in PHP 8.1 #155

Closed metalefty closed 2 months ago

metalefty commented 3 months ago
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string

ref. https://www.php.net/manual/en/migration81.deprecated.php#migration81.deprecated.core.null-not-nullable-internal

image

metalefty commented 3 months ago

The deprecated message is also included in JSON response of /api/upload.php so it causes JSON parse error.

<br />
<b>Deprecated</b>:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in <b>/tmp/pictshare/inc/core.php</b> on line <b>432</b><br />
{"status":"ok","hash":"b9fboc.jpg",. ...}