Skip to content

Commit

Permalink
* FIX: Allow manually created redirects to redirect to the default 40…
Browse files Browse the repository at this point in the history
…4 page or to the home page (for Janio).
  • Loading branch information
aaron13100 committed Dec 16, 2022
1 parent da4c909 commit 9dcce5c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 404-solution.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Author: Aaron J
Author URI: https://www.ajexperience.com/404-solution/
Version: 2.31.7
Version: 2.31.8
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog #

## Version 2.31.8 (December 16, 2022) ##
* FIX: Allow manually created redirects to redirect to the default 404 page or to the home page (for Janio).

## Version 2.31.7 (December 16, 2022) ##
* Improvement: Allow manually created redirects to redirect to the default 404 page or to the home page (for Janio).

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ Please try this website for studying Japanese flashcards.

## Changelog ##

## Version 2.31.8 (December 16, 2022) ##
* FIX: Allow manually created redirects to redirect to the default 404 page or to the home page (for Janio).

## Version 2.31.7 (December 16, 2022) ##
* Improvement: Allow manually created redirects to redirect to the default 404 page or to the home page (for Janio).

Expand Down
2 changes: 1 addition & 1 deletion includes/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
define('ABJ404_SOLUTION_BASENAME', function_exists('plugin_basename') ? plugin_basename(ABJ404_FILE) :
basename(dirname(ABJ404_FILE)) . '/' . basename(ABJ404_FILE));

define( 'ABJ404_VERSION', '2.31.7' );
define( 'ABJ404_VERSION', '2.31.8' );
define( 'URL_TRACKING_SUFFIX', '?utm_source=404SolutionPlugin&utm_medium=WordPress');
define( 'ABJ404_HOME_URL', 'https://www.ajexperience.com/404-solution/' . URL_TRACKING_SUFFIX);
define( 'ABJ404_FC_URL', 'https://www.ajexperience.com/' . URL_TRACKING_SUFFIX);
Expand Down
6 changes: 4 additions & 2 deletions includes/PluginLogic.php
Original file line number Diff line number Diff line change
Expand Up @@ -1653,8 +1653,10 @@ function getCommentPartAndQueryPartOfRequest() {
* if some other plugin has already output any kind of data.
* @param string $location
* @param number $status
* @param number $type only 0 for sending to a 404 page
* @param string $requestedURL
*/
function forceRedirect($location, $status = 302, $type = null, $requestedURL = '') {
function forceRedirect($location, $status = 302, $type = -1, $requestedURL = '') {
$f = ABJ_404_Solution_Functions::getInstance();
$abj404logging = ABJ_404_Solution_Logging::getInstance();

Expand All @@ -1681,7 +1683,7 @@ function forceRedirect($location, $status = 302, $type = null, $requestedURL = '
}

// if the destination is the default 404 page then send the user there.
if ($type === ABJ404_TYPE_404_DISPLAYED) {
if ($type == ABJ404_TYPE_404_DISPLAYED) {
$abj404logic = ABJ_404_Solution_PluginLogic::getInstance();
$abj404logic->sendTo404Page($requestedURL, '', false);
exit;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "404-solution",
"version": "2.31.7",
"version": "2.31.8",
"description": "The 404 Solution Plugin.",
"main": "Gulpfile.js",
"dependencies": {
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Website: https://www.ajexperience.com/404-solution/
Tags: 404, page not found, redirect, 301, 302, permanent redirect, temporary redirect, error, permalink redirect, permalink
Requires at least: 3.9
Tested up to: 6.1
Stable tag: 2.31.7
Stable tag: 2.31.8

Automatically redirect page not found errors (404s) when the slug matches (for permalink changes), when a very similar name match is found, or always to a default page.

Expand Down Expand Up @@ -84,6 +84,9 @@ Please try this website for studying flashcards.

== Changelog ==

= Version 2.31.8 (December 16, 2022) =
* FIX: Allow manually created redirects to redirect to the default 404 page or to the home page (for Janio).

= Version 2.31.7 (December 16, 2022) =
* Improvement: Allow manually created redirects to redirect to the default 404 page or to the home page (for Janio).

Expand Down

0 comments on commit 9dcce5c

Please sign in to comment.