]> git.pld-linux.org Git - packages/dokuwiki-plugin-pageredirect.git/commitdiff
- preserve #section anchors on redirect auto/th/dokuwiki-plugin-pageredirect-2-3
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 4 Jun 2012 12:34:04 +0000 (12:34 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dokuwiki-plugin-pageredirect.spec -> 1.8
    preserve-section.patch -> 1.1

dokuwiki-plugin-pageredirect.spec
preserve-section.patch [new file with mode: 0644]

index 25580a2d2b1bda7ab17e112161afc1aedb8efa95..3bc2f250b4e147eeed46300cbd6707141e28acf1 100644 (file)
@@ -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 (file)
index 0000000..9668a50
--- /dev/null
@@ -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(); 
+               } 
+       }
This page took 0.608199 seconds and 4 git commands to generate.