You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this code (include/functions.inc.php function pwg_log:
// If plugin developers add their own sections, Piwigo will automatically add it in the history.section enum column
if (isset($page['section']))
{
// set cache if not available
if (!isset($conf['history_sections_cache']))
{
conf_update_param('history_sections_cache', get_enums(HISTORY_TABLE, 'section'), true);
}
$conf['history_sections_cache'] = safe_unserialize($conf['history_sections_cache']);
if (in_array($page['section'], $conf['history_sections_cache']))
{
$section = $page['section'];
}
elseif (preg_match('/^[a-zA-Z0-9_-]+$/', $page['section']))
{
$history_sections = get_enums(HISTORY_TABLE, 'section');
$history_sections[] = $page['section'];
// alter history table structure, to include a new section
pwg_query('ALTER TABLE '.HISTORY_TABLE.' CHANGE section section enum(\''.implode("','", array_unique($history_sections)).'\') DEFAULT NULL;');
// and refresh cache
conf_update_param('history_sections_cache', get_enums(HISTORY_TABLE, 'section'), true);
$section = $page['section'];
}
}
We do as if the history.section is case sensitive. It's not. If you try to add section42 in the ENUM field while Section42 already exists, MySQL will throw an error.
The text was updated successfully, but these errors were encountered:
In this code (
include/functions.inc.php
functionpwg_log
:We do as if the
history.section
is case sensitive. It's not. If you try to addsection42
in the ENUM field whileSection42
already exists, MySQL will throw an error.The text was updated successfully, but these errors were encountered: