Requests_IRI::set_scheme() WordPress Method
The Requests_IRI::set_scheme() function can be used to set or change the scheme part of an IRI. The new scheme will be validated according to the RFC 3986 specification. If the new scheme is not valid, a Requests_Exception will be thrown.
Requests_IRI::set_scheme( string $scheme ) #
Set the scheme. Returns true on success, false on failure (if there are any invalid characters).
Parameters
- $scheme
(string)(Required)
Return
(bool)
Source
File: wp-includes/Requests/IRI.php
protected function set_scheme($scheme) { if ($scheme === null) { $this->scheme = null; } elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme)) { $this->scheme = null; return false; } else { $this->scheme = strtolower($scheme); } return true; }
Expand full source codeCollapse full source codeView on TracView on GitHub