diff options
author | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2023-11-27 10:37:58 +0000 |
---|---|---|
committer | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2023-11-27 10:37:58 +0000 |
commit | 6c87fbc4ffa694c9c0450f91c378b50ebacb42e0 (patch) | |
tree | 0f2d353bc0e1194914801d06f33b49b23c70a5ca /scripts | |
parent | a4922e4d48a4e952a9b5c52902a154f0cb0166a4 (diff) | |
download | pmwiki.svn-6c87fbc4ffa694c9c0450f91c378b50ebacb42e0.tar.bz2 |
UrlApprovals allow https: URLs if the http: URL for the same domain is approved.
git-svn-id: svn://pmwiki.org/pmwiki/trunk@4533 524c5546-5005-0410-9a3e-e25e191bd360
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/urlapprove.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/urlapprove.php b/scripts/urlapprove.php index 8cf3d337..848d7025 100644 --- a/scripts/urlapprove.php +++ b/scripts/urlapprove.php @@ -1,5 +1,5 @@ <?php if (!defined('PmWiki')) exit(); -/* Copyright 2004-2021 Patrick R. Michaud (pmichaud@pobox.com) +/* Copyright 2004-2023 Patrick R. Michaud (pmichaud@pobox.com) This file is part of PmWiki; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -64,6 +64,7 @@ function LinkHTTP($pagename,$imap,$path,$alt,$txt,$fmt=NULL) { $url = str_replace('$1',$p,$IMap[$imap]); if (!isset($UnapprovedLink)) $UnapprovedLink = array(); foreach((array)$WhiteUrlPatterns as $pat) { + $pat = preg_replace('!^http://!', 'https?://', $pat); if (preg_match("!^$pat(/|$)!i",$url)) return LinkIMap($pagename,$imap,$path,$alt,$txt,$fmt); } |