Commit 91547edd authored by lucha's avatar lucha

[auto] plugin: nextgen-gallery 3.1.6

parent 11422c95
NextGEN Gallery
by Imagely
= V3.1.6 - 01.16.2019 =
* NEW: Option to control caching duration of random widget galleries
* Secured: DB record serialization
* Fixed: Compatibility with plugins that extend Gutenberg / Block Editor
* Fixed: Invalid regex causing warnings when viewing /ngg_tags/ pages
* Fixed: Misc grammatical and spelling mistakes
= V3.1.5 - 01.08.2019 =
* NEW: Added constant NGG_DISABLE_SHUTDOWN_EXCEPTION_HANDLER
* Secured: DB record serialization
* Changed: Added 185 character limit to filenames to prevent filesystem issues
* Changed: Removed caching of 'random' galleries; now only random widgets will be cached
* Changed: Removed dependency on underscore.string.js
* Changed: Updated base64.js library in attach-to-post module
* Changed: Updated jquery.waitforimages.js
* Fixed: Uploading of non-JPEG images and uploading of JPEG with invalid EXIF data
= V3.1.4 - 12.21.2018 =
* Fixed: Visual shortcode not displaying in WP 5.0.2
= V3.1.3 - 01.08.2018 =
* Fixed: Post thumbnail support for NextGEN Gallery when using Block Editor
= V3.1.2 - 12.18.2018 =
* Fixed: Variable mismatch error when using central gallery management pages
......
{
"name": "imagely/nextgen-gallery",
"description": "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 23 million downloads.",
"description": "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 24 million downloads.",
"keywords": ["nextgen", "nextgen gallery", "gallery", "galleries", "image", "images", "image gallery", "photo", "photos", "photo gallery", "picture", "pictures", "picture gallery", "album", "albums", "photo albums", "image album", "media", "media gallery", "thumbnails", "thumbnail gallery", "thumbnail galleries", "slideshow", "slideshows", "slideshow gallery", "slideshow galleries", "fancybox", "lightbox", "responsive", "responsive gallery", "responsive galleries", "singlepic", "watermarks", "watermarking", "photography", "photographer"],
"homepage": "https://www.imagely.com/",
"license": "GPLv2",
......
......@@ -3,8 +3,8 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
/**
* Plugin Name: NextGEN Gallery
* Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 23 million downloads.
* Version: 3.1.4
* Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 24 million downloads.
* Version: 3.1.6
* Author: Imagely
* Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
* Author URI: https://www.imagely.com
......@@ -159,7 +159,8 @@ class C_NextGEN_Bootstrap
function __construct()
{
set_exception_handler(__CLASS__.'::shutdown');
if (!defined('NGG_DISABLE_SHUTDOWN_EXCEPTION_HANDLER') || !NGG_DISABLE_SHUTDOWN_EXCEPTION_HANDLER)
set_exception_handler(__CLASS__.'::shutdown');
// We only load the plugin if we're outside of the activation request, loaded in an iframe
// by WordPress. Reason being, if WP_DEBUG is enabled, and another Pope-based plugin (such as
......@@ -196,6 +197,7 @@ class C_NextGEN_Bootstrap
{
// Load caching component
include_once('non_pope/class.photocrati_transient_manager.php');
include_once('non_pope/class.nextgen_serializable.php');
if (isset($_REQUEST['ngg_flush']))
{
......@@ -674,7 +676,7 @@ class C_NextGEN_Bootstrap
define('NGG_PRODUCT_URL', path_join(str_replace("\\" , '/', NGG_PLUGIN_URL), 'products'));
define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
define('NGG_PLUGIN_STARTED_AT', microtime());
define('NGG_PLUGIN_VERSION', '3.1.4');
define('NGG_PLUGIN_VERSION', '3.1.6');
if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)
define('NGG_SCRIPT_VERSION', (string)mt_rand(0, mt_getrandmax()));
......
<?php
class C_NextGen_Serializable
{
/**
* Serializes the data
*
* @param mixed $value
* @return string
*/
public static function serialize($value)
{
// Try encoding using JSON. It's usually Unicode safe but still, sometimes trips over things
$serialized = @json_encode($value);
if (!$serialized)
{
$serialized = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]/u', '', $value);
$serialized = @json_encode($serialized);
}
// Using json_encode here because PHP's serialize is not Unicode safe
return base64_encode($serialized);
}
/**
* Unserializes data using our proprietary format
*
* @throws Exception This method will not unserialize any objects
* @param string $value
* @return mixed
*/
public static function unserialize($value)
{
$retval = NULL;
if (is_string($value))
{
$retval = stripcslashes($value);
if (strlen($value) > 1)
{
// We can't always rely on base64_decode() or json_decode() to return FALSE as their documentation
// claims so check if $retval begins with a: as that indicates we have a serialized PHP object.
if (strpos($retval, 'a:') === 0)
{
if (self::check_for_serialized_objects($value))
throw new Exception(__("NextGen Gallery will not unserialize data with objects", 'nextgen_gallery'));
// Record this for later
$er = error_reporting(0);
// The second parameter was added by PHP 7.0
if (version_compare(phpversion(), '7.0', '>=')) {
$retval = unserialize($value, array('allowed_classes' => FALSE));
}
else {
$retval = unserialize($value);
}
// Restore error reporting level
error_reporting($er);
}
else {
// We use json_decode() here because PHP's unserialize() is not Unicode safe.
$retval = json_decode(base64_decode($retval), TRUE);
}
}
}
return $retval;
}
/**
* Determines if a string may hold a serialized PHP object
*
* @param $string
* @return bool
*/
public static function check_for_serialized_objects($string)
{
if (!is_string($string))
return false;
$string = trim($string);
return (bool)preg_match("/(O|C):\+?[0-9]+:/is", $string);
}
}
\ No newline at end of file
......@@ -252,7 +252,7 @@ if (!class_exists('C_Photocrati_Global_Settings_Manager')) {
if (!$this->_options)
$this->_options = array();
else if (is_string($this->_options))
$this->_options = unserialize($this->_options);
$this->_options = C_NextGen_Serializable::unserialize($this->_options);
}
function destroy()
......@@ -300,15 +300,12 @@ if (!class_exists('C_Photocrati_Settings_Manager'))
{
$this->_options = get_option(self::$option_name, array());
if (!$this->_options) $this->_options = array();
else if (is_string($this->_options)) $this->_options = unserialize($this->_options);
else if (is_string($this->_options)) $this->_options = C_NextGen_Serializable::unserialize($this->_options);
}
function destroy()
{
delete_option(self::$option_name);
}
}
}
}
\ No newline at end of file
<?php
define('NGG_ATTACH_TO_POST_SLUG', 'nextgen-attach_to_post');
define('NGG_ATTACH_TO_POST_VERSION', '3.1.4');
define('NGG_ATTACH_TO_POST_VERSION', '3.1.4.2');
class M_Attach_To_Post extends C_Base_Module
{
......
......@@ -437,9 +437,6 @@ class Mixin_Attach_To_Post extends Mixin
wp_enqueue_script('backbone');
// provided by WP
$this->object->mark_script('backbone');
// Ensure underscore sting, a helper utility
wp_enqueue_script('underscore.string', $this->get_static_url('photocrati-attach_to_post#underscore.string.js'), array('underscore'), NGG_SCRIPT_VERSION);
$this->object->mark_script('underscore.string');
// Enqueue the backbone app for the display tab
// Get all entities used by the display tab
$context = 'attach_to_post';
......@@ -470,7 +467,7 @@ class Mixin_Attach_To_Post extends Mixin
$display_types[] = $display_type;
}
usort($display_types, array($this->object, '_display_type_list_sort'));
wp_enqueue_script('ngg_display_tab', $this->get_static_url('photocrati-attach_to_post#display_tab.js'), array('jquery', 'backbone', 'underscore.string', 'photocrati_ajax'), NGG_SCRIPT_VERSION);
wp_enqueue_script('ngg_display_tab', $this->get_static_url('photocrati-attach_to_post#display_tab.js'), array('jquery', 'backbone', 'photocrati_ajax'), NGG_SCRIPT_VERSION);
$this->object->mark_script('ngg_display_tab');
wp_localize_script('ngg_display_tab', 'igw_data', array('displayed_gallery_preview_url' => $settings->gallery_preview_url, 'displayed_gallery' => $this->object->_displayed_gallery->get_entity(), 'sources' => $sources->get_all(), 'gallery_primary_key' => $gallery_mapper->get_primary_key_column(), 'galleries' => $gallery_mapper->find_all(), 'albums' => $album_mapper->find_all(), 'tags' => $tags, 'display_types' => $display_types, 'sec_token' => $security->get_request_token('nextgen_edit_displayed_gallery')->get_json(), 'image_primary_key' => $image_mapper->get_primary_key_column(), 'display_type_priority_base' => NGG_DISPLAY_PRIORITY_BASE, 'display_type_priority_step' => NGG_DISPLAY_PRIORITY_STEP, 'shortcode_ref' => isset($_REQUEST['ref']) ? floatval($_REQUEST['ref']) : null, 'shortcode_defaults' => array('order_by' => $settings->galSort, 'order_direction' => $settings->galSortDir, 'returns' => 'included', 'maximum_entity_count' => $settings->maximum_entity_count), 'shortcode_attr_replacements' => array('source' => 'src', 'container_ids' => 'ids', 'display_type' => 'display'), 'i18n' => array('sources' => __('Are you inserting a Gallery (default), an Album, or images based on Tags?', 'nggallery'), 'optional' => __('(optional)', 'nggallery'), 'slug_tooltip' => __('Sets an SEO-friendly name to this gallery for URLs. Currently only in use by the Pro Lightbox', 'nggallery'), 'slug_label' => __('Slug', 'nggallery'), 'no_entities' => __('No entities to display for this source', 'nggallery'), 'exclude_question' => __('Exclude?', 'nggallery'), 'select_gallery' => __('Select a Gallery', 'nggallery'), 'galleries' => __('Select one or more galleries (click in box to see available galleries).', 'nggallery'), 'albums' => __('Select one album (click in box to see available albums).', 'nggallery'))));
}
......
/*
* $Id: base64.js,v 2.15 2014/04/05 12:58:57 dankogai Exp dankogai $
* base64.js
*
* Licensed under the BSD 3-Clause License.
* http://opensource.org/licenses/BSD-3-Clause
......@@ -7,18 +7,29 @@
* References:
* http://en.wikipedia.org/wiki/Base64
*/
(function(global) {
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
? module.exports = factory(global)
: typeof define === 'function' && define.amd
? define(factory) : factory(global)
}((
typeof self !== 'undefined' ? self
: typeof window !== 'undefined' ? window
: typeof global !== 'undefined' ? global
: this
), function(global) {
'use strict';
// existing version for noConflict()
var _Base64 = global.Base64;
var version = "2.1.9";
// if node.js, we use Buffer
var version = "2.4.9";
// if node.js and NOT React Native, we use Buffer
var buffer;
if (typeof module !== 'undefined' && module.exports) {
try {
buffer = require('buffer').Buffer;
} catch (err) {}
buffer = eval("require('buffer').Buffer");
} catch (err) {
buffer = undefined;
}
}
// constants
var b64chars
......@@ -71,11 +82,17 @@
} : function(b) {
return b.replace(/[\s\S]{1,3}/g, cb_encode);
};
var _encode = buffer ? function (u) {
return (u.constructor === buffer.constructor ? u : new buffer(u))
.toString('base64')
}
: function (u) { return btoa(utob(u)) }
var _encode = buffer ?
buffer.from && Uint8Array && buffer.from !== Uint8Array.from
? function (u) {
return (u.constructor === buffer.constructor ? u : buffer.from(u))
.toString('base64')
}
: function (u) {
return (u.constructor === buffer.constructor ? u : new buffer(u))
.toString('base64')
}
: function (u) { return btoa(utob(u)) }
;
var encode = function(u, urisafe) {
return !urisafe
......@@ -137,11 +154,17 @@
} : function(a){
return a.replace(/[\s\S]{1,4}/g, cb_decode);
};
var _decode = buffer ? function(a) {
return (a.constructor === buffer.constructor
? a : new buffer(a, 'base64')).toString();
}
: function(a) { return btou(atob(a)) };
var _decode = buffer ?
buffer.from && Uint8Array && buffer.from !== Uint8Array.from
? function(a) {
return (a.constructor === buffer.constructor
? a : buffer.from(a, 'base64')).toString();
}
: function(a) {
return (a.constructor === buffer.constructor
? a : new buffer(a, 'base64')).toString();
}
: function(a) { return btou(atob(a)) };
var decode = function(a){
return _decode(
String(a).replace(/[-_]/g, function(m0) { return m0 == '-' ? '+' : '/' })
......@@ -165,7 +188,8 @@
encodeURI: encodeURI,
btou: btou,
decode: decode,
noConflict: noConflict
noConflict: noConflict,
__buffer__: buffer
};
// if ES5 is available, make Base64.extendString() available
if (typeof Object.defineProperty === 'function') {
......@@ -187,19 +211,21 @@
}));
};
}
// that's it!
if (global['Meteor']) {
Base64 = global.Base64; // for normal export in Meteor.js
//
// export Base64 to the namespace
//
if (global['Meteor']) { // Meteor.js
Base64 = global.Base64;
}
// module.exports and AMD are mutually exclusive.
// module.exports has precedence.
if (typeof module !== 'undefined' && module.exports) {
module.exports.Base64 = global.Base64;
}
if (typeof define === 'function' && define.amd) {
else if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], function(){ return global.Base64 });
}
})(typeof self !== 'undefined' ? self
: typeof window !== 'undefined' ? window
: typeof global !== 'undefined' ? global
: this
);
\ No newline at end of file
// that's it!
return {Base64: global.Base64}
}));
!function(e){"use strict";var t,r=e.Base64;if("undefined"!=typeof module&&module.exports)try{t=require("buffer").Buffer}catch(e){}var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=function(e){for(var t={},r=0,n=e.length;r<n;r++)t[e.charAt(r)]=r;return t}(n),u=String.fromCharCode,c=function(e){if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?u(192|t>>>6)+u(128|63&t):u(224|t>>>12&15)+u(128|t>>>6&63)+u(128|63&t)}var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return u(240|t>>>18&7)+u(128|t>>>12&63)+u(128|t>>>6&63)+u(128|63&t)},a=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,i=function(e){return e.replace(a,c)},f=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[n.charAt(r>>>18),n.charAt(r>>>12&63),t>=2?"=":n.charAt(r>>>6&63),t>=1?"=":n.charAt(63&r)].join("")},d=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,f)},h=t?function(e){return(e.constructor===t.constructor?e:new t(e)).toString("base64")}:function(e){return d(i(e))},s=function(e,t){return t?h(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):h(String(e))},l=function(e){return s(e,!0)},g=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),p=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return u(55296+(r>>>10))+u(56320+(1023&r));case 3:return u((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return u((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},A=function(e){return e.replace(g,p)},b=function(e){var t=e.length,r=t%4,n=(t>0?o[e.charAt(0)]<<18:0)|(t>1?o[e.charAt(1)]<<12:0)|(t>2?o[e.charAt(2)]<<6:0)|(t>3?o[e.charAt(3)]:0),c=[u(n>>>16),u(n>>>8&255),u(255&n)];return c.length-=[0,0,2,1][r],c.join("")},C=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,b)},B=t?function(e){return(e.constructor===t.constructor?e:new t(e,"base64")).toString()}:function(e){return A(C(e))},y=function(e){return B(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},S=function(){var t=e.Base64;return e.Base64=r,t};if(e.Base64={VERSION:"2.1.9",atob:C,btoa:d,fromBase64:y,toBase64:s,utob:i,encode:s,encodeURI:l,btou:A,decode:y,noConflict:S},"function"==typeof Object.defineProperty){var v=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};e.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",v(function(){return y(this)})),Object.defineProperty(String.prototype,"toBase64",v(function(e){return s(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",v(function(){return s(this,!0)}))}}e.Meteor&&(Base64=e.Base64),"undefined"!=typeof module&&module.exports&&(module.exports.Base64=e.Base64),"function"==typeof define&&define.amd&&define([],function(){return e.Base64})}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this);
\ No newline at end of file
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(e):"function"==typeof define&&define.amd?define(r):r(e)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this,function(global){"use strict";var _Base64=global.Base64,version="2.4.9",buffer;if("undefined"!=typeof module&&module.exports)try{buffer=eval("require('buffer').Buffer")}catch(e){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(e){for(var r={},o=0,t=e.length;o<t;o++)r[e.charAt(o)]=o;return r}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(e){if(e.length<2){var r=e.charCodeAt(0);return r<128?e:r<2048?fromCharCode(192|r>>>6)+fromCharCode(128|63&r):fromCharCode(224|r>>>12&15)+fromCharCode(128|r>>>6&63)+fromCharCode(128|63&r)}var r=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fromCharCode(240|r>>>18&7)+fromCharCode(128|r>>>12&63)+fromCharCode(128|r>>>6&63)+fromCharCode(128|63&r)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(e){return e.replace(re_utob,cb_utob)},cb_encode=function(e){var r=[0,2,1][e.length%3],o=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[b64chars.charAt(o>>>18),b64chars.charAt(o>>>12&63),r>=2?"=":b64chars.charAt(o>>>6&63),r>=1?"=":b64chars.charAt(63&o)].join("")},btoa=global.btoa?function(e){return global.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e)).toString("base64")}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e)).toString("base64")}:function(e){return btoa(utob(e))},encode=function(e,r){return r?_encode(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):_encode(String(e))},encodeURI=function(e){return encode(e,!0)},re_btou=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),cb_btou=function(e){switch(e.length){case 4:var r=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),o=r-65536;return fromCharCode(55296+(o>>>10))+fromCharCode(56320+(1023&o));case 3:return fromCharCode((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return fromCharCode((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=function(e){return e.replace(re_btou,cb_btou)},cb_decode=function(e){var r=e.length,o=r%4,t=(r>0?b64tab[e.charAt(0)]<<18:0)|(r>1?b64tab[e.charAt(1)]<<12:0)|(r>2?b64tab[e.charAt(2)]<<6:0)|(r>3?b64tab[e.charAt(3)]:0),n=[fromCharCode(t>>>16),fromCharCode(t>>>8&255),fromCharCode(255&t)];return n.length-=[0,0,2,1][o],n.join("")},atob=global.atob?function(e){return global.atob(e)}:function(e){return e.replace(/[\s\S]{1,4}/g,cb_decode)},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e,"base64")).toString()}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e,"base64")).toString()}:function(e){return btou(atob(e))},decode=function(e){return _decode(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var e=global.Base64;return global.Base64=_Base64,e};if(global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,__buffer__:buffer},"function"==typeof Object.defineProperty){var noEnum=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(e){return encode(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}}return global.Meteor&&(Base64=global.Base64),"undefined"!=typeof module&&module.exports?module.exports.Base64=global.Base64:"function"==typeof define&&define.amd&&define([],function(){return global.Base64}),{Base64:global.Base64}});
\ No newline at end of file
......@@ -683,7 +683,11 @@ jQuery(function($){
var selected = this.sources.selected();
if (selected.length) {
var view_name = _.str.capitalize(selected.pop().id)+"Source";
function capitalizeFirstLetter(text) {
text = String(text);
return text.charAt(0).toUpperCase() + text.slice(1);
}
var view_name = capitalizeFirstLetter(selected.pop().id) + "Source";
if (typeof(Ngg.DisplayTab.Views[view_name]) != 'undefined') {
var selected_view = new Ngg.DisplayTab.Views[view_name];
this.$el.append(selected_view.render().el);
......
......@@ -14,7 +14,7 @@ class M_DataMapper extends C_Base_Module
'photocrati-datamapper',
'DataMapper',
'Provides a database abstraction layer following the DataMapper pattern',
'3.0.0',
'3.1.4.2',
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
'Imagely',
'https://www.imagely.com'
......@@ -194,47 +194,27 @@ class M_DataMapper extends C_Base_Module
}
/**
* Unserializes data using our proprietary format
* TODO: This is redundant with C_Ngg_Serializer
* Unserializes data
*
* @deprecated Used only by the Pro Lightbox
* @param string $value
* @return mixed
*/
static function unserialize($value)
public static function unserialize($value)
{
$retval = NULL;
if (is_string($value))
{
$retval = stripcslashes($value);
if (strlen($value) > 1)
{
// We can't always rely on base64_decode() or json_decode() to return FALSE as their documentation
// claims so check if $retval begins with a: as that indicates we have a serialized PHP object.
if (strpos($retval, 'a:') === 0)
{
$er = error_reporting(0);
$retval = unserialize($value);
error_reporting($er);
}
else {
// We use json_decode() here because PHP's unserialize() is not Unicode safe.
$retval = json_decode(base64_decode($retval), TRUE);
}
}
}
return $retval;
return C_NextGen_Serializable::unserialize($value);
}
/**
* Serializes the data
*
* @deprecated Used only by the Pro Lightbox
* @param mixed $value
* @return string
*/
static function serialize($value)
{
//Using json_encode here because PHP's serialize is not Unicode safe
return base64_encode(json_encode($value));
return C_NextGen_Serializable::serialize($value);
}
function get_type_list()
......
......@@ -1211,27 +1211,29 @@ class Mixin_DataMapper_Driver_Base extends Mixin
{
foreach ($this->object->_serialized_columns as $column) {
if (isset($object->{$column}) && is_string($object->{$column})) {
$object->{$column} = $this->unserialize($object->{$column});
$object->{$column} = C_NextGen_Serializable::unserialize($object->{$column});
}
}
}
/**
* Serializes the data
*
* @param mixed $value
* @return string
*/
function serialize($value)
{
return M_DataMapper::serialize($value);
return C_NextGen_Serializable::serialize($value);
}
/**
* Unserializes data using our proprietary format
*
* @param string $value
* @return mixed
*/
function unserialize($value)
{
return M_DataMapper::unserialize($value);
return C_NextGen_Serializable::unserialize($value);
}
/**
* Finds a partiular entry by id
......
......@@ -291,7 +291,7 @@ msgstr ""
#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:485
msgid ""
"After you create and select a album, you can drag and drop a gallery or "
"After you create and select an album, you can drag and drop a gallery or "
"another album into your new album below"
msgstr ""
"Når du har oprettet og valgt et album, kan du trække og slippe et galleri "
......@@ -1569,7 +1569,7 @@ msgid "Hide"
msgstr "Skjul"
#: products/photocrati_nextgen/modules/nextgen_other_options/package.module.nextgen_other_options.php:148
msgid "How should related images be match?"
msgid "How should related images be matched?"
msgstr "Hvordan skal relaterede billeder være match?"
#: products/photocrati_nextgen/modules/nextgen_other_options/package.module.nextgen_other_options.php:697
......@@ -3499,10 +3499,10 @@ msgstr "Galleriet ID =%s findes ikke."
#. Description of the plugin
msgid ""
"The most popular gallery plugin for WordPress and one of the most popular "
"plugins of all time with over 23 million downloads."
"plugins of all time with over 24 million downloads."
msgstr ""
"Den mest populære galleri plugin til WordPress og et af de mest populære "
"plugins igennem tiden med over 23 millioner downloads."
"plugins igennem tiden med over 24 millioner downloads."
#: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:290
msgid "The most powerful gallery system ever built for WordPress. "
......
......@@ -1221,7 +1221,7 @@ msgid "(Hide Customization Settings)"
msgstr "(Dölj anpassade inställningar)"
#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:97
msgid "How should related images be match?"
msgid "How should related images be matched?"
msgstr "Hur ska relaterade bilder matchas?"
#: products/photocrati_nextgen/modules/nextgen_other_options/adapter.image_options_form.php:100
......@@ -1708,7 +1708,7 @@ msgid "[Minimize]"
msgstr "[Minimera]"
#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:482
msgid "After you create and select a album, you can drag and drop a gallery or another album into your new album below"
msgid "After you create and select an album, you can drag and drop a gallery or another album into your new album below"
msgstr "När du skapar eller väljer ett album, kan du lägga till gallerier eller andra album genom att dra och släppa dem nedan"
#: products/photocrati_nextgen/modules/ngglegacy/admin/album.php:508
......@@ -2431,8 +2431,8 @@ msgid "Server Settings"
msgstr "Serverinställningar"
#: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
msgid "NextGEN Gallery is one of the most popular WordPress plugins of all time with over 23 million downloads."
msgstr "NextGEN Gallery är en av de mest populära WordPress-tilläggen genom tiderna med över 22 miljoner nedladdningar."
msgid "NextGEN Gallery is one of the most popular WordPress plugins of all time with over 24 million downloads."
msgstr "NextGEN Gallery är en av de mest populära WordPress-tilläggen genom tiderna med över 24 miljoner nedladdningar."
# Missed by NextGEN, translated string is displayed.
#: products/photocrati_nextgen/modules/ngglegacy/admin/overview.php:97
......@@ -3222,8 +3222,8 @@ msgid "https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/"
msgstr "https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/"