Exemple #1
0
 public function actionTest()
 {
     $method = $this->_input->filterSingle('method', XenForo_Input::STRING);
     $url = $this->_input->filterSingle('url', XenForo_Input::STRING);
     if (empty($url) || empty($method)) {
         return $this->responseError('Both Method and URL needs to be supplied!');
     }
     XenForo_Application::autoload('Shorten_URL');
     $Details = array();
     $Details['name'] = $method;
     $Details['url'] = Shorten_URL::shorten($url, $method);
     if (!$Details['url']) {
         $Details['url'] = 'ERROR';
     }
     return $this->responseView('XenForo_ViewAdmin_Sutest_Method_Test', 'sutest_method_test', array('details' => $Details));
 }