<commit_before><?php

require_once 'CRM/Core/Page.php';

class CRM_Speakcivi_Page_Optout extends CRM_Speakcivi_Page_Post {
  function run() {
    $this->setValues();

    $params_contact = array(
      'sequential' => 1,
      'id' => $this->contact_id,
      'is_opt_out' => 1,
    );
    $result = civicrm_api3('Contact', 'create', $params_contact);

    $group_id = CRM_Core_BAO_Setting::getItem('Speakcivi API Preferences', 'group_id');
    $this->setGroupStatus($this->contact_id, $group_id);

    $this->setActivityStatus($this->activity_id, 'optout');

    $country = $this->getCountry($this->campaign_id);
//    $url = "{$country}/post_optout"; // temporary fixed unless I resolve redirect to language versions to this page
    $url = "/post_optout";
    CRM_Utils_System::redirect($url);
  }
}
<commit_msg>Restore language version for post_optout<commit_after><?php

require_once 'CRM/Core/Page.php';

class CRM_Speakcivi_Page_Optout extends CRM_Speakcivi_Page_Post {
  function run() {
    $this->setValues();

    $params_contact = array(
      'sequential' => 1,
      'id' => $this->contact_id,
      'is_opt_out' => 1,
    );
    $result = civicrm_api3('Contact', 'create', $params_contact);

    $group_id = CRM_Core_BAO_Setting::getItem('Speakcivi API Preferences', 'group_id');
    $this->setGroupStatus($this->contact_id, $group_id);

    $this->setActivityStatus($this->activity_id, 'optout');

    $country = $this->getCountry($this->campaign_id);
    $url = "{$country}/post_optout";
    CRM_Utils_System::redirect($url);
  }
}

{'fraction_non_alphanumeric': 0.16010329244673982, 'fraction_numerical': 0.003873466752743706, 'mean_word_length': 4.381944444444445, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7031787', 'n_tokens_mistral': 558, 'n_tokens_neox': 539, 'n_words': 90}