otetard / ownpad

Ownpad is a Nextcloud application that allows to create and open Etherpad and Ethercalc documents.
GNU Affero General Public License v3.0
58 stars 25 forks source link

Cross-Platform-Links #5

Open inos-github opened 8 years ago

inos-github commented 8 years ago

As the generated links are windows only, a cross-platform solution would be preferable. I found a suggestion here:

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>The Tudors</title>
    <meta http-equiv="refresh" content="0;URL='http://thetudors.example.com/'" />
  </head>
  <body>
    <p>This page has moved to a <a href="http://thetudors.example.com/">
      theTudors.example.com</a>.</p>
  </body>
</html>

Another benefit: no additional mime type necessary so this would solve Bug #3

otetard commented 8 years ago

Thanks for the tip, I’ll have a look at it.

Concerning the MIME Type, this file-format won’t help since it’s mainly used to “attach” the action of opening the pad/calc to a specific file: js/ownpad.js.

Olivier;

inos-github commented 8 years ago

Hi Olivier, I tried this by myself and have a solution that works for me: in ajax/newpad.php substitute line 105 $content = sprintf("[InternetShortcut]\nURL=%s", $url); with:

$content = sprintf('<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>ownPad</title>
    <meta http-equiv="refresh" content="0;URL=\'%s\'" />
  </head>
  <body>
    <p>call to <a href="%s">
      %s</a>.</p>
  </body>
</html>', $url, $url, $padname);

and in controller/displaycontroller.php change line 73 preg_match('/URL=(.*)$/', $content, $matches); to preg_match("/URL='(.*)'/", $content, $matches);

The files/links should work on all platforms (on mobile with "send to")

Martin