Function __global->_cms_rawurlrecode

Definitions

sources/urls_simplifier.php

  • Remove unnecessarily paranoid URL-encoding if needed, so the given URL will fit in the database.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$url URLPATH No No required parameter N/A N/A The URL
$tolerate_errors boolean No No required parameter N/A N/A If this is set to false then an error message will be shown if the URL is still too long after we do what we can; set to true if we have someway of further shortening the URL after this function is called

Returns

  • The shortened URL
  • Type: URLPATH
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Remove unnecessarily paranoid URL-encoding if needed, so the given URL will fit in the database.
 *
 * @param  URLPATH $url The URL
 * @param  boolean $tolerate_errors If this is set to false then an error message will be shown if the URL is still too long after we do what we can; set to true if we have someway of further shortening the URL after this function is called
 * @return URLPATH The shortened URL
 */

function _cms_rawurlrecode(string $url, bool $tolerate_errors) : string