Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
position: relative;
margin: 2px;
color: $choices-list-multiple-item; //$white;
background-color: $choices-list-multiple-item-bg; // var(--template-bg-dark);
background-color: $choices-list-multiple-item-bg !important; // var(--template-bg-dark);
margin-inline-end: 2px;
border: 0;
border-radius: $border-radius;
Expand Down
2 changes: 1 addition & 1 deletion components/com_config/tmpl/config/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</h1>
</div>
<?php endif; ?>
<form action="<?php echo Route::_('index.php?option=com_config'); ?>" id="application-form" method="post" name="adminForm" class="form-validate">
<form action="<?php echo Route::_('index.php'); ?>" method="post" name="adminForm" id="application-form" class="form-validate">

<div class="mb-2 d-flex">
<button type="button" class="btn btn-sm btn-outline-info button-inlinehelp ms-auto">
Expand Down
2 changes: 1 addition & 1 deletion components/com_config/tmpl/modules/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}
?>

<form action="<?php echo Route::_('index.php?option=com_config'); ?>" method="post" name="adminForm" id="modules-form" class="form-validate">
<form action="<?php echo Route::_('index.php'); ?>" method="post" name="adminForm" id="modules-form" class="form-validate">
<div class="row">
<div class="col-md-12">
<legend><?php echo Text::_('COM_CONFIG_MODULES_SETTINGS_TITLE'); ?></legend>
Expand Down
2 changes: 1 addition & 1 deletion components/com_config/tmpl/templates/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</h1>
</div>
<?php endif; ?>
<form action="<?php echo Route::_('index.php?option=com_config'); ?>" method="post" name="adminForm" id="templates-form" class="form-validate">
<form action="<?php echo Route::_('index.php'); ?>" method="post" name="adminForm" id="templates-form" class="form-validate">

<div id="page-site" class="tab-pane active">
<div class="row">
Expand Down
2 changes: 1 addition & 1 deletion components/com_contact/tmpl/form/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</div>
<?php endif; ?>

<form action="<?php echo Route::_('index.php?option=com_contact&id=' . (int) $this->item->id); ?>" method="post"
<form action="<?php echo Route::_('index.php'); ?>" method="post"
name="adminForm" id="adminForm" class="form-validate form-vertical">
<fieldset>
<?php echo HTMLHelper::_('uitab.startTabSet', $this->tab_name, ['active' => 'details', 'recall' => true, 'breakpoint' => 768]); ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_content/tmpl/form/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</div>
<?php endif; ?>

<form action="<?php echo Route::_('index.php?option=com_content&a_id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical">
<form action="<?php echo Route::_('index.php'); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical">
<fieldset>
<?php echo HTMLHelper::_('uitab.startTabSet', $this->tab_name, ['active' => 'editor', 'recall' => true, 'breakpoint' => 768]); ?>

Expand Down
2 changes: 1 addition & 1 deletion components/com_privacy/tmpl/confirm/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</h1>
</div>
<?php endif; ?>
<form action="<?php echo Route::_('index.php?option=com_privacy&task=request.confirm'); ?>" method="post" class="form-validate form-horizontal well">
<form action="<?php echo Route::_('index.php?task=request.confirm'); ?>" method="post" class="form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<?php if (!empty($fieldset->label)) : ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_privacy/tmpl/remind/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</h1>
</div>
<?php endif; ?>
<form action="<?php echo Route::_('index.php?option=com_privacy&task=request.remind'); ?>" method="post" class="form-validate form-horizontal well">
<form action="<?php echo Route::_('index.php?task=request.remind'); ?>" method="post" class="form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<?php if (!empty($fieldset->label)) : ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_privacy/tmpl/request/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
<?php endif; ?>
<?php if ($this->sendMailEnabled) : ?>
<form action="<?php echo Route::_('index.php?option=com_privacy&task=request.submit'); ?>" method="post" class="form-validate form-horizontal well">
<form action="<?php echo Route::_('index.php?task=request.submit'); ?>" method="post" class="form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<?php if (!empty($fieldset->label)) : ?>
Expand Down
4 changes: 2 additions & 2 deletions components/com_users/tmpl/captive/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class="btn btn-sm btn-secondary"
</div>
<?php endif; ?>

<form action="<?php echo Route::_('index.php?option=com_users&task=captive.validate&record_id=' . ((int) $this->record->id)) ?>"
id="users-mfa-captive-form"
<form action="<?php echo Route::_('index.php?task=captive.validate&record_id=' . ((int) $this->record->id)) ?>"
method="post"
id="users-mfa-captive-form"
class="form-horizontal"
>
<?php echo HTMLHelper::_('form.token') ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/login/default_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</div>
<?php endif; ?>

<form action="<?php echo Route::_('index.php?option=com_users&task=user.login'); ?>" method="post" class="com-users-login__form form-validate form-horizontal well" id="com-users-login__form">
<form action="<?php echo Route::_('index.php?task=user.login'); ?>" method="post" id="com-users-login__form" class="com-users-login__form form-validate form-horizontal well">

<fieldset>
<?php echo $this->form->renderFieldset('credentials', ['class' => 'com-users-login__input']); ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/login/default_logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</div>
<?php endif; ?>

<form action="<?php echo Route::_('index.php?option=com_users&task=user.logout'); ?>" method="post" class="com-users-logout__form form-horizontal well">
<form action="<?php echo Route::_('index.php?task=user.logout'); ?>" method="post" class="com-users-logout__form form-horizontal well">
<div class="com-users-logout__submit control-group">
<div class="controls">
<button type="submit" class="btn btn-primary">
Expand Down
4 changes: 2 additions & 2 deletions components/com_users/tmpl/method/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
$hideSubmit = !$this->renderOptions['show_submit'] && !$this->isEditExisting
?>
<div class="card card-body">
<form action="<?php echo Route::_(sprintf("index.php?option=com_users&task=method.save&id=%d&method=%s&user_id=%d", $recordId, $method, $userId)) ?>"
class="form form-horizontal" id="com-users-method-edit" method="post">
<form action="<?php echo Route::_(sprintf("index.php?task=method.save&id=%d&method=%s&user_id=%d", $recordId, $method, $userId)) ?>"
method="post" id="com-users-method-edit" class="form form-horizontal">
<?php echo HTMLHelper::_('form.token') ?>
<?php if (!empty($this->returnURL)) : ?>
<input type="hidden" name="returnurl" value="<?php echo $this->escape($this->returnURL) ?>">
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/profile/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</div>
<?php endif; ?>

<form id="member-profile" action="<?php echo Route::_('index.php?option=com_users'); ?>" method="post" class="com-users-profile__edit-form form-validate form-horizontal well" enctype="multipart/form-data">
<form id="member-profile" action="<?php echo Route::_('index.php'); ?>" method="post" class="com-users-profile__edit-form form-validate form-horizontal well" enctype="multipart/form-data">
<?php // Iterate through the form fieldsets and display each one. ?>
<?php foreach ($this->form->getFieldsets() as $group => $fieldset) : ?>
<?php $fields = $this->form->getFieldset($group); ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/registration/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>
<?php endif; ?>

<form id="member-registration" action="<?php echo Route::_('index.php?option=com_users&task=registration.register'); ?>" method="post" class="com-users-registration__form form-validate" enctype="multipart/form-data">
<form id="member-registration" action="<?php echo Route::_('index.php?task=registration.register'); ?>" method="post" class="com-users-registration__form form-validate" enctype="multipart/form-data">
<?php // Iterate through the form fieldsets and display each one. ?>
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<?php if ($fieldset->name === 'captcha' && $this->captchaEnabled) : ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/remind/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</h1>
</div>
<?php endif; ?>
<form id="user-registration" action="<?php echo Route::_('index.php?option=com_users&task=remind.remind'); ?>" method="post" class="com-users-remind__form form-validate form-horizontal well">
<form action="<?php echo Route::_('index.php?task=remind.remind'); ?>" method="post" id="user-registration" class="com-users-remind__form form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<?php if (isset($fieldset->label)) : ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/reset/complete.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</h1>
</div>
<?php endif; ?>
<form action="<?php echo Route::_('index.php?option=com_users&task=reset.complete'); ?>" method="post" class="com-users-reset-complete__form form-validate form-horizontal well">
<form action="<?php echo Route::_('index.php?task=reset.complete'); ?>" method="post" class="com-users-reset-complete__form form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<?php if (isset($fieldset->label)) : ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/reset/confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</h1>
</div>
<?php endif; ?>
<form action="<?php echo Route::_('index.php?option=com_users&task=reset.confirm'); ?>" method="post" class="com-users-reset-confirm__form form-validate form-horizontal well">
<form action="<?php echo Route::_('index.php?task=reset.confirm'); ?>" method="post" class="com-users-reset-confirm__form form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<?php if (isset($fieldset->label)) : ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_users/tmpl/reset/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</h1>
</div>
<?php endif; ?>
<form id="user-registration" action="<?php echo Route::_('index.php?option=com_users&task=reset.request'); ?>" method="post" class="com-users-reset__form form-validate form-horizontal well">
<form action="<?php echo Route::_('index.php?task=reset.request'); ?>" method="post" id="user-registration" class="com-users-reset__form form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<?php if (isset($fieldset->label)) : ?>
Expand Down
75 changes: 34 additions & 41 deletions libraries/src/HTML/Helpers/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ abstract class StringHelper
*/
public static function truncate($text, $length = 0, $noSplit = true, $allowHtml = true)
{
// Assume a lone open tag is invalid HTML.
// Assume a lone open tag is invalid HTML
if ($length === 1 && $text[0] === '<') {
return '...';
}
Expand Down Expand Up @@ -156,87 +156,80 @@ public static function truncate($text, $length = 0, $noSplit = true, $allowHtml
*/
public static function truncateComplex($html, $maxLength = 0, $noSplit = true)
{
// Start with some basic rules.
$baseLength = \strlen($html);

// If the original HTML string is shorter than the $maxLength do nothing and return that.
if ($baseLength <= $maxLength || $maxLength === 0) {
// Early return for trivial cases
if ($maxLength === 0 || $baseLength <= $maxLength) {
return $html;
}

// Take care of short simple cases.
if ($maxLength <= 3 && $html[0] !== '<' && !str_contains(substr($html, 0, $maxLength - 1), '<') && $baseLength > $maxLength) {
// Special case: very short cutoff, plain text.
if ($maxLength <= 3 && $html[0] !== '<' && !str_contains(substr($html, 0, max(0, $maxLength - 1)), '<')) {
return '...';
}

// Deal with maximum length of 1 where the string starts with a tag.
// Special case: string starts with a tag and maxLength is 1
if ($maxLength === 1 && $html[0] === '<') {
$endTagPos = \strlen(strstr($html, '>', true));
$tag = substr($html, 1, $endTagPos);

$l = $endTagPos + 1;

if ($noSplit) {
return substr($html, 0, $l) . '</' . $tag . '...';
$endTagPos = strpos($html, '>');
if ($endTagPos === false) {
return '...';
}

// @todo: $character doesn't seem to be used...
$character = substr(strip_tags($html), 0, 1);

return substr($html, 0, $l) . '</' . $tag . '...';
$tag = substr($html, 1, $endTagPos - 1);
return substr($html, 0, $endTagPos + 1) . "</$tag>...";
}

// First get the truncated plain text string. This is the rendered text we want to end up with.
$ptString = HTMLHelper::_('string.truncate', $html, $maxLength, $noSplit, $allowHtml = false);
// Get a plain text truncated string
$ptString = HTMLHelper::_('string.truncate', $html, $maxLength, $noSplit, false);

// It's all HTML, just return it.
if ($ptString === '') {
return $html;
}

// If the plain text is shorter than the max length the variable will not end in ...
// In that case we use the whole string.
if (!str_ends_with($ptString, '...')) {
return $html;
}

// Regular truncate gives us the ellipsis but we want to go back for text and tags.
if ($ptString === '...') {
$stripped = substr(strip_tags($html), 0, $maxLength);
$ptString = HTMLHelper::_('string.truncate', $stripped, $maxLength, $noSplit, $allowHtml = false);
$ptString = HTMLHelper::_('string.truncate', $stripped, $maxLength, $noSplit, false);
}

// We need to trim the ellipsis that truncate adds.
$ptString = rtrim($ptString, '.');

// Now deal with more complex truncation.
while ($maxLength <= $baseLength) {
// Get the truncated string assuming HTML is allowed.
$htmlString = HTMLHelper::_('string.truncate', $html, $maxLength, $noSplit, $allowHtml = true);
$htmlString = HTMLHelper::_('string.truncate', $html, $maxLength, $noSplit, true);

if ($htmlString === '...' && \strlen($ptString) + 3 > $maxLength) {
return $htmlString;
return '...';
}

$htmlString = rtrim($htmlString, '.');

// Now get the plain text from the HTML string and trim it.
$htmlStringToPtString = HTMLHelper::_('string.truncate', $htmlString, $maxLength, $noSplit, $allowHtml = false);
// Get the plain text version of the truncated HTML string
$htmlStringToPtString = HTMLHelper::_('string.truncate', $htmlString, $maxLength, $noSplit, false);
$htmlStringToPtString = rtrim($htmlStringToPtString, '.');

// If the new plain text string matches the original plain text string we are done.
// If plain text matches, we're done
if ($ptString === $htmlStringToPtString) {
// Remove whitespace, non-breaking spaces, and trailing tags before the ellipsis
$htmlString = preg_replace('/(&nbsp;|\s)+(<\/[^>]+>)?$/u', '', $htmlString);

// If it ends with a closing tag, try to inject the ellipsis before the last closing tag
if (preg_match('/(<\/[^>]+>)$/', $htmlString, $matches)) {
return preg_replace('/(<\/[^>]+>)$/', '...$1', $htmlString);
}
return $htmlString . '...';
}

// Get the number of HTML tag characters in the first $maxLength characters
// Adjust length for HTML tags
$diffLength = \strlen($ptString) - \strlen($htmlStringToPtString);

if ($diffLength <= 0) {
// Remove whitespace, non-breaking spaces, and trailing tags before the ellipsis
$htmlString = preg_replace('/(&nbsp;|\s)+(<\/[^>]+>)?$/u', '', $htmlString);

// If it ends with a closing tag, inject the ellipsis before the last closing tag
if (preg_match('/(<\/[^>]+>)$/', $htmlString, $matches)) {
return preg_replace('/(<\/[^>]+>)$/', '...$1', $htmlString);
}
return $htmlString . '...';
}

// Set new $maxlength that adjusts for the HTML tags
$maxLength += $diffLength;
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/MVC/Controller/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ public function save($key = null, $urlVar = null)
$urlVar = $key;
}

$recordId = $this->input->getInt($urlVar);
$recordId = (int) $this->input->getInt($urlVar);

// Populate the row id from the session.
$data[$key] = $recordId;
Expand Down
2 changes: 1 addition & 1 deletion modules/mod_breadcrumbs/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
$wa->addInline(
'script',
json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | $prettyPrint),
['name' => 'inline.mod_breadcrumbs-schemaorg'],
['name' => 'inline.breadcrumbs-schemaorg'],
['type' => 'application/ld+json']
);
}
Expand Down
10 changes: 5 additions & 5 deletions plugins/quickicon/eos/src/Extension/Eos.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ final class Eos extends CMSPlugin implements SubscriberInterface
* @var string
* @since 4.4.0
*/
private const EOS_DATE = '2027-10-19';
private const EOS_DATE = '2027-10-12';

/**
* Load the language file on instantiation.
Expand Down Expand Up @@ -189,7 +189,7 @@ private function getMessageInfo(int $monthsUntilEOS, int $inverted): array
'id' => 5,
'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_ERROR_SUPPORT_ENDED',
'messageType' => 'error',
'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Joomla_4.4.x_to_5.x_Planning_and_Upgrade_Step_by_Step',
'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Joomla_5.4.x_to_6.x_Planning_and_Upgrade_Step_by_Step',
'snoozable' => false,
];
}
Expand All @@ -200,7 +200,7 @@ private function getMessageInfo(int $monthsUntilEOS, int $inverted): array
'id' => 4,
'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_WARNING_SUPPORT_ENDING',
'messageType' => 'warning',
'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Joomla_4.4.x_to_5.x_Planning_and_Upgrade_Step_by_Step',
'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Joomla_5.4.x_to_6.x_Planning_and_Upgrade_Step_by_Step',
'snoozable' => true,
];
}
Expand All @@ -211,7 +211,7 @@ private function getMessageInfo(int $monthsUntilEOS, int $inverted): array
'id' => 3,
'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_WARNING_SECURITY_ONLY',
'messageType' => 'warning',
'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Joomla_4.4.x_to_5.x_Planning_and_Upgrade_Step_by_Step',
'messageLink' => 'https://docs.joomla.org/Special:MyLanguage/Joomla_5.4.x_to_6.x_Planning_and_Upgrade_Step_by_Step',
'snoozable' => true,
];
}
Expand All @@ -233,7 +233,7 @@ private function getMessageInfo(int $monthsUntilEOS, int $inverted): array
'id' => 1,
'messageText' => 'PLG_QUICKICON_EOS_MESSAGE_INFO_01',
'messageType' => 'info',
'messageLink' => 'https://joomla.org/5',
'messageLink' => 'https://joomla.org/6',
'snoozable' => true,
];
}
Expand Down
Loading
Loading