Skip to content

Commit

Permalink
Escape strings and make them translatable.
Browse files Browse the repository at this point in the history
  • Loading branch information
tollmanz committed Mar 29, 2013
1 parent 634c9ed commit aa89ae0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion classes/struts/option/image.php
Expand Up @@ -8,7 +8,7 @@ public function input_html() {
$value = esc_attr( $this->value() );

echo "<input type='text' id='$id' name='$name' value='$value' class='image-input' />";
echo "<input type='button' id='{$id}_button' value='Upload Image' data-type='image' data-field-id='$id' class='button struts-image-upload'>";
echo "<input type='button' id='{$id}_button' value='" . esc_attr( __( 'Upload Image', 'struts' ) ) . "' data-type='image' data-field-id='$id' class='button struts-image-upload'>";
}

protected function standard_validation( $value ) {
Expand Down
5 changes: 3 additions & 2 deletions classes/struts/options.php
Expand Up @@ -315,10 +315,11 @@ public function echo_form_html() { ?>
<?php
settings_fields( $this->name() );
$this->do_options_html();
$confirm_text = 'Click OK if you want to reset your theme options to the defaults.';
?>
<div class="struts-buttons-container">
<input name="<?php echo $this->name(); ?>[struts_submit]" type="submit" class="button-primary struts-save-button" value="<?php esc_attr_e( 'Save Settings', 'struts' ); ?>" />
<input name="<?php echo $this->name(); ?>[struts_reset]" type="submit" class="button-secondary struts-reset-button" value="<?php esc_attr_e( 'Reset Defaults', 'struts' ); ?>" onclick="return confirm('Click OK if you want to reset your theme options to the defaults.')" />
<input name="<?php echo esc_attr( $this->name() ); ?>[struts_submit]" type="submit" class="button-primary struts-save-button" value="<?php esc_attr_e( 'Save Settings', 'struts' ); ?>" />
<input name="<?php echo esc_attr( $this->name() ); ?>[struts_reset]" type="submit" class="button-secondary struts-reset-button" value="<?php esc_attr_e( 'Reset Defaults', 'struts' ); ?>" onclick="return confirm('<?php esc_attr_e( $confirm_text, 'struts' ); ?>')" />
</div>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion classes/struts/section.php
Expand Up @@ -101,7 +101,7 @@ public function to_html() {
}

echo '<div class="struts-save-button submit">';
echo '<input type="submit" class="button-primary struts-save-button" value="' . __( 'Save changes', 'struts' ) . '" />';
echo '<input type="submit" class="button-primary struts-save-button" value="' . esc_attr( __( 'Save changes', 'struts' ) ) . '" />';

do_action( 'struts_after_' . $this->id() . '_submit' );

Expand Down

0 comments on commit aa89ae0

Please sign in to comment.