fix: links

This commit is contained in:
quenousimporte 2024-02-19 10:42:49 +01:00
parent 9d7d804865
commit 2ce4cbeef6
1 changed files with 3 additions and 4 deletions

View File

@ -111,8 +111,7 @@
</form>';
$links = array();
if (preg_match_all('/\[\[(.*)\]\]/', $content, $links, PREG_SET_ORDER)
|| preg_match_all('/http(.*)[ \r]/', $content, $links, PREG_SET_ORDER))
if (preg_match_all('/\[\[(.*)\]\]/', $content, $links, PREG_SET_ORDER))
{
echo '<div>Internal links:</div>';
foreach($links as $link)
@ -124,13 +123,13 @@
echo '<br>';
}
$links = array();
if (preg_match_all('/http(.*)[ \r]/', $content, $links, PREG_SET_ORDER))
if (preg_match_all('/https:(.*)[ \r]/', $content, $links, PREG_SET_ORDER))
{
echo '<div>External links:</div>';
foreach($links as $link)
{
echo '<div>
<a target="_blank" href="http' . $link[1] . '">http' . $link[1] . '</a>
<a target="_blank" href="https:' . $link[1] . '">https:' . $link[1] . '</a>
</div>';
}
echo '<br>';