src/controllers/MediaHolderController.php
private function resolveURL() {

		// Retrieve the current request URL segments.

		$request = $this->getRequest();
		$URL = $request->getURL();
		$holder = substr($URL, 0, strpos($URL, '/'));
		$page = substr($URL, strrpos($URL, '/') + 1);

		// Determine whether a media page child once existed.

		$resolution = self::find_old_page(array(
			$holder,
			$page
		));
		$comparison = trim($resolution, '/');

		// Make sure the current request URL doesn't match the resolution.

		if($resolution && ($page !== substr($comparison, strrpos($comparison, '/') + 1))) {

			// Retrieve the current request parameters.

			$parameters = $request->getVars();
			unset($parameters['url']);

			// Appropriately redirect towards the updated media page URL.

			$response = new HTTPResponse();
			return $response->redirect(self::join_links($resolution, !empty($parameters) ? '?' . http_build_query($parameters) : null), 301);
		}
		else {

			// The media page child doesn't resolve.

			return null;
		}
	}
private function resolveURL() {

		// Retrieve the current request URL segments.

		$request = $this->getRequest();
		$URL = $request->getURL();
		$holder = substr($URL, 0, strpos($URL, '/'));
		$page = substr($URL, strrpos($URL, '/') + 1);

		// Determine whether a media page child once existed.

		$resolution = self::find_old_page(array(
			$holder,
			$page
		));
		$comparison = trim($resolution, '/');

		// Make sure the current request URL doesn't match the resolution.

		if($resolution && ($page !== substr($comparison, strrpos($comparison, '/') + 1))) {

			// Retrieve the current request parameters.

			$parameters = $request->getVars();
			unset($parameters['url']);

			// Appropriately redirect towards the updated media page URL.

			$response = new HTTPResponse();
			return $response->redirect(self::join_links($resolution, !empty($parameters) ? '?' . http_build_query($parameters) : null), 301);
		}
		else {

			// The media page child doesn't resolve.

			return null;
		}
	}
private function resolveURL ( ) { // Retrieve the current request URL segments. $ request = $ this -> getRequest ( ) ; $ URL = $ request -> getURL ( ) ; $ holder = substr ( $ URL , 0 , strpos ( $ URL , '/' ) ) ; $ page = substr ( $ URL , strrpos ( $ URL , '/' ) + 1 ) ; // Determine whether a media page child once existed. $ resolution = self :: find_old_page ( array ( $ holder , $ page ) ) ; $ comparison = trim ( $ resolution , '/' ) ; // Make sure the current request URL doesn't match the resolution. if ( $ resolution && ( $ page !== substr ( $ comparison , strrpos ( $ comparison , '/' ) + 1 ) ) ) { // Retrieve the current request parameters. $ parameters = $ request -> getVars ( ) ; unset ( $ parameters [ 'url' ] ) ; // Appropriately redirect towards the updated media page URL. $ response = new HTTPResponse ( ) ; return $ response -> redirect ( self :: join_links ( $ resolution , ! empty ( $ parameters ) ? '?' . http_build_query ( $ parameters ) : null ) , 301 ) ; } else { // The media page child doesn't resolve. return null ; } }
Determine whether a media page child once existed for the current request, and redirect appropriately.

@return http response
Determine whether a media page child once existed for the current request and redirect appropriately .