2420 Commits

Author SHA1 Message Date
Linty
b19beee0aa fixes #796 handle ampersand escaping for API URLs
When generating URLs for the web service (IN_WS), ensure the argument separator is a raw '&' instead of the HTML entity '&'. add_url_params now switches the separator to '&' if IN_WS is defined and '&' was requested. Removed a redundant str_replace call in ws_std_get_urls since get_action_url/add_url_params now produce the correct separator. This prevents double-escaped ampersands.
2026-03-23 12:26:20 +01:00
Linty
8fe5a57799 fixes #2539 always set pwg_token for API key requests
Simplify pwg_token setup during PWG_API_KEY_REQUEST by unconditionally assigning get_pwg_token() to both $_POST['pwg_token'] and $_GET['pwg_token']. Removes prior isset() checks so the token is always present for API key requests; be aware this will overwrite any existing pwg_token values in request arrays.
2026-03-13 18:18:21 +01:00
plegall
355f3d44af fixes #2538 differentiate from and reply-to in pwg_mail 2026-03-11 12:23:52 +01:00
plegall
3ab004f7f6 fixes GHSA-wfmr-9hg8-jh3m protects pwg.activity.getList 2026-02-24 17:14:35 +01:00
plegall
db2a156554 fixes GHSA-5jwg-cr5q-vjq2 protect filter parameter in pwg.user.getList 2026-02-24 16:19:22 +01:00
plegall
0f359f2af5 fixes GHSA-mgqc-3445-qghq checks standard date fields 2026-02-17 18:54:45 +01:00
plegall
15e451c231 fixes #2510 fallback for missing username 2026-01-15 14:19:04 +01:00
RushLana
5563ea98fd Add a more granular container detection (#2501)
Add a more granular container detection

Replace is_in_container by  get_container_info
Currently detect Official container (once they update a version with a tagfile) and LinuxServer container
All other container are marked as Unknown

Report two field :
- container_type ( none | Official | LinuxServer | Unknown
- container_version ( build Version number like 16.2.0a, only reported if Official container is detected )
2026-01-14 13:00:14 +01:00
plegall
ea80dca422 fixes #2499 make the check_for_updates a unique_exec 2026-01-04 20:48:27 +01:00
Linty
91088bbec9 fixes #2490 add merge_tags notification trigger
A trigger_notify call for 'merge_tags' was added before deleting tags in the tag merge process. This allows plugins or extensions to react to tag merges.
2025-12-22 16:22:14 +01:00
Linty
2526d4a911 fixes #2488 improve handling of derivative config
Refactors how derivative and disabled_derivatives config values are loaded from the database, supporting both parameters and using a new safe_unserialize function. Updates ImageStdParams to use the global config and ensures proper serialization/deserialization of disabled type maps, with improved save logic to avoid unnecessary writes.
2025-12-22 16:17:13 +01:00
plegall
732145f6b7 fixes #2484 force integer on width/height
... was string when original url was used as derivative url (when the original is smaller than the derivative dimensions)
2025-12-22 11:45:20 +01:00
HWFord
27caef885e fixes #2486 add stdPgs config tab in admin
add skins and screenshots for skins
add admin tpl and css
update stdPgs tpl to have dynamic header section
2025-12-19 16:05:24 +01:00
RushLana
57f725d8e6 Fix is_in_container not respecting open_basedir permission
If the user as added open_basedir restriction the function will fail with a Warning :
Warning: file_exists(): open_basedir restriction in effect. File(/proc/2/sched) is not within the allowed path(s)

This fix add a check that assume piwigo is not in a container when open_basedir is set
2025-12-08 11:26:50 +01:00
Linty
3da45eabac fixes #2460 switch api auth header to X-PIWIGO-API
Replaces usage of the Authorization header with X-PIWIGO-API for API key authentication. This improves consistency and may address issues with standard Authorization header handling.
2025-12-01 18:12:31 +01:00
HWFord
435837a2e3 issue #2467 change boolean cast 2025-12-01 14:35:43 +01:00
Linty
32d3ea93f8 fixes #2458 add polyfill for str_starts_with function
Introduces a compatibility implementation of str_starts_with for environments where it is not available. Updates common.inc.php to include the polyfill if the function does not exist.
2025-12-01 12:43:46 +01:00
plegall
7cb8b615b8 next release is 17.0.0beta1 2025-11-24 17:06:12 +01:00
plegall
4f648db510 issue #2445 avoid null input on strip_tags (image name can be null) 2025-11-19 16:09:50 +01:00
plegall
545cad3501 fixes #2452 anonymous stats get richer with list of remote apps
* no "discovery", Piwigo searches for known patterns in the activity table
2025-11-19 14:21:00 +01:00
Linty
31d8f4516c fixes #2450 add user agent in activities performed with api key
Updated user activity display to show when a user is connected via API key, including an icon and updated tooltip. Modified backend to set a 'connected_with' flag in activity details when API key authentication is used.
2025-11-18 15:48:42 +01:00
plegall
da2804db72 next release will be 16.0.0RC3 2025-11-18 11:07:49 +01:00
Linty
e0a2a0ba2b fixes #2449 enhance password reset flow with verification and lockout
Added email notification for successful password reset, improved verification code handling, and implemented account lockout after too many failed attempts. Introduced new language strings for user feedback and security messages. Refactored password reset logic to better handle guest/generic users and API key recommendations.
2025-11-17 21:43:14 +01:00
HWFord
c04374928a issue #2439 update popin
Add translations
remove last major update conf when in piwigo Upgrade
don't send popin template if not needed
2025-11-17 10:00:53 +01:00
Linty
c43c3696e0 issue #2440 clear fake user cache on successful login
Added a call to clear_fake_user_cache() in pwg_login to ensure the fake user cache is reset after a successful login. Also introduced the clear_fake_user_cache() function for this purpose.
2025-11-13 15:44:00 +01:00
Linty
0f494baa0c fixes #2440 enhance login security and user activity display
Improves login security by:
- implementing constant-time authentication to reduce timing attacks
- refactoring user lookup into find_user_by_username_or_email() for username or email login
- introducing a fake user to keep password verification time consistent
- adding a finalize_login hook so plugins can control the authentication flow (2FA, rate limiting, etc.)

Also updates user activity JS to:
- better display action details
- properly handle user lists (login/logout with multiple users)
2025-11-13 14:05:35 +01:00
Linty
c257866d71 fixes #2436 refactor async upload authentication
Replaces direct login check with ws_session_login for 'pwg.images.uploadAsync' and updates error handling to return the login response. Also updates the web service method definition to make username and password optional and clarifies admin credential requirements in the documentation.
2025-11-13 13:04:22 +01:00
plegall
e07ca962f0 fixes #2434 always redirect server-side, not browser-side"
... this will avoid to try loading theme templates (with unset variables)
2025-11-11 18:51:32 +01:00
plegall
1d1a8b15da next release will be 16.0.0RC2 2025-11-10 17:42:30 +01:00
plegall
eb37a4e5f1 fixes #2423, fixes #1949, fixes #2401 render title/description and keep HTML in descriptions
... and in several API methods add new output fields name_raw and comment_raw that are ready for edition
2025-11-10 17:00:58 +01:00
Eric Quinton
be85e9381a Update functions_html.inc.php
replace "count xx != 0 by !empty, to support PHP 8.2 and after
2025-11-10 12:25:31 +01:00
plegall
a04c93cf76 fixes #2092 redesigned handling of return to gallery after photo edit
* instead of using the provided cat_id in the URL parameters, registers the "context" of the last 10 photos viewed. Be it an album, a search, a tag...
* maybe not the cleanest way to do it (because we do not rebuild the url string) but simple and straightforward
2025-11-03 21:49:23 +01:00
Linty
d600b019a6 enable qrcode generation for totp secrets
Uncommented and activated QR code generation in getQrCode(), allowing TOTP secrets to be encoded as base64 PNG images for easier setup in authenticator apps.
2025-10-29 12:23:54 +01:00
Linty
99bb370b98 fixes #2425 unescape API key name before returning
Added a call to stripslashes for the 'apikey_name' field to ensure it is unescaped before being returned. This improves display consistency for API key names containing escaped characters.
2025-10-29 12:03:43 +01:00
Linty
d6a1cf0466 fixes #2424 remove connection by header from API key validation
Simplifies the API key validation in auth_key_login by removing the requirement for connection_by_header. Now, API keys matching the pattern are accepted regardless of the connection source.
2025-10-29 11:49:19 +01:00
plegall
b416bdb7c9 fixes #2417 ability to hide the new filter "expert mode"
... and removes 2 other duplicates of the filters_views configuration
2025-10-28 18:39:18 +01:00
plegall
f0f4b30ce2 search filters: avoid to write 3 times the same default configuration 2025-10-28 16:35:05 +01:00
Linty
9ac99be1de fixes GHSA-9986-w7jf-33f6 and fixes GHSA-9986-w7jf-33f6
* Introduces a verification code step before generating password reset links.
* New configuration "password_reset_code_duration".
* Adds Base32, TOTP and PHPQRCode classes .
* New section is required in password.tpl: code verification won't work on themes not updated yet.
* 5 new language strings were added.
2025-10-17 15:38:21 +02:00
plegall
5d518e583d next release will be 16.0.0RC1 2025-10-08 10:56:25 +02:00
HWFord
416dbe2d24 issue #2414 change single tag display 2025-10-07 16:47:11 +02:00
HWFord
b682fd0cd3 fixes #2414 change related tags display
Add conf to display or not the related tag options by default
Add templates and css for new display
2025-10-03 15:43:29 +02:00
Linty
58a9447e01 fixes #2413 tag edit/duplicate now use raw_name as editable value 2025-09-26 13:39:28 +02:00
Linty
fcb465f039 fixes #1948 replace cssmin by minify
- switched from cssmin to matthiasmullie/minify for CSS minification.
- the minify lib requires the path-converter lib (from the same author), which has been added as well (in include/minify/path-converter).

This change is necessary because cssmin is not compatible with PHP 8.4
2025-09-23 16:28:29 +02:00
plegall
dae3c772c6 fixes #2328 Piwigo 16 requires PHP 7.4, thus random_bytes is available 2025-09-22 15:36:27 +02:00
Linty
18bb865a23 fixes #2411 disable 3xl and 4xl by default
- Add 3XL and 4XL sizes to defaults but keep them disabled by default
- Update admin restore default derivatives resets sizes and clears cache
- Update migration 177 => updates existing installs: set 3XL/4XL as disabled
2025-09-19 18:49:05 +02:00
Linty
1be0527523 issue #2405 update smarty
and made Piwigo compatible with smarty 5.x
2025-09-17 12:05:48 +02:00
plegall
b167a327e3 issue #2409 add search engine filter : expert mode
* new access system not implemented yet
* dark mode handled but needs review
2025-09-15 15:10:17 +02:00
plegall
124ac245a7 next release is 16.0.0beta2 2025-09-05 14:27:39 +02:00
plegall
cd8c9b7db3 issue #2405 increase PHP required version from 7.1 to 7.4 for the upcoming Smarty update 2025-09-05 14:23:53 +02:00
Renarde-dev
21e77002bc Detect if piwigo is running in a container
Append info on PHP_OS in the template of `admin/maintenance_env.php` and in `include/functions.inc.php` -> `send_piwigo_infos()`

Detection works by checking if PHP is running on Linux then check if PID2 is kthreadd
Kthreadd is useless in a container so PID2 should not exist of be another process
If unable to read /proc/2/sched for some reason, assume a SELinux restriction and that PHP is not running in a container

`is_in_container()` doesn't differentiate between VMs or bare metal, it only check if PHP is running in a containerized environement via tools like docker or podman
2025-09-05 13:32:34 +02:00