Index: inc/admin/lib.dc.page.php
===================================================================
--- inc/admin/lib.dc.page.php	(revision 3340)
+++ inc/admin/lib.dc.page.php	(revision 3319)
@@ -106,8 +106,8 @@
 			// Get directives from settings if exist, else set defaults
 			$csp = new ArrayObject(array());
-			$csp['default-src'] = $core->blog->settings->system->csp_admin_default ?: "'self'";
-			$csp['script-src'] = $core->blog->settings->system->csp_admin_script ?: "'self' 'unsafe-inline' 'unsafe-eval'";
-			$csp['style-src'] = $core->blog->settings->system->csp_admin_style ?: "'self' 'unsafe-inline'";
-			$csp['img-src'] = $core->blog->settings->system->csp_admin_img ?: "'self' data: media.dotaddict.org";
+			$csp['default-src'] = $core->blog->settings->system->csp_admin_default ? $core->blog->settings->system->csp_admin_default : "'self'";
+			$csp['script-src'] = $core->blog->settings->system->csp_admin_script ? $core->blog->settings->system->csp_admin_script : "'self' 'unsafe-inline' 'unsafe-eval'";
+			$csp['style-src'] = $core->blog->settings->system->csp_admin_style ? $core->blog->settings->system->csp_admin_style : "'self' 'unsafe-inline'";
+			$csp['img-src'] = $core->blog->settings->system->csp_admin_img ? $core->blog->settings->system->csp_admin_img : "'self' data: media.dotaddict.org";
 
 			# Cope with blog post preview (via public URL in iframe)
@@ -137,6 +137,5 @@
 					$directives[] = "report-uri ".DC_ADMIN_URL."csp_report.php";
 				}
-				$report_only = ($core->blog->settings->system->csp_admin_report_only) ? '-Report-Only' : '';
-				$headers['csp'] = "Content-Security-Policy".$report_only.": ".implode(" ; ",$directives);
+				$headers['csp'] = "Content-Security-Policy: ".implode(" ; ",$directives);
 			}
 		}
@@ -298,5 +297,5 @@
 	{
 		global $core;
-		$tag = (isset($n['divtag']) && $n['divtag']) ? 'div' : 'p';
+		$tag = (isset($n['divtag'])&& $n['divtag'])?'div':'p';
 		$ts = '';
 		if (!isset($n['with_ts']) || ($n['with_ts'] == true)) {
@@ -442,7 +441,7 @@
 	{
 		global $core;
-		$with_home_link = isset($options['home_link']) ? $options['home_link'] : true;
-		$hl = isset($options['hl']) ? $options['hl'] : true;
-		$hl_pos = isset($options['hl_pos']) ? $options['hl_pos'] : -1;
+		$with_home_link = isset($options['home_link'])?$options['home_link']:true;
+		$hl = isset($options['hl'])?$options['hl']:true;
+		$hl_pos = isset($options['hl_pos'])?$options['hl_pos']:-1;
 		// First item of array elements should be blog's name, System or Plugins
 		$res = '<h2>'.($with_home_link ?
@@ -1054,5 +1053,4 @@
 					}
 				}
-				sort($themes);
 			}
 		}
Index: inc/admin/lib.moduleslist.php
===================================================================
--- inc/admin/lib.moduleslist.php	(revision 3338)
+++ inc/admin/lib.moduleslist.php	(revision 3327)
@@ -466,7 +466,5 @@
 				'sshot' 			=> '',
 				'score'				=> 0,
-				'type' 				=> null,
-				'require'			=> array(),
-				'settings'			=> array()
+				'type' 				=> null
 			),
 			# Module's values
@@ -746,5 +744,5 @@
 					if (!empty($more)) {
 						echo
-						'<li>'.implode(' - ',$more).'</li>';
+						'<li>'.implode(' - ', $more).'</li>';
 					}
 
@@ -754,17 +752,12 @@
 
 				$config = !empty($module['root']) && file_exists(path::real($module['root'].'/_config.php'));
-				$index = !empty($module['root']) && file_exists(path::real($module['root'].'/index.php'));
-
-				if ($config || $index || !empty($module['section']) || !empty($module['tags']) || !empty($module['settings'])) {
+
+				if ($config || !empty($module['section']) || !empty($module['tags'])) {
 					echo
 					'<div><ul class="mod-more">';
 
-					if ($index && $module['enabled']) {
-						echo '<li><a href="'.$this->core->adminurl->get('admin.plugin.'.$id).'">'.__('Manage plugin').'</a></li>';
-					}
-
-					$settings = $this->getSettingsUrls($this->core,$id);
-					if (!empty($settings) && $module['enabled']) {
-						echo '<li>'.implode(' - ',$settings).'</li>';
+					if ($config) {
+						echo
+						'<li><a class="module-config" href="'.$this->getURL('module='.$id.'&amp;conf=1').'">'.__('Configure plugin').'</a></li>';
 					}
 
@@ -813,78 +806,4 @@
 
 		return $this;
-	}
-
-	/**
-	 * Get settings URLs if any
-	 *
-	 * @param object $core
-	 * @param string $id module ID
-	 * @param boolean $check check permission
-	 * @param boolean $self include self URL (→ plugin index.php URL)
-	 * @return Array of settings URLs
-	 */
-	public static function getSettingsUrls($core,$id,$check=false,$self=true)
-	{
-		$st = array();
-
-		$config = !empty($core->plugins->moduleRoot($id)) &&
-			file_exists(path::real($core->plugins->moduleRoot($id).'/_config.php'));
-		$settings = $core->plugins->moduleInfo($id,'settings');
-		if ($config || !empty($settings)) {
-			if ($config) {
-				if (!$check ||
-					$core->auth->isSuperAdmin() ||
-					$core->auth->check($core->plugins->moduleInfo($id,'permissions'),$core->blog->id))
-				{
-					$params = array('module' => $id,'conf' => '1');
-					if (!$core->plugins->moduleInfo($id,'standalone_config') && !$self) {
-						$params['redir'] = $core->adminurl->get('admin.plugin.'.$id);
-					}
-					$st[] = '<a class="module-config" href="'.
-						$core->adminurl->get('admin.plugins',$params).
-						'">'.__('Configure plugin').'</a>';
-				}
-			}
-			if (is_array($settings)) {
-				foreach ($settings as $sk => $sv) {
-					switch ($sk) {
-						case 'blog':
-							if (!$check ||
-								$core->auth->isSuperAdmin() ||
-								$core->auth->check('admin',$core->blog->id))
-							{
-								$st[] = '<a class="module-config" href="'.
-									$core->adminurl->get('admin.blog.pref').$sv.
-									'">'.__('Plugin settings (in blog parameters)').'</a>';
-							}
-							break;
-						case 'pref':
-							if (!$check ||
-								$core->auth->isSuperAdmin() ||
-								$core->auth->check('usage,contentadmin',$core->blog->id))
-							{
-								$st[] = '<a class="module-config" href="'.
-									$core->adminurl->get('admin.user.preferences').$sv.
-									'">'.__('Plugin settings (in user preferences)').'</a>';
-							}
-							break;
-						case 'self':
-							if ($self) {
-								if (!$check ||
-									$core->auth->isSuperAdmin() ||
-									$core->auth->check($core->plugins->moduleInfo($id,'permissions'),$core->blog->id))
-								{
-									$st[] = '<a class="module-config" href="'.
-										$core->adminurl->get('admin.plugin.'.$id).$sv.
-										'">'.__('Plugin settings').'</a>';
-								}
-							}
-							break;
-					}
-				}
-			}
-		}
-
-		return $st;
 	}
 
Index: inc/admin/lib.themeconfig.php
===================================================================
--- inc/admin/lib.themeconfig.php	(revision 3340)
+++ inc/admin/lib.themeconfig.php	(revision 2660)
@@ -71,5 +71,5 @@
 
 		// Eval font size in em (assume base font size in pixels equal to 16)
-		if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex|rem)?$/',$size,$m)) {
+		if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex)?$/',$size,$m)) {
 			if (empty($m[2])) {
 				$m[2] = 'em';
@@ -144,5 +144,5 @@
 	public static function adjustFontSize($s)
 	{
-		if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex|rem)?$/',$s,$m)) {
+		if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex)?$/',$s,$m)) {
 			if (empty($m[2])) {
 				$m[2] = 'em';
Index: inc/admin/prepend.php
===================================================================
--- inc/admin/prepend.php	(revision 3334)
+++ inc/admin/prepend.php	(revision 3262)
@@ -64,5 +64,5 @@
 }
 
-function addMenuItem($section,$desc,$adminurl,$icon,$perm,$pinned=false)
+function addMenuItem($section,$desc,$adminurl,$icon,$perm)
 {
 	global $core,$_menu;
@@ -70,5 +70,5 @@
 	$url = $core->adminurl->get($adminurl);
 	$_menu[$section]->prependItem($desc,$url,$icon,
-		preg_match('/'.preg_quote($url).'(\?.*)?$/',$_SERVER['REQUEST_URI']),$perm,null,null,$pinned);
+		preg_match('/'.preg_quote($url).'(\?.*)?$/',$_SERVER['REQUEST_URI']),$perm,null,null,true);
 }
 
@@ -278,5 +278,5 @@
 		$core->auth->check('usage,contentadmin',$core->blog->id));
 	addMenuItem('Blog',__('New entry'),'admin.post','images/menu/edit.png',
-		$core->auth->check('usage,contentadmin',$core->blog->id),true);
+		$core->auth->check('usage,contentadmin',$core->blog->id));
 
 	addMenuItem('System',__('Update'),'admin.update','images/menu/update.png',
Index: inc/core/class.dc.auth.php
===================================================================
--- inc/core/class.dc.auth.php	(revision 3340)
+++ inc/core/class.dc.auth.php	(revision 3298)
@@ -217,5 +217,5 @@
 		# Check here for user and IP address
 		$this->checkUser($_SESSION['sess_user_id']);
-		$uid = $uid ?: http::browserUID(DC_MASTER_KEY);
+		$uid = $uid ? $uid : http::browserUID(DC_MASTER_KEY);
 
 		$user_can_log = $this->userID() !== null && $uid == $_SESSION['sess_browser_uid'];
Index: inc/core/class.dc.blog.php
===================================================================
--- inc/core/class.dc.blog.php	(revision 3340)
+++ inc/core/class.dc.blog.php	(revision 3263)
@@ -1506,5 +1506,5 @@
 		$cur = $this->con->openCursor($this->prefix.'post');
 
-		$cur->cat_id = ($cat_id ?: null);
+		$cur->cat_id = ($cat_id ? $cat_id : null);
 		$cur->post_upddt = date('Y-m-d H:i:s');
 
@@ -1530,5 +1530,5 @@
 		$cur = $this->con->openCursor($this->prefix.'post');
 
-		$cur->cat_id = ($new_cat_id ?: null);
+		$cur->cat_id = ($new_cat_id ? $new_cat_id : null);
 		$cur->post_upddt = date('Y-m-d H:i:s');
 
Index: inc/core/class.dc.media.php
===================================================================
--- inc/core/class.dc.media.php	(revision 3340)
+++ inc/core/class.dc.media.php	(revision 3354)
@@ -393,5 +393,5 @@
 		}
 
-		$media_dir = $this->relpwd ?: '.';
+		$media_dir = $this->relpwd ? $this->relpwd : '.';
 
 		$strReq =
@@ -660,5 +660,5 @@
 	protected function rebuildDB($pwd)
 	{
-		$media_dir = $pwd ?: '.';
+		$media_dir = $pwd ? $pwd : '.';
 
 		$strReq =
@@ -919,5 +919,5 @@
 	public function getDBDirs()
 	{
-		$media_dir = $this->relpwd ?: '.';
+		$media_dir = $this->relpwd ? $this->relpwd : '.';
 
 		$strReq =
@@ -943,5 +943,5 @@
 		$zip = new fileUnzip($f->file);
 		$zip->setExcludePattern($this->exclude_pattern);
-		$zip->getList(false,'#(^|/)(__MACOSX|\.svn|\.DS_Store|\.directory|Thumbs\.db)(/|$)#');
+		$list = $zip->getList(false,'#(^|/)(__MACOSX|\.svn|\.DS_Store|\.directory|Thumbs\.db)(/|$)#');
 
 		if ($create_dir)
@@ -968,4 +968,22 @@
 		$zip->unzipAll($target);
 		$zip->close();
+
+		// Clean-up all extracted filenames
+		$clean = function ($name) {
+			$n = text::deaccent($name);
+			$n = preg_replace('/^[.]/u','',$n);
+			return preg_replace('/[^A-Za-z0-9._\-\/]/u','_',$n);
+		};
+		foreach ($list as $zk => $zv) {
+			// Check if extracted file exists
+			$zf = $target.'/'.$zk;
+			if (!$zv['is_dir'] && file_exists($zf)) {
+				$zt = $clean($zf);
+				if ($zt != $zf) {
+					rename($zf,$zt);
+				}
+			}
+		}
+
 		return dirname($f->relname).'/'.$destination;
 	}
Index: inc/core/class.dc.modules.php
===================================================================
--- inc/core/class.dc.modules.php	(revision 3333)
+++ inc/core/class.dc.modules.php	(revision 3135)
@@ -283,5 +283,5 @@
 	(currently available keys : permissions, priority, type)
 	*/
-	public function registerModule($name,$desc,$author,$version,$properties = array())
+	public function registerModule($name,$desc,$author,$version, $properties = array())
 	{
 		if ($this->disabled_mode) {
@@ -320,6 +320,5 @@
 				'type' => null,
 				'enabled' => true,
-				'requires' => array(),
-				'settings' => array()
+				'requires' => array()
 			), $properties
 		);
Index: inc/core/class.dc.trackback.php
===================================================================
--- inc/core/class.dc.trackback.php	(revision 3340)
+++ inc/core/class.dc.trackback.php	(revision 2674)
@@ -171,5 +171,5 @@
 		$comment =
 		"<!-- TB -->\n".
-		'<p><strong>'.($title ?: $blog_name)."</strong></p>\n".
+		'<p><strong>'.($title ? $title : $blog_name)."</strong></p>\n".
 		'<p>'.$excerpt.'</p>';
 
Index: inc/core/class.dc.update.php
===================================================================
--- inc/core/class.dc.update.php	(revision 3350)
+++ inc/core/class.dc.update.php	(revision 2566)
@@ -104,35 +104,14 @@
 		{
 			$path = '';
-			$status = 0;
-
-			$http_get = function ($http_url) use (&$status,$path) {
-				$client = netHttp::initClient($http_url,$path);
-				if ($client !== false) {
-					$client->setTimeout(4);
-					$client->setUserAgent($_SERVER['HTTP_USER_AGENT']);
-					$client->get($path);
-					$status = (int) $client->getStatus();
-				}
-				return $client;
-			};
-
-			$client = $http_get($this->url);
-			if ($status >= 400) {
-				// If original URL uses HTTPS, try with HTTP
-				$url_parts = parse_url($client->getRequestURL());
-				if (isset($url_parts['scheme']) && $url_parts['scheme'] == 'https') {
-					// Replace https by http in url
-					$this->url = preg_replace('/^https(?=:\/\/)/i','http',$this->url);
-					$client = $http_get($this->url);
-				}
-			}
-			if (!$status || $status >= 400) {
-				throw new Exception();
-			}
-			$this->readVersion($client->getContent());
-		}
-		catch (Exception $e) {
-			return;
-		}
+			$client = netHttp::initClient($this->url,$path);
+			if ($client !== false) {
+				$client->setTimeout(4);
+				$client->setUserAgent($_SERVER['HTTP_USER_AGENT']);
+				$client->get($path);
+
+				$this->readVersion($client->getContent());
+			}
+		}
+		catch (Exception $e) {}
 
 		# Create cache
@@ -223,32 +202,13 @@
 		try
 		{
-			$path = '';
-			$status = 0;
-
-			$http_get = function ($http_url) use (&$status,$dest,$path) {
-				$client = netHttp::initClient($http_url,$path);
-				if ($client !== false) {
-					$client->setTimeout(4);
-					$client->setUserAgent($_SERVER['HTTP_USER_AGENT']);
-					$client->useGzip(false);
-					$client->setPersistReferers(false);
-					$client->setOutput($dest);
-					$client->get($path);
-					$status = (int) $client->getStatus();
-				}
-				return $client;
-			};
-
-			$client = $http_get($url);
-			if ($status >= 400) {
-				// If original URL uses HTTPS, try with HTTP
-				$url_parts = parse_url($client->getRequestURL());
-				if (isset($url_parts['scheme']) && $url_parts['scheme'] == 'https') {
-					// Replace https by http in url
-					$url = preg_replace('/^https(?=:\/\/)/i','http',$url);
-					$client = $http_get($url);
-				}
-			}
-			if ($status != 200) {
+			$client = netHttp::initClient($url,$path);
+			$client->setTimeout(4);
+			$client->setUserAgent($_SERVER['HTTP_USER_AGENT']);
+			$client->useGzip(false);
+			$client->setPersistReferers(false);
+			$client->setOutput($dest);
+			$client->get($path);
+
+			if ($client->getStatus() != 200) {
 				@unlink($dest);
 				throw new Exception();
Index: inc/dbschema/upgrade.php
===================================================================
--- inc/dbschema/upgrade.php	(revision 3326)
+++ inc/dbschema/upgrade.php	(revision 3314)
@@ -540,5 +540,5 @@
 		}
 
-		if (version_compare($version,'2.10','<'))
+		if (version_compare($version,'2.10','<='))
 		{
 			@unlink(DC_ROOT.'/'.'admin/js/jsUpload/vendor/jquery.ui.widget.js');
@@ -590,17 +590,4 @@
 		}
 
-		if (version_compare($version,'2.11','<'))
-		{
-			// Remove the CSP report file from it's old place
-			@unlink(DC_ROOT.'/admin/csp_report.txt');
-
-			# Some new settings should be initialized, prepare db queries
-			$strReq = 'INSERT INTO '.$core->prefix.'setting'.
-					' (setting_id,setting_ns,setting_value,setting_type,setting_label)'.
-					' VALUES(\'%s\',\'system\',\'%s\',\'%s\',\'%s\')';
-			$core->con->execute(
-				sprintf($strReq,'csp_admin_report_only',false,'boolean','CSP Report only violations (admin)'));
-		}
-
 		$core->setVersion('core',DC_VERSION);
 		$core->blogDefaults();
Index: inc/prepend.php
===================================================================
--- inc/prepend.php	(revision 3347)
+++ inc/prepend.php	(revision 3316)
@@ -142,5 +142,5 @@
 # Constants
 define('DC_ROOT',path::real(dirname(__FILE__).'/..'));
-define('DC_VERSION','2.11-dev');
+define('DC_VERSION','2.10.2');
 define('DC_DIGESTS',dirname(__FILE__).'/digests');
 define('DC_L10N_ROOT',dirname(__FILE__).'/../locales');
Index: inc/public/default-templates/dotty/_entry-content.html
===================================================================
--- inc/public/default-templates/dotty/_entry-content.html	(revision 3331)
+++ inc/public/default-templates/dotty/_entry-content.html	(revision 3289)
@@ -6,5 +6,5 @@
 			<p class="post-info">
 				<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-				<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate}}</time>. </span>
+				<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}" pubdate>{{tpl:EntryDate}}</time>. </span>
 				<span class="post-permalink"><a href="{{tpl:EntryURL}}">{{tpl:lang Permalink}}</a></span>
 				<tpl:EntryIf has_category="1">
Index: inc/public/default-templates/dotty/_entry-full.html
===================================================================
--- inc/public/default-templates/dotty/_entry-full.html	(revision 3331)
+++ inc/public/default-templates/dotty/_entry-full.html	(revision 3289)
@@ -25,5 +25,5 @@
 		<p class="post-info">
 			<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-			<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate}}</time>.</span>
+			<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}" pubdate>{{tpl:EntryDate}}</time>.</span>
 			<tpl:EntryIf has_category="1">
 			<span class="post-cat"><tpl:EntryCategoriesBreadcrumb><a
Index: inc/public/default-templates/dotty/_entry-short.html
===================================================================
--- inc/public/default-templates/dotty/_entry-short.html	(revision 3331)
+++ inc/public/default-templates/dotty/_entry-short.html	(revision 3289)
@@ -44,5 +44,5 @@
 		<p class="post-info">
 			<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-			<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate}}</time>.</span>
+			<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}" pubdate>{{tpl:EntryDate}}</time>.</span>
 			<tpl:EntryIf has_category="1">
 			<span class="post-cat"><tpl:EntryCategoriesBreadcrumb><a
Index: inc/public/default-templates/dotty/_entry-title.html
===================================================================
--- inc/public/default-templates/dotty/_entry-title.html	(revision 3331)
+++ inc/public/default-templates/dotty/_entry-title.html	(revision 3289)
@@ -19,5 +19,5 @@
 		<p class="post-info">
 			<span class="post-author">{{tpl:lang By}} {{tpl:EntryAuthorLink}}, </span>
-			<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}">{{tpl:EntryDate}}</time>. </span>
+			<span class="post-date"><time datetime="{{tpl:EntryDate iso8601="1"}}" pubdate>{{tpl:EntryDate}}</time>. </span>
 			<tpl:EntryIf has_category="1">
 				<tpl:EntryCategoriesBreadcrumb>
