Plugin Directory

Changeset 652652


Ignore:
Timestamp:
01/14/2013 09:28:18 PM (13 years ago)
Author:
techotronic
Message:

BUGFIX: Copy and paste of Favicon URLs now working correctly

Location:
all-in-one-favicon/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • all-in-one-favicon/trunk/includes/aio-favicon-backend.php

    r627435 r652652  
    190190    check_admin_referer('aio-favicon-settings-form');
    191191
     192    // get new settings from POST
     193    $usersettings = $_POST[AIOFAVICON_SETTINGSNAME];
     194
     195    // if URL was copy / pasted into form, fields named "*-text", but must be saved without "-text" suffix.
     196    foreach ($usersettings as $settingsName => $settingsValue) {
     197      if(preg_match('/(.*)-text/i',$settingsName, $matches)) {
     198        if (count($matches) > 1) {
     199          $match = $matches[1];
     200          if(!empty($settingsValue)) {
     201            $usersettings[$match] = $settingsValue;
     202          }
     203        }
     204        //delete "*-text" from incoming array
     205        unset($usersettings[$settingsName]);
     206      }
     207    }
     208
    192209    // Create the settings array by merging the user's settings and the defaults
    193     $usersettings = $_POST[AIOFAVICON_SETTINGSNAME];
    194210    $defaultArray = $this->aioFaviconDefaultSettings;
    195211    $this->aioFaviconSettings = wp_parse_args($usersettings, wp_parse_args((array)get_option(AIOFAVICON_SETTINGSNAME), $defaultArray));
  • all-in-one-favicon/trunk/includes/settings-page.php

    r385582 r652652  
    1616    <br class="clear"/>
    1717
    18     <?php settings_fields(AIOFAVICON_SETTINGSNAME); ?>
    1918<?php
    2019    require_once 'settings-page/sp-left-column.php';
  • all-in-one-favicon/trunk/includes/settings-page/sp-left-column.php

    r627435 r652652  
    1313    <form id="aio-favicon-settings-update" name="aio-favicon-settings-update" enctype="multipart/form-data" method="post" action="admin-post.php">
    1414      <?php if (function_exists('wp_nonce_field') === true) wp_nonce_field('aio-favicon-settings-form'); ?>
     15      <input type='hidden' value="<?php echo AIOFAVICON_SETTINGSNAME ?>" name="option_page"/>
    1516
    1617    <div id="poststuff">
  • all-in-one-favicon/trunk/includes/settings-page/sp-plugin-favicon-settings.php

    r652650 r652652  
    2727                <td>
    2828                    <input id="<?php echo AIOFAVICON_SETTINGSNAME .'-'. $iconName ?>" type="file" name="<?php echo $iconName ?>" size="50" maxlength="100000" accept="image/*" value="<?php echo $this->aioFaviconSettings[$iconName] ?>" style="display:none;"/>
    29                     <input id="<?php echo AIOFAVICON_SETTINGSNAME .'-'. $iconName ?>-text" type="text" name="<?php echo $iconName ?>-text" size="60" maxlength="100000" value="<?php echo $this->aioFaviconSettings[$iconName] ?>"/>
     29                    <input id="<?php echo AIOFAVICON_SETTINGSNAME .'-'. $iconName ?>-text" type="text" name="<?php echo AIOFAVICON_SETTINGSNAME . '[' . $iconName ?>-text]" size="60" maxlength="100000" value="<?php echo $this->aioFaviconSettings[$iconName] ?>"/>
    3030                    <input id="<?php echo AIOFAVICON_SETTINGSNAME .'-'. $iconName ?>-button" type="button" name="<?php echo $iconName ?>-button" class="button-secondary" value="<?php _e('Upload') ?>" />
    3131                    <br />
  • all-in-one-favicon/trunk/readme.txt

    r627435 r652652  
    9595== Changelog ==
    9696= 4.2 (2012-02-01) =
     97* BUGFIX: Copy and paste of Favicon URLs now working correctly
    9798* NEW: Turkish translation by Selçuk Yahşi
    9899* CHANGE: Eddy Ernesto Ríos updated the Spanish translation
Note: See TracChangeset for help on using the changeset viewer.