SitePath.php
public function isWithinPath($path) {
		$path = SiteUrl::normalizePath($path);

		$current_path = $this->getPath() . '/';
		$path = trim($path, '/') . '/';

		if ($path === '/') {
			return true;
		}

		return (0 === strpos($current_path, $path));
	}
public function isWithinPath($path) {
		$path = SiteUrl::normalizePath($path);

		$current_path = $this->getPath() . '/';
		$path = trim($path, '/') . '/';

		if ($path === '/') {
			return true;
		}

		return (0 === strpos($current_path, $path));
	}
Is this path within the given path?

E.g. if the current path is "blog/view/123", this would return true for "blog",
but false for "bl" or "blog/vi".

@param string $path Path to compare. E.g. "blog/view"

@return bool