escapeString() public méthode

See also: Gdn_Form::escapeFieldName()
Deprecation:
public escapeString ( string $string ) : string
$string string
Résultat string
 /**
  * Manage options for a mobile theme.
  *
  * @since 2.0.0
  * @access public
  * @param string $Style Unique ID.
  * @todo Why is this in a giant try/catch block?
  */
 public function mobileThemeOptions($Style = null)
 {
     $this->permission('Garden.Settings.Manage');
     try {
         $this->addJsFile('addons.js');
         $this->addSideMenu('dashboard/settings/mobilethemeoptions');
         $ThemeManager = Gdn::themeManager();
         $EnabledThemeName = $ThemeManager->mobileTheme();
         $EnabledThemeInfo = $ThemeManager->getThemeInfo($EnabledThemeName);
         $this->setData('ThemeInfo', $EnabledThemeInfo);
         if ($this->Form->authenticatedPostBack()) {
             // Save the styles to the config.
             $StyleKey = $this->Form->getFormValue('StyleKey');
             $ConfigSaveData = array('Garden.MobileThemeOptions.Styles.Key' => $StyleKey, 'Garden.MobileThemeOptions.Styles.Value' => $this->data("ThemeInfo.Options.Styles.{$StyleKey}.Basename"));
             // Save the text to the locale.
             $Translations = array();
             foreach ($this->data('ThemeInfo.Options.Text', array()) as $Key => $Default) {
                 $Value = $this->Form->getFormValue($this->Form->escapeString('Text_' . $Key));
                 $ConfigSaveData["ThemeOption.{$Key}"] = $Value;
                 //$this->Form->setFormValue('Text_'.$Key, $Value);
             }
             saveToConfig($ConfigSaveData);
             $this->informMessage(t("Your changes have been saved."));
         } elseif ($Style) {
             saveToConfig(array('Garden.MobileThemeOptions.Styles.Key' => $Style, 'Garden.MobileThemeOptions.Styles.Value' => $this->data("ThemeInfo.Options.Styles.{$Style}.Basename")));
         }
         $this->setData('ThemeOptions', c('Garden.MobileThemeOptions'));
         $StyleKey = $this->data('ThemeOptions.Styles.Key');
         if (!$this->Form->authenticatedPostBack()) {
             foreach ($this->data('ThemeInfo.Options.Text', array()) as $Key => $Options) {
                 $Default = val('Default', $Options, '');
                 $Value = c("ThemeOption.{$Key}", '#DEFAULT#');
                 if ($Value === '#DEFAULT#') {
                     $Value = $Default;
                 }
                 $this->Form->setFormValue($this->Form->escapeString('Text_' . $Key), $Value);
             }
         }
         $this->setData('ThemeFolder', $EnabledThemeName);
         $this->title(t('Mobile Theme Options'));
         $this->Form->addHidden('StyleKey', $StyleKey);
     } catch (Exception $Ex) {
         $this->Form->addError($Ex);
     }
     $this->render('themeoptions');
 }