Bleu supports a Pimcore-based PHP site. Pimcore is a rather sprawling enterprise system for PHP. Like many Model-View-Controller type frameworks, maps HTTP requests to actions on controllers. Bleu’s team has several “default” actions configured on their controllers. Let’s take a look at a few of them.

public function searchAction()
{
  
  
}

We open with a search feature that’s worse than Confluence’s. But at least there’s a plan to make it better, though I suspect that TODO will outlive me.

public function ajaxAction()
{
  if ( $this->_request->isXmlHttpRequest() )
  {
    echo 'ssss';
  }
  die('ddd');
}

This site looks at Ajax requests and hisses at them, then drops dead.

public function errorAction()
{
  header('HTTP/1.1 404 Not Found');
  $this->disableLayout();
  
}

For any error, we return a 404. That won’t make diagnosing problems hard in the future, it’s not like HTTP error codes exist for a reason or anything.

But what happens when we have an actual 404?

public function notFoundAction()
{
  $this->setLayout('error');
  
}

Oh, that’s good to know. It’s impossible.

Now, Bleu didn’t provide any of the mappings which show how these actions are actually connected to HTTP requests, but these are their “default” actions, so they are actually mapped to HTTP requests. Whether notFound is actually tied to 404 errors, I’m just guessing at- but it is used, so if it’s used for something different, that’s it’s own WTF.

[Advertisement] ProGet’s got you covered with security and access controls on your NuGet feeds. Learn more.

Remy Porter

Source link

You May Also Like

Nice Back – People Of Walmart

Will it still be called backless? The post Nice Back appeared first…

You Think You Had a Bad Day? (17 Photos)

Hendy Source link

Evergrande filed for bankruptcy it happened it isn't a conspiracy theory anymore.

Tags: latest news 4574 points, 742 comments. Source link

Reddit – Dive into anything

Go to funny r/funny r/funny Reddit’s largest humor depository Members Online •…