plegall / Piwigo-community

11 stars 23 forks source link

Empty comment field in album preventing export from external application #86

Open Icephale opened 2 months ago

Icephale commented 2 months ago

With versions:

strip_tags refuses null parameter and prevent fetching albums informations (tested with digikam exporter and albums with no comment).

PHP message: PHP Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/piwigo/plugins/community/main.inc.php on line 586 Temporarily resolved with a condition:

    if ($row['comment'])
    {
    $row['comment'] = strip_tags(
      trigger_change(
        'render_category_description',
        $row['comment'],
        'ws_categories_getList'
        )
    );
    }
    else
    {
    $row['comment'] = strip_tags(
      trigger_change(
        'render_category_description',
        '',
        'ws_categories_getList'
        )
    );
    }

https://github.com/plegall/Piwigo-community/blob/dc24ad67632c59d253f65958446545ee67e0b1a6/main.inc.php#L586