]> git.pld-linux.org Git - packages/dokuwiki-plugin-pagemove.git/commitdiff
- handle redirect links
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 25 Feb 2008 17:10:01 +0000 (17:10 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dokuwiki-plugin-pagemove-redirectlinks.patch -> 1.1
    dokuwiki-plugin-pagemove.spec -> 1.4

dokuwiki-plugin-pagemove-redirectlinks.patch [new file with mode: 0644]
dokuwiki-plugin-pagemove.spec

diff --git a/dokuwiki-plugin-pagemove-redirectlinks.patch b/dokuwiki-plugin-pagemove-redirectlinks.patch
new file mode 100644 (file)
index 0000000..cfbca92
--- /dev/null
@@ -0,0 +1,55 @@
+--- pagemove/admin.php 2008-02-25 19:02:48.062065053 +0200
++++ pagemove/admin.php 2008-02-25 19:01:41.271159305 +0200
+@@ -411,7 +411,8 @@
+     function _pm_updatelinks(&$text, $links)
+     {
+       foreach( $links as $old => $new ) {
+-        $text = preg_replace( '#\[\[' . $old . '((\]\])|[\|\#])#i', '[[' . $new . '\1', $text);
++        $text = preg_replace( '#\[\[' . $old . '(\]\]|[\|\#])#i', '[[' . $new . '\1', $text);
++        $text = preg_replace( '#~~REDIRECT>' . $old . '(~~|[\|\#])#i', '~~REDIRECT>' . $new . '\1', $text);
+       }
+     }
+@@ -440,7 +441,14 @@
+       //match all links
+       //FIXME may be incorrect because of code blocks
+       //      CamelCase isn't supported, too
+-      preg_match_all('#\[\[(.+?)\]\]#si',$text,$matches,PREG_SET_ORDER);
++      $matches = array();
++      if (preg_match_all('#\[\[(.+?)\]\]#s',$text,$m,PREG_SET_ORDER)) {
++        $matches = array_merge($matches, $m);
++      }
++      if (preg_match_all('#~~REDIRECT>(.+?)~~#s',$text,$m,PREG_SET_ORDER)) {
++        $matches = array_merge($matches, $m);
++      }
++
+       foreach($matches as $match){
+         //get ID from link and discard most non wikilinks
+         list($mid) = split('[\|#]',$match[1],2);
+@@ -572,9 +580,9 @@
+      */
+     function _pm_search_backlinks(&$data,$base,$file,$type,$lvl,$opts){
+       //we do nothing with directories
+-      if($type == 'd') return true;;
++      if($type == 'd') return true;
+       //only search txt files
+-      if(!preg_match('#\.txt$#',$file)) return true;;
++      if(!preg_match('#\.txt$#',$file)) return true;
+     
+       //get text
+       $text = io_readfile($base.'/'.$file);
+@@ -589,7 +597,13 @@
+       //match all links
+       //FIXME may be incorrect because of code blocks
+       //      CamelCase isn't supported, too
+-      preg_match_all('#\[\[(.+?)\]\]#si',$text,$matches,PREG_SET_ORDER);
++      $matches = array();
++      if (preg_match_all('#\[\[(.+?)\]\]#s',$text,$m,PREG_SET_ORDER)) {
++        $matches = array_merge($matches, $m);
++      }
++      if (preg_match_all('#~~REDIRECT>(.+?)~~#s',$text,$m,PREG_SET_ORDER)) {
++        $matches = array_merge($matches, $m);
++      }
+       foreach($matches as $match){
+         //get ID from link and discard most non wikilinks
+         list($mid) = split('[\|#]',$match[1],2);
index 7c0ac8746e9c07c30dfc3761b006f3ba8e69c0b4..3fcd5ac0ba51345160b77291e1f5ddf4c29552b0 100644 (file)
@@ -3,11 +3,12 @@ Summary:      DokuWiki PageMove plugin
 Summary(pl.UTF-8):     Wtyczka PageMove dla DokuWiki
 Name:          dokuwiki-plugin-%{_plugin}
 Version:       0.9.15a
 Summary(pl.UTF-8):     Wtyczka PageMove dla DokuWiki
 Name:          dokuwiki-plugin-%{_plugin}
 Version:       0.9.15a
-Release:       0.1
+Release:       0.2
 License:       GPL v2
 Group:         Applications/WWW
 Source0:       http://www.isection.co.uk/lib/exe/fetch.php?media=pagemove_20070722.zip
 # Source0-md5: f2cc2a57d40b877a335b52009e4cc072
 License:       GPL v2
 Group:         Applications/WWW
 Source0:       http://www.isection.co.uk/lib/exe/fetch.php?media=pagemove_20070722.zip
 # Source0-md5: f2cc2a57d40b877a335b52009e4cc072
+Patch0:                %{name}-redirectlinks.patch
 URL:           http://www.isection.co.uk/doku.php
 BuildRequires: sed >= 4.0
 Requires:      dokuwiki >= 20060309
 URL:           http://www.isection.co.uk/doku.php
 BuildRequires: sed >= 4.0
 Requires:      dokuwiki >= 20060309
@@ -39,10 +40,10 @@ W zupełności można:
 
 %prep
 %setup -q -n %{_plugin}
 
 %prep
 %setup -q -n %{_plugin}
-
 # undos the source
 %{__sed} -i -e 's,\r$,,' admin.php
 
 # undos the source
 %{__sed} -i -e 's,\r$,,' admin.php
 
+%patch0 -p1
 mv lang/cs/pagemove.txt{.txt,}
 mv lang/es/pagemove.txt{.txt,}
 mv lang/pl/pagemove.txt{.txt,}
 mv lang/cs/pagemove.txt{.txt,}
 mv lang/es/pagemove.txt{.txt,}
 mv lang/pl/pagemove.txt{.txt,}
This page took 0.140104 seconds and 4 git commands to generate.