Commit 17553b18 authored by Bate's avatar Bate

Syntaxe doku https

parent b10800ae
...@@ -118,7 +118,7 @@ class dokusyntax ...@@ -118,7 +118,7 @@ class dokusyntax
$this->firstpass($table,$text,"#(\b)($urls:[$any]+?)([$punc]*[^$any])#ie","\$this->linkformat('\\2')",'\1','\4'); $this->firstpass($table,$text,"#(\b)($urls:[$any]+?)([$punc]*[^$any])#ie","\$this->linkformat('\\2')",'\1','\4');
// url www version courte // url www version courte
$this->firstpass($table,$text,"#(\b)(www\.[$host]+?\.[$host]+?[$any]+?)([$punc]*[^$any])#ie","\$this->linkformat('http://\\2')",'\1','\3'); $this->firstpass($table,$text,"#(\b)(www\.[$host]+?\.[$host]+?[$any]+?)([$punc]*[^$any])#ie","\$this->linkformat('https://\\2')",'\1','\3');
// windows shares // windows shares
$this->firstpass($table,$text,"#([$gunk$punc\s])(\\\\\\\\[$host]+?\\\\[$any]+?)([$punc]*[^$any])#ie","\$this->linkformat('\\2')",'\1','\3'); $this->firstpass($table,$text,"#([$gunk$punc\s])(\\\\\\\\[$host]+?\\\\[$any]+?)([$punc]*[^$any])#ie","\$this->linkformat('\\2')",'\1','\3');
...@@ -472,24 +472,24 @@ class dokusyntax ...@@ -472,24 +472,24 @@ class dokusyntax
return $file->get_html_link(); return $file->get_html_link();
} }
if ( !isset($match[2]) || $match[2] == "/download" ) if ( !isset($match[2]) || $match[2] == "/download" )
$link = "http://ae.utbm.fr/d.php?action=download&id_file=".$match[1]; $link = "https://ae.utbm.fr/d.php?action=download&id_file=".$match[1];
elseif ( $match[2] == "/preview" ) elseif ( $match[2] == "/preview" )
$link = "http://ae.utbm.fr/d.php?action=download&download=preview&id_file=".$match[1]; $link = "https://ae.utbm.fr/d.php?action=download&download=preview&id_file=".$match[1];
elseif ( $match[2] == "/thumb" ) elseif ( $match[2] == "/thumb" )
$link = "http://ae.utbm.fr/d.php?action=download&download=thumb&id_file=".$match[1]; $link = "https://ae.utbm.fr/d.php?action=download&download=thumb&id_file=".$match[1];
elseif ( $match[2] == "/info" ) elseif ( $match[2] == "/info" )
$link = "http://ae.utbm.fr/d.php?id_file=".$match[1]; $link = "https://ae.utbm.fr/d.php?id_file=".$match[1];
} }
else else
{ {
//les article:// //les article://
$link = preg_replace("/article:\/\//i",'http://ae.utbm.fr/'.$GLOBALS["entitiescatalog"]["page"][3]."?name=",$link); $link = preg_replace("/article:\/\//i",'https://ae.utbm.fr/'.$GLOBALS["entitiescatalog"]["page"][3]."?name=",$link);
//les wiki:// //les wiki://
$link = preg_replace("/wiki:\/\//i",'http://ae.utbm.fr/'.$GLOBALS["entitiescatalog"]["wiki"][3]."?name=",$link); $link = preg_replace("/wiki:\/\//i",'https://ae.utbm.fr/'.$GLOBALS["entitiescatalog"]["wiki"][3]."?name=",$link);
if( defined('CMS_ID_ASSO') ) if( defined('CMS_ID_ASSO') )
$link = preg_replace("/sas:\/\//i","images.php?/",$link); $link = preg_replace("/sas:\/\//i","images.php?/",$link);
else else
$link = preg_replace("/sas:\/\//i","http://ae.utbm.fr/sas2/images.php?/",$link); $link = preg_replace("/sas:\/\//i","https://ae.utbm.fr/sas2/images.php?/",$link);
} }
} }
elseif ( !strpos($link,'mailto:') && !preg_match("#(\.|/)#",$link) ) elseif ( !strpos($link,'mailto:') && !preg_match("#(\.|/)#",$link) )
...@@ -1039,13 +1039,13 @@ class dokusyntax ...@@ -1039,13 +1039,13 @@ class dokusyntax
list($width,$height) = split('x',$sizes,2); list($width,$height) = split('x',$sizes,2);
$name=trim($name); $name=trim($name);
//les dfiles:// //les dfiles://
$img = preg_replace("/dfile:\/\/([0-9]*)\/preview/i","http://ae.utbm.fr/d.php?action=download&download=preview&id_file=$1",$img); $img = preg_replace("/dfile:\/\/([0-9]*)\/preview/i","https://ae.utbm.fr/d.php?action=download&download=preview&id_file=$1",$img);
$img = preg_replace("/dfile:\/\/([0-9]*)\/thumb/i","http://ae.utbm.fr/d.php?action=download&download=thumb&id_file=$1",$img); $img = preg_replace("/dfile:\/\/([0-9]*)\/thumb/i","https://ae.utbm.fr/d.php?action=download&download=thumb&id_file=$1",$img);
$img = preg_replace("/dfile:\/\//i","http://ae.utbm.fr/d.php?action=download&id_file=",$img); $img = preg_replace("/dfile:\/\//i","https://ae.utbm.fr/d.php?action=download&id_file=",$img);
if( defined('CMS_ID_ASSO') ) if( defined('CMS_ID_ASSO') )
$img = preg_replace("/sas:\/\//i","images.php?/",$img); $img = preg_replace("/sas:\/\//i","images.php?/",$img);
else else
$img = preg_replace("/sas:\/\//i","http://ae.utbm.fr/sas2/images.php?/",$img); $img = preg_replace("/sas:\/\//i","https://ae.utbm.fr/sas2/images.php?/",$img);
if ( preg_match("/\.flv$/i",$img) ) if ( preg_match("/\.flv$/i",$img) )
{ {
...@@ -1092,7 +1092,7 @@ class dokusyntax ...@@ -1092,7 +1092,7 @@ class dokusyntax
$sizes=trim($sizes); $sizes=trim($sizes);
$params=trim($params); $params=trim($params);
$url=trim($url); $url=trim($url);
if(!preg_match("/^(http:\/\/)?([^\/]+)/i",$url)) if(!preg_match("/^(https?:\/\/)?([^\/]+)/i",$url))
return ''; return '';
$sizes=trim($sizes); $sizes=trim($sizes);
$x=0; $x=0;
...@@ -1168,12 +1168,12 @@ class dokusyntax ...@@ -1168,12 +1168,12 @@ class dokusyntax
function get_oembed_url($url) function get_oembed_url($url)
{ {
// Pour les plus courants on retourne direct l'url // Pour les plus courants on retourne direct l'url
if(preg_match('/http\:\/\/.*\.youtube\.[^.]*\//',$url)) if(preg_match('/https?\:\/\/.*\.youtube\.[^.]*\//',$url))
return "http://www.youtube.com/oembed?format=xml&url=".$url; return "https://www.youtube.com/oembed?format=xml&url=".$url;
elseif(preg_match('/http\:\/\/.*\.dailymotion.[^.]*\//',$url)) elseif(preg_match('/https?\:\/\/.*\.dailymotion.[^.]*\//',$url))
return "http://www.dailymotion.com/services/oembed?format=xml&url=".$url; return "https://www.dailymotion.com/services/oembed?format=xml&url=".$url;
elseif(preg_match('/http\:\/\/.*\.vimeo.[^.]*\//',$url)) elseif(preg_match('/https?\:\/\/.*\.vimeo.[^.]*\//',$url))
return "http://vimeo.com/api/oembed.xml?url=".$url; return "https://vimeo.com/api/oembed.xml?url=".$url;
// Mais ta gueule ! // Mais ta gueule !
libxml_use_internal_errors(true); libxml_use_internal_errors(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment