Changeset 31883
- Timestamp:
- Jul 25, 2017, 11:26:37 AM (7 years ago)
- Location:
- extensions/MenuRandomPhoto
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/MenuRandomPhoto/main.inc.php
r31881 r31883 23 23 global $conf, $user; 24 24 25 $conf['MRP'] = unserialize($conf['MRP']);25 $conf['MRP'] = safe_unserialize($conf['MRP']); 26 26 27 27 if (defined('IN_ADMIN')) -
extensions/MenuRandomPhoto/maintain.class.php
r31882 r31883 27 27 if (empty($conf['MRP'])) 28 28 { 29 $conf['MRP'] = serialize($this->default_conf); 30 conf_update_param('MRP', $conf['MRP']); 29 conf_update_param('MRP', $this->default_conf, true); 31 30 } 32 31 else 33 32 { 34 $new_conf = is_string($conf['MRP']) ? unserialize($conf['MRP']) : $conf['MRP']; 35 36 $conf['MRP'] = serialize($new_conf); 37 conf_update_param('MRP', $conf['MRP']); 33 $old_conf = safe_unserialize($conf['MRP']); 34 35 $new_param = 'apply_to_albums'; 36 if (empty($old_conf[$new_param])) 37 { // use case: this parameter was added in a new version 38 $old_conf[$new_param] = $this->default_conf[$new_param]; 39 } 40 41 conf_update_param('MRP', $old_conf, true); 38 42 } 39 43 … … 59 63 { 60 64 } 61 65 66 /** 67 * Plugin (auto)update 68 * 69 * This function is called when Piwigo detects that the registered version of 70 * the plugin is older than the version exposed in main.inc.php 71 * Thus it's called after a plugin update from admin panel or a manual update by FTP 72 */ 73 function update($old_version, $new_version, &$errors=array()) 74 { 75 $this->install($new_version, $errors); 76 } 77 62 78 function uninstall() 63 79 {
Note: See TracChangeset
for help on using the changeset viewer.