Remove reserved characters from URL, changes on labels
This commit is contained in:
parent
a3df822c65
commit
e674327a25
@ -64,7 +64,12 @@ class dbList extends dbJSON
|
||||
|
||||
public function generateKey($name)
|
||||
{
|
||||
global $L;
|
||||
|
||||
$key = Text::cleanUrl($name);
|
||||
if (Text::isEmpty($key)) {
|
||||
$key = $L->g('empty');
|
||||
}
|
||||
while (isset($this->db[$key])) {
|
||||
$key++;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ function table($type) {
|
||||
.'</a>
|
||||
</div>
|
||||
<div>
|
||||
<p style="font-size: 0.8em" class="m-0 text-uppercase text-muted">'.( ((ORDER_BY=='position') || ($type!='published'))?'Position: '.$page->position():$page->relativeTime() ).'</p>
|
||||
<p style="font-size: 0.8em" class="m-0 text-uppercase text-muted">'.( ((ORDER_BY=='position') || ($type!='published'))?'Position: '.$page->position():$page->date(MANAGE_CONTENT_DATE_FORMAT) ).'</p>
|
||||
</div>
|
||||
</td>';
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<a class="nav-link active" id="content-tab" data-toggle="tab" href="#content" role="tab" aria-controls="content" aria-selected="true"><?php $L->p('Editor') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="images-tab" data-toggle="tab" href="#images" role="tab" aria-controls="images" aria-selected="false"><?php $L->p('Images') ?></a>
|
||||
<a class="nav-link" id="images-tab" data-toggle="tab" href="#images" role="tab" aria-controls="images" aria-selected="false"><?php $L->p('Cover images') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link " id="options-tab" data-toggle="tab" href="#options" role="tab" aria-controls="options" aria-selected="false"><?php $L->p('Options') ?></a>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<a class="nav-link active" id="content-tab" data-toggle="tab" href="#content" role="tab" aria-controls="content" aria-selected="true"><?php $L->p('Editor') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="images-tab" data-toggle="tab" href="#images" role="tab" aria-controls="images" aria-selected="false"><?php $L->p('Images') ?></a>
|
||||
<a class="nav-link" id="images-tab" data-toggle="tab" href="#images" role="tab" aria-controls="images" aria-selected="false"><?php $L->p('Cover images') ?></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link " id="options-tab" data-toggle="tab" href="#options" role="tab" aria-controls="options" aria-selected="false"><?php $L->p('Options') ?></a>
|
||||
|
@ -66,7 +66,7 @@ elseif ($url->whereAmI()==='tag') {
|
||||
}
|
||||
// Build content by category
|
||||
elseif ($url->whereAmI()==='category') {
|
||||
$content = buildPagesByCategory();
|
||||
$content = buildPagesByCategory();
|
||||
}
|
||||
// Build content for the homepage
|
||||
elseif ( ($url->whereAmI()==='home') || ($url->whereAmI()==='blog') ) {
|
||||
|
@ -80,6 +80,9 @@ define('SCHEDULED_DATE_FORMAT', 'D, j M Y, H:i');
|
||||
// Notifications date format
|
||||
define('NOTIFICATIONS_DATE_FORMAT', 'D, j M Y, H:i');
|
||||
|
||||
// Manage content date format
|
||||
define('MANAGE_CONTENT_DATE_FORMAT', 'D, j M Y, H:i');
|
||||
|
||||
// Amount of items to show on notification panel
|
||||
define('NOTIFICATIONS_AMOUNT', 10);
|
||||
|
||||
|
@ -131,7 +131,7 @@ class Text {
|
||||
if (EXTREME_FRIENDLY_URL) {
|
||||
$string = self::lowercase($string);
|
||||
$string = trim($string, $separator);
|
||||
$string = preg_replace("/[\/_|+:!@#$%^&*(). -]+/", $separator, $string);
|
||||
$string = preg_replace("/[\/_|+:!@#$%^&*()';=,?\[\]~. -]+/", $separator, $string);
|
||||
$string = trim($string, $separator);
|
||||
return $string;
|
||||
}
|
||||
|
@ -645,6 +645,8 @@ class Pages extends dbJSON {
|
||||
// Generate a valid Key/Slug
|
||||
public function generateKey($text, $parent=false, $returnSlug=false, $oldKey='')
|
||||
{
|
||||
global $L;
|
||||
|
||||
if (Text::isEmpty($text)) {
|
||||
$text = 'empty';
|
||||
}
|
||||
@ -657,7 +659,7 @@ class Pages extends dbJSON {
|
||||
|
||||
// cleanURL can return empty string
|
||||
if (Text::isEmpty($newKey)) {
|
||||
$newKey = 'empty';
|
||||
$key = $L->g('empty');
|
||||
}
|
||||
|
||||
if ($newKey!==$oldKey) {
|
||||
|
Loading…
Reference in New Issue
Block a user