slitaz-forge rev 588
mirror/dir-generator.php: parse README links
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Dec 13 18:50:05 2014 +0100 (2014-12-13) |
parents | acc6a00e40ab |
children | c1ac675db867 |
files | mirror/root/dir-generator.php |
line diff
1.1 --- a/mirror/root/dir-generator.php Fri Dec 12 18:55:00 2014 +0100 1.2 +++ b/mirror/root/dir-generator.php Sat Dec 13 18:50:05 2014 +0100 1.3 @@ -485,7 +485,8 @@ 1.4 ".count($folderlist)." folders and ".count($filelist)." files.</div>"; 1.5 if (filesize($path."/README")) { 1.6 echo "<pre>\n"; 1.7 - echo file_get_contents($path."/README"); 1.8 + echo preg_replace('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', 1.9 + '<a href="$1">$1</a>', file_get_contents($path."/README")); 1.10 echo "</pre>\n"; 1.11 } 1.12