Exemplo n.º 1
0
 /**
  * Update the settings for an existing redirection
  *
  */
 function UpdateRedir()
 {
     global $langmessage;
     if (!$this->CheckRedir()) {
         return false;
     }
     $orig_source = $_POST['orig_source'];
     $source = admin_tools::PostedSlug($orig_source);
     if (!isset($this->error_data['redirects'][$orig_source])) {
         message($langmessage['OOPS'] . ' (Entry not found)');
         return false;
     }
     $data = array();
     $data['target'] = $_POST['target'];
     $data['code'] = $_POST['code'];
     $data['raw_source'] = $_POST['source'];
     if (!gpFiles::ArrayReplace($orig_source, $source, $data, $this->error_data['redirects'])) {
         message($langmessage['OOPS']);
         return false;
     }
     return $this->SaveData_Message();
 }