Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirects Plugin - Make Relative or Absolute. #19942

Merged
merged 5 commits into from
Mar 25, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.plg_system_redirect.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ PLG_SYSTEM_REDIRECT_FIELD_EXCLUDE_URLS_REGEXP_LABEL="Regular Expression"
PLG_SYSTEM_REDIRECT_FIELD_EXCLUDE_URLS_TERM_DESC="A regular expression or a term which should be excluded."
PLG_SYSTEM_REDIRECT_FIELD_EXCLUDE_URLS_TERM_LABEL="Term"
PLG_SYSTEM_REDIRECT_XML_DESCRIPTION="The system redirect plugin enables the Joomla Redirect system to catch missing pages and redirect users."
PLG_SYSTEM_REDIRECT_FIELD_STORE_FULL_URL_LABEL="Include domain name in ExpiredURL"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a space in ExpiredURL please

PLG_SYSTEM_REDIRECT_FIELD_STORE_FULL_URL_DESC="When we save the expired url should we include the domain name? if not we will store it relatively i.e. https://www.joomla.org/article becomes /article."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after a ? it is a new sentence so it must start with a capital letter

5 changes: 5 additions & 0 deletions plugins/system/redirect/redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ private static function doErrorHandling($error)

if ((bool) $params->get('collect_urls', true))
{
if (!$params->get('includeUrl', 1))
{
$url = $urlRel;
}

$data = (object) array(
'id' => 0,
'old_url' => $url,
Expand Down
11 changes: 11 additions & 0 deletions plugins/system/redirect/redirect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@
<option value="1">JENABLED</option>
<option value="0">JDISABLED</option>
</field>
<field
name="includeUrl"
type="radio"
label="PLG_SYSTEM_REDIRECT_FIELD_STORE_FULL_URL_LABEL"
description="PLG_SYSTEM_REDIRECT_FIELD_STORE_FULL_URL_DESC"
default="1"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="exclude_urls"
type="subform"
Expand Down