|
dolibarr
13.0.2
|
This file contains functions dedicated to get URLs. More...
Go to the source code of this file.
Functions | |
| getURLContent ($url, $postorget= 'GET', $param= '', $followlocation=1, $addheaders=array(), $allowedschemes=array('http', 'https'), $localurl=0) | |
| Function to get a content from an URL (use proxy if proxy defined). More... | |
| getDomainFromURL ($url, $mode=0) | |
| Function get second level domain name. More... | |
| getRootURLFromURL ($url) | |
| Function root url from a long url For example: https://www.abc.mydomain.com/dir/page.html return 'https://www.abc.mydomain.com' For example: http://www.abc.mydomain.com/ return 'https://www.abc.mydomain.com'. More... | |
| removeHtmlComment ($content) | |
| Function to remove comments into HTML content. More... | |
This file contains functions dedicated to get URLs.
Definition in file geturl.lib.php.
| getDomainFromURL | ( | $url, | |
$mode = 0 |
|||
| ) |
Function get second level domain name.
For example: https://www.abc.mydomain.com/dir/page.html return 'mydomain'
| string | $url | Full URL. |
| int | $mode | 0=return 'mydomain', 1=return 'mydomain.com', 2=return 'abc.mydomain.com' |
Definition at line 237 of file geturl.lib.php.
| getRootURLFromURL | ( | $url | ) |
Function root url from a long url For example: https://www.abc.mydomain.com/dir/page.html return 'https://www.abc.mydomain.com' For example: http://www.abc.mydomain.com/ return 'https://www.abc.mydomain.com'.
| string | $url | Full URL. |
Definition at line 261 of file geturl.lib.php.
Referenced by getAllImages().
| getURLContent | ( | $url, | |
$postorget = 'GET', |
|||
$param = '', |
|||
$followlocation = 1, |
|||
$addheaders = array(), |
|||
$allowedschemes = array('http', 'https'), |
|||
$localurl = 0 |
|||
| ) |
Function to get a content from an URL (use proxy if proxy defined).
Support Dolibarr setup for timeout and proxy. Enhancement of CURL to add an anti SSRF protection.
| string | $url | URL to call. |
| string | $postorget | 'POST', 'GET', 'HEAD', 'PUT', 'PUTALREADYFORMATED', 'POSTALREADYFORMATED', 'DELETE' |
| string | $param | Parameters of URL (x=value1&y=value2) or may be a formated content with $postorget='PUTALREADYFORMATED' |
| integer | $followlocation | 0=Do not follow, 1=Follow location. |
| string[] | $addheaders Array of string to add into header. Example: ('Accept: application/xrds+xml', ....) | |
| string[] | $allowedschemes List of schemes that are allowed ('http' + 'https' only by default) | |
| int | $localurl | 0=Only external URL are possible, 1=Only local URL, 2=Both external and local URL are allowed. |
Definition at line 38 of file geturl.lib.php.
References dol_syslog().
Referenced by getAllImages(), Setup\getCheckIntegrity(), SimpleOpenID\GetOpenIDServer(), PriceGlobalVariableUpdater\process(), and MultiCurrency\syncRates().
| removeHtmlComment | ( | $content | ) |
Function to remove comments into HTML content.
| string | $content | Text content |
Definition at line 279 of file geturl.lib.php.