Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Yet more minor problems fixed for hyperlink/mailto: conversion

difficulties
  • Loading branch information...
commit 464712ec77f602a949230e19d3f2f76239b63716 1 parent 08b6314
thepurpleblob authored

Showing 1 changed file with 10 additions and 1 deletion. Show diff stats Hide diff stats

  1. +10 1 lib/wiki.php
11 lib/wiki.php
@@ -245,7 +245,7 @@ function line_replace( $line ) {
245 245 "\\1<A HREF=\"http://www.\\2\\3\" TARGET=\"newpage\">www.\\2\\3</A>", $line);
246 246
247 247 // make email addresses into mailtos....
248   - $line = eregi_replace("([[:space:]]|^)([a-zA-Z0-9@.]+)\(([^)]+)\)",
  248 + $line = eregi_replace("([[:space:]]|^)([[:alnum:]._-]+@[[:alnum:]._-]+)\(([^)]+)\)",
249 249 "\\1<a href=\"mailto:\\2\">\\3</a>", $line);
250 250
251 251 // !# at the beginning of any lines means a heading
@@ -271,6 +271,15 @@ function line_replace( $line ) {
271 271 "<img src=\"$CFG->wwwroot/file.php\?file=$course->id/\\1\\2\" alt=\"\\3\" />", $line );
272 272 }
273 273
  274 + // Replace everything else resource link
  275 + if ($CFG->slasharguments) {
  276 + $line = eregi_replace( "file:/([[:alnum:]/._-]+)\(([^)]+)\)",
  277 + "<a href=\"$CFG->wwwroot/file.php/$course->id/\\1\" >\\2</a>", $line );
  278 + } else {
  279 + $line = eregi_replace( "file:/([[:alnum:]/._-]+)\(([^)]+)\)",
  280 + "<a href=\"$CFG->wwwroot/file.php\?file=$course->id/\\1\" >\\2</a>", $line );
  281 + }
  282 +
274 283 replace_smilies( $line );
275 284
276 285 }

0 comments on commit 464712e

Please sign in to comment.
Something went wrong with that request. Please try again.