Skip to content

Commit

Permalink
API Remove deprecated code (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabina-talipova authored Jan 25, 2023
1 parent 380ab31 commit c2ceb88
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/Controllers/ShareDraftController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use BadMethodCallException;
use PageController;
use SilverStripe\Core\Environment;
use SilverStripe\Dev\Deprecation;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
Expand Down Expand Up @@ -130,33 +129,6 @@ public function preview(HTTPRequest $request)
}
}

/**
* @param string $url
*
* @deprecated 3.0.0 Use getRenderedPageByURL() instead
*
* @return HTTPResponse
*/
protected function getRenderedPageByURLSegment($url)
{
Deprecation::notice('3.0.0', 'Use getRenderedPageByURL() instead');

$pageRequest = HTTPRequestBuilder::createFromEnvironment();
$pageRequest->setHttpMethod('GET');
$pageRequest->setUrl($url);

$response = Director::singleton()->handleRequest($pageRequest);

if ($response->isRedirect()) {
// The redirect will probably be Absolute URL so just want the path
$newUrl = parse_url($response->getHeader('location') ?? '', PHP_URL_PATH);

return $this->getRenderedPageByURLSegment($newUrl);
}

return $response;
}

/**
* @param string $url
*
Expand Down

0 comments on commit c2ceb88

Please sign in to comment.