From 92f6cc299ef2dc8c94d1b9ac8495ac015971cca9 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Sat, 7 Oct 2017 21:49:41 +0200 Subject: [PATCH] RSS fixes, Micro theme improves --- bl-kernel/boot/init.php | 3 +++ bl-kernel/functions.php | 4 ++-- bl-kernel/login.class.php | 9 +++++++-- bl-plugins/opengraph/plugin.php | 14 +++++++++++--- bl-plugins/rss/plugin.php | 2 +- bl-plugins/twitter-cards/plugin.php | 13 +++++++++++-- bl-themes/micro/css/style.css | 2 +- bl-themes/micro/php/home.php | 15 ++++++++++++++- 8 files changed, 50 insertions(+), 12 deletions(-) diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index 1819ef8d..033c332d 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -89,6 +89,9 @@ define('PROFILE_IMG_WIDTH', 400); define('PROFILE_IMG_HEIGHT', 400); define('PROFILE_IMG_QUALITY', 100); // 100% +// Password length +define('PASSWORD_LENGTH', 6); + // Password salt length define('SALT_LENGTH', 8); diff --git a/bl-kernel/functions.php b/bl-kernel/functions.php index af5b5b9a..47ceb47f 100644 --- a/bl-kernel/functions.php +++ b/bl-kernel/functions.php @@ -522,8 +522,8 @@ function createUser($args) { } // Password length - if( strlen($args['new_password']) < 6 ) { - Alert::set($Language->g('Password must be at least 6 characters long'), ALERT_STATUS_FAIL); + if( Text::length($args['new_password']) < PASSWORD_LENGTH ) { + Alert::set($Language->g('Password must be at least '.PASSWORD_LENGTH.' characters long'), ALERT_STATUS_FAIL); return false; } diff --git a/bl-kernel/login.class.php b/bl-kernel/login.class.php index b0d4f06e..96d5e1e1 100644 --- a/bl-kernel/login.class.php +++ b/bl-kernel/login.class.php @@ -61,7 +61,12 @@ class Login { $password = trim($password); if (empty($username) || empty($password)) { - Log::set(__METHOD__.LOG_SEP.'Username or password empty. Username: '.$username.' - Password: '.$password); + Log::set(__METHOD__.LOG_SEP.'Username or password empty. Username: '.$username); + return false; + } + + if (Text::length($password)get('Default image').''; + $html .= ''; + $html .= ''; + + /* $html = '
'; $html .= ''; $html .= ''; $html .= '
'; + */ return $html; } @@ -64,7 +71,7 @@ class pluginOpenGraph extends Plugin { default: $content = ''; // The image it's from the first page - if(isset($pages[0]) ) { + if (isset($pages[0]) ) { $og['image'] = $pages[0]->coverImage($absolute=true); $content = $pages[0]->content(); } @@ -86,12 +93,13 @@ class pluginOpenGraph extends Plugin { if ($src!==false) { $og['image'] = $src; } else { - $og['image'] = DOMAIN_UPLOADS.$this->getValue('defaultImage'); + if (Text::isNotEmpty($this->getValue('defaultImage'))) { + $og['image'] = $this->getValue('defaultImage'); + } } } $html .= ''.PHP_EOL; - return $html; } diff --git a/bl-plugins/rss/plugin.php b/bl-plugins/rss/plugin.php index ce170375..a480adb0 100644 --- a/bl-plugins/rss/plugin.php +++ b/bl-plugins/rss/plugin.php @@ -57,7 +57,7 @@ class pluginRSS extends Plugin { $xml .= ''; $xml .= ''.$page->title().''; $xml .= ''.$page->permalink().''; - $xml .= ''.$page->contentBreak().''; + $xml .= ''.Sanitize::html($page->contentBreak()).''; $xml .= ''.$page->dateRaw('r').''; $xml .= ''.$page->uuid().''; $xml .= ''; diff --git a/bl-plugins/twitter-cards/plugin.php b/bl-plugins/twitter-cards/plugin.php index 8c9bba7a..e95c08c9 100644 --- a/bl-plugins/twitter-cards/plugin.php +++ b/bl-plugins/twitter-cards/plugin.php @@ -14,6 +14,12 @@ class pluginTwitterCards extends Plugin { { global $Language; + $html = '
'; + $html .= ''; + $html .= ''; + $html .= '
'; + + /* $html = '
'; $html .= ''; $html .= ''; $html .= '
'; + */ return $html; } @@ -80,7 +87,9 @@ class pluginTwitterCards extends Plugin { if ($src!==false) { $og['image'] = $src; } else { - $og['image'] = DOMAIN_UPLOADS.$this->getValue('defaultImage'); + if (Text::isNotEmpty($this->getValue('defaultImage'))) { + $og['image'] = $this->getValue('defaultImage'); + } } } @@ -108,4 +117,4 @@ class pluginTwitterCards extends Plugin { return false; } -} +} \ No newline at end of file diff --git a/bl-themes/micro/css/style.css b/bl-themes/micro/css/style.css index d10ca9f9..90ecaa6b 100755 --- a/bl-themes/micro/css/style.css +++ b/bl-themes/micro/css/style.css @@ -5201,7 +5201,7 @@ tbody.collapse.in { .pagination > li > span { position: relative; float: left; - padding: 14px 12px; + padding: 5px 10px; line-height: 1.42857; text-decoration: none; color: #e32929; diff --git a/bl-themes/micro/php/home.php b/bl-themes/micro/php/home.php index e0205e89..d2664f16 100644 --- a/bl-themes/micro/php/home.php +++ b/bl-themes/micro/php/home.php @@ -19,4 +19,17 @@ - \ No newline at end of file + + + + \ No newline at end of file