1.20.x common.inc backdrop_encode_path($path)

Encodes a Backdrop path for use in a URL.

For aesthetic reasons slashes are not escaped.

Note that url() takes care of calling this function, so a path passed to that function should not be encoded in advance.

Parameters

string $path: The Backdrop path to encode.

Return value

string: The encoded path.

Related topics

File

includes/common.inc, line 772
Common functions that many Backdrop modules will need to reference.

Code

function backdrop_encode_path($path) {
  return str_replace('%2F', '/', rawurlencode($path));
}