bwdutton / gallery3

The simplest, most intuitive way to host your photos on your website.
https://galleryrevival.com/
GNU General Public License v2.0
131 stars 26 forks source link

error: trim(): Passing null to parameter #1 ($string) of type string is deprecated #0 #24

Open stefanofornari opened 1 year ago

stefanofornari commented 1 year ago

I ran into the above error with latest main (below the stack trace) showing the home page with a number of albums.

adding a cast to string in line url.php:106 seems to fix the problem_

if ($path = trim((string)parse_url($uri, PHP_URL_PATH), '/'))

stack:

2023-02-14 06:21:41 +00:00 --- error: trim(): Passing null to parameter #1 ($string) of type string is deprecated
#0 [internal function]: gallery_error_Core::error_handler()
#1 /opt/Campanile/src/main/webapp/system/helpers/url.php(106): trim()
#2 /opt/Campanile/src/main/webapp/modules/gallery/libraries/Gallery_View.php(58): url_Core::site()
#3 /opt/Campanile/src/main/webapp/themes/wind/views/album.html.php(47): Gallery_View_Core->paginator()
...