turnermm / news

Dokuwiki plugin for creating external newsfeeds for feed readers
http://www.dokuwiki.org/plugin:news
0 stars 6 forks source link

[fix]media and link did not render. #17

Closed wildtruc closed 5 years ago

wildtruc commented 5 years ago

Feed in client wont return correct URL for links and media. I found the issue in feedData.php in regex preg_replace, in : line 61:

function description() {
  $this->currentDataArray['item'] =
            // previous regex
            //  preg_replace('#(href|src)\s*=\s*([\'\"])/.*?/#ms', "$1=$2" . $this->news_feed_url(), $this->currentDataArray['item']);
            // new regex
            preg_replace('#(href|src)\s*=\s*([\'\"])/#ms', "$1=$2" . $this->news_feed_url(), $this->currentDataArray['item']);
            return $this->currentDataArray['item'];
    }

This way, dokuwiki media and links return properly. Maybe there better regex to do, but I'm really not a php pro.

Have a good day !

turnermm commented 5 years ago

If y ou could make a pull request, I 'd be able to include it.

wildtruc commented 5 years ago

Well, ok, I'm not familiar with pull request. Time to learn ! With which repo do I use from base "master" ?

turnermm commented 5 years ago

Yes you use the master.

  1. Go to news at github and fork a copy, which is then youjr copy of the plugin.
  2. You can set up github so that you can then clone a copy to your own computer, where you can make your changes, or you can make changes in github itself by opening the relevant files for editing. .
  3. To make a pull request you need a new branch, which is where you make the changes. Once you push the changes to your copy from your computer or save them if working in github, you will see a pull link next to the branches drop-down menu. Once you click that link, the rest should be self-explanatory.
wildtruc commented 5 years ago

Thanks a lot. It my first pull request for an other project :) Simple, finally. Pull request done.