[language] Other language file than plugin.lang isn't loaded #306

Closed
opened 2026-10-04 23:51:30 +02:00 by adam · 0 comments
Owner

Reported by LucMorizur on 21 Feb 2015 09:12

Version: 2.7.3

At lines 1515 and 1516 of include/functions.inc.php , inside load_language function, is defined $default_language :

$default_language = defined('PHPWG_INSTALLED') and !defined('UPGRADES_PATH') ?
get_default_language() : PHPWG_DEFAULT_LANGUAGE;

Because of lack of parenthesis, $default_language is evaluated as a boolean, and following code thus fails.

Steps to reproduce: Use load_language requiring other files than plugin.lang , like plugins LCAS and Event Cats do.

Additional information: Writing

$default_language = (defined('PHPWG_INSTALLED') and !defined('UPGRADES_PATH')) ?
get_default_language() : PHPWG_DEFAULT_LANGUAGE;

works.

Piwigo Bugtracker #3206

**Reported by LucMorizur on 21 Feb 2015 09:12** **Version:** 2.7.3 At lines 1515 and 1516 of include/functions.inc.php , inside load_language function, is defined $default_language : $default_language = defined(&#039;PHPWG_INSTALLED&#039;) and !defined(&#039;UPGRADES_PATH&#039;) ? get_default_language() : PHPWG_DEFAULT_LANGUAGE; Because of lack of parenthesis, $default_language is evaluated as a boolean, and following code thus fails. **Steps to reproduce:** Use load_language requiring other files than plugin.lang , like plugins LCAS and Event Cats do. **Additional information:** Writing $default_language = (defined(&#039;PHPWG_INSTALLED&#039;) and !defined(&#039;UPGRADES_PATH&#039;)) ? get_default_language() : PHPWG_DEFAULT_LANGUAGE; works. [Piwigo Bugtracker #3206](http://piwigo.org/bugs/view.php?id=3206) <!-- github-sync-id:97227077 -->
adam closed this issue 2026-10-04 23:51:30 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#306