RSS fixes, Micro theme improves

This commit is contained in:
Diego Najar 2017-10-07 21:49:41 +02:00
parent 57a9a13152
commit 92f6cc299e
8 changed files with 50 additions and 12 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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)<PASSWORD_LENGTH) {
Log::set(__METHOD__.LOG_SEP.'Password lenght less than required.');
return false;
}

View File

@ -14,6 +14,12 @@ class pluginOpenGraph extends Plugin {
{
global $Language;
$html = '<div>';
$html .= '<label>'.$Language->get('Default image').'</label>';
$html .= '<input id="jsdefaultImage" name="defaultImage" type="text" value="'.$this->getValue('defaultImage').'" placeholder="https://">';
$html .= '</div>';
/*
$html = '<div>';
$html .= '<label>'.$Language->get('Default image').'</label>';
$html .= '<select name="defaultImage">';
@ -26,6 +32,7 @@ class pluginOpenGraph extends Plugin {
$html .= '</select>';
$html .= '</div>';
*/
return $html;
}
@ -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 .= '<meta property="og:image" content="'.$og['image'].'">'.PHP_EOL;
return $html;
}

View File

@ -57,7 +57,7 @@ class pluginRSS extends Plugin {
$xml .= '<item>';
$xml .= '<title>'.$page->title().'</title>';
$xml .= '<link>'.$page->permalink().'</link>';
$xml .= '<description>'.$page->contentBreak().'</description>';
$xml .= '<description>'.Sanitize::html($page->contentBreak()).'</description>';
$xml .= '<pubDate>'.$page->dateRaw('r').'</pubDate>';
$xml .= '<guid isPermaLink="false">'.$page->uuid().'</guid>';
$xml .= '</item>';

View File

@ -14,6 +14,12 @@ class pluginTwitterCards extends Plugin {
{
global $Language;
$html = '<div>';
$html .= '<label>'.$Language->get('Default image').'</label>';
$html .= '<input id="jsdefaultImage" name="defaultImage" type="text" value="'.$this->getValue('defaultImage').'" placeholder="https://">';
$html .= '</div>';
/*
$html = '<div>';
$html .= '<label>'.$Language->get('Default image').'</label>';
$html .= '<select name="defaultImage">';
@ -26,6 +32,7 @@ class pluginTwitterCards extends Plugin {
$html .= '</select>';
$html .= '</div>';
*/
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');
}
}
}

View File

@ -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;

View File

@ -20,3 +20,16 @@
</article>
<?php endforeach ?>
</section>
<!-- Pagination -->
<ul class="pagination">
<?php
if (Paginator::showPrev()) {
echo '<li><a href="'.Paginator::prevPageUrl().'">'.$L->get('Next').'</a></li>';
}
if (Paginator::showNext()) {
echo '<li><a href="'.Paginator::nextPageUrl().'">'.$L->get('Previuos').'</a></li>';
}
?>
</ul>