Skip to content

Commit e5d91b7

Browse files
author
SedLex
committed
* Avoid canonical redirection if the url is a code url
1 parent 4a47f28 commit e5d91b7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

legi-display.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Plugin Name: Legi Display
44
Plugin Tag: tag
55
Description: <p>Display French Codes and laws once the XML files are retrieved from ftp://legi@ftp2.journal-officiel.gouv.fr/</p><p>See http://rip.journal-officiel.gouv.fr/index.php/pages/LO for the licence</p>
6-
Version: 1.0.0
6+
Version: 1.0.1
7+
78
Framework: SL_Framework
89
Author: SedLex
910
Author URI: http://www.sedlex.fr/
@@ -72,6 +73,12 @@ protected function _init() {
7273

7374
add_filter('template_include',array($this,'display_code_change_template'), 1);
7475
add_filter('the_posts', array($this, 'display_code_define_post'));
76+
77+
78+
$url = $this->parse_legi_uri() ;
79+
if (is_array($url)) {
80+
remove_action('template_redirect', 'redirect_canonical');
81+
}
7582

7683
}
7784

readme.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ Have fun !
4949

5050
== Changelog ==
5151

52+
= 1.0.1 =
53+
* Avoid canonical redirection if the url is a code url
54+
5255
= 1.0.0 =
5356
* First release : enjoy !
5457

5558
== Frequently Asked Questions ==
5659

5760

58-
InfoVersion:4a68b37f155d0016c39f65f1b8d3189b9aeb0bc3
61+
InfoVersion:cbf59b46bce29bc339edf1aa01aee65ea905a1bf

0 commit comments

Comments
 (0)