From 02dada1dbbd2d69100166fdb1a4e92f38754808d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 4 Jun 2012 12:34:04 +0000 Subject: [PATCH] - preserve #section anchors on redirect Changed files: dokuwiki-plugin-pageredirect.spec -> 1.8 preserve-section.patch -> 1.1 --- dokuwiki-plugin-pageredirect.spec | 4 +++- preserve-section.patch | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 preserve-section.patch diff --git a/dokuwiki-plugin-pageredirect.spec b/dokuwiki-plugin-pageredirect.spec index 25580a2..3bc2f25 100644 --- a/dokuwiki-plugin-pageredirect.spec +++ b/dokuwiki-plugin-pageredirect.spec @@ -3,7 +3,7 @@ Summary: DokuWiki Page Redirect Plugin Summary(pl.UTF-8): Wtyczka Page Redirect (przekierowywania stron) dla DokuWiki Name: dokuwiki-plugin-%{plugin} Version: 2 -Release: 2 +Release: 3 License: GPL v2 Group: Applications/WWW Source0: http://wiki.zyberdog.dk/_media/php/dw/pageredirect/pageredirect_current.zip @@ -11,6 +11,7 @@ Source0: http://wiki.zyberdog.dk/_media/php/dw/pageredirect/pageredirect_current Source1: dokuwiki-find-lang.sh Patch0: %{name}-pagematch.patch Patch1: mute-warning.patch +Patch2: preserve-section.patch URL: http://www.dokuwiki.org/plugin:page_redirector BuildRequires: unzip Requires: dokuwiki >= 20061106 @@ -33,6 +34,7 @@ przestrzeniami nazw poprzez dodawanie określonych oznaczeń na stronie. %setup -q -n %{plugin} %patch0 -p1 %patch1 -p1 +%patch2 -p1 %install rm -rf $RPM_BUILD_ROOT diff --git a/preserve-section.patch b/preserve-section.patch new file mode 100644 index 0000000..9668a50 --- /dev/null +++ b/preserve-section.patch @@ -0,0 +1,22 @@ +--- pageredirect/action.php 2012-06-04 15:32:26.364418325 +0300 ++++ pageredirect/action.php 2012-06-04 15:32:49.548728621 +0300 +@@ -63,9 +63,17 @@ + session_start(); + $_SESSION[DOKU_COOKIE]['redirect'] = $ID; + } +- ++ ++ // preserve #section from $page ++ list($page, $section) = explode('#', $page, 2); ++ if (isset($section)) { ++ $section = '#' . $section; ++ } else { ++ $section = ''; ++ } ++ + // redirect +- header("Location: ".wl($page, Array('redirect' => $redirect), TRUE, '&')); ++ header("Location: ".wl($page, Array('redirect' => $redirect), TRUE, '&'). $section); + exit(); + } + } -- 2.44.0