Project

General

Profile

Actions

Feature #20206

closed

Provide a check that compare a given URL with the host, TYPO3 is running on!

Added by Marcus Krause over 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2009-03-18
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

Description

I'd like to allow BE editors to reference resources (URL) but only if they are on the same host TYPO3 is running on.

Unfortunately there's no nice API to make such a check.

(issue imported from #M10724)


Files

10724.diff (5.17 KB) 10724.diff Administrator Admin, 2009-03-18 18:15
10724_v1.diff (4.63 KB) 10724_v1.diff Administrator Admin, 2009-03-18 20:51
10724_v2.diff (3.05 KB) 10724_v2.diff Administrator Admin, 2009-03-18 21:42
10724_v3.diff (4.73 KB) 10724_v3.diff Administrator Admin, 2009-04-02 22:17
10724_v4.diff (4.19 KB) 10724_v4.diff Administrator Admin, 2009-04-06 12:51
0010724_v5.patch (1.25 KB) 0010724_v5.patch Administrator Admin, 2009-09-01 18:49
0010724_v5_test.patch (3.08 KB) 0010724_v5_test.patch Administrator Admin, 2009-09-01 18:49
Actions #1

Updated by Marcus Krause over 15 years ago

The attached patch provides additional functions:

t3lib_div::isURL($url)
checks if a given string is a URL

t3lib_befunc::isAllowedSite($url)
checks if a given URL matches the host TYPO3 is running on

Actions #2

Updated by Marcus Krause over 15 years ago

v1 uses string comparison for URL matching instead of parsing and rebuilding an URL.
Besides that, URL validation is done with filter_var().

Actions #3

Updated by Oliver Hader about 15 years ago

Committed to SVN Trunk (rev. 5867 & 5868)

Actions

Also available in: Atom PDF