Beispiel #1
0
 /**
  * Set current action name
  * Example: action_name OR 'action name' OR Action_Name OR 'Action Name' -> converted to ation-name
  * Always sanitized
  * @param string $action
  * @return eRequest
  */
 public function setAction($action)
 {
     $this->_action = strtolower(eHelper::dasherize($this->sanitize($action)));
     return $this;
 }
Beispiel #2
0
 function processUploadUrl($import = false, $cat = '_common')
 {
     $fl = e107::getFile();
     $mes = e107::getMessage();
     if (vartrue($_POST['upload_remote_url'])) {
         $fileName = basename($_POST['upload_url']);
         if (strpos($fileName, '?') !== false) {
             list($fileName, $bla) = explode("?", $fileName);
         }
         // remove script extensions.
         if (substr($fileName, -4) == ".php" || substr($fileName, -4) == ".htm" || substr($fileName, -5) == ".html" || substr($fileName, -4) == ".asp") {
             $fileName = empty($_POST['upload_caption']) ? str_replace(array(".php", ".html", ".asp", ".htm"), '', $fileName) . "_" . time() : eHelper::dasherize(strtolower($_POST['upload_caption']));
         }
         if (!$fl->getRemoteFile($_POST['upload_url'], $fileName, 'import')) {
             $mes->addError("There was a problem grabbing the file");
         } elseif ($import == true) {
             $data = array('media_caption' => e107::getParser()->filter($_POST['upload_caption'], 'str'));
             $result = e107::getMedia()->importFile($fileName, $cat, null, $data);
         }
     }
 }