WordPress.org

Plugin Directory

Changeset 326515


Ignore:
Timestamp:
12/28/10 03:07:14 (3 years ago)
Author:
vhauri
Message:

Fixes an issue with improperly escaped slashes and a sorting issue that could cause a duplicate tagline when an existing one is changed

Location:
tagline-rotator/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tagline-rotator/trunk/readme.txt

    r326255 r326515  
    6161Version 1.4 - 7-5-2010 - Fixed me shutting my brain off on version 1.3. Displays tagline in header, but does not duplicate taglines. 
    6262Version 2.0 - 12-26-2010 - Changed plugin to class-based structure and cleaned up a lot of the logic. Removed all MySQL queries and switched to using options for storing taglines. Added an upgrade function to pull old taglines from table-based versions of the plugin that is called on activation. 
     63Version 2.1 - 12-27-2010 - Fixes an issue with slashes not being properly escaped, and an issue with sorting that could cause a duplicate tagline to appear when changing an existing tagline. If you have version 2.0, you should upgrade immediately. 
  • tagline-rotator/trunk/tagline-rotator.php

    r326255 r326515  
    55Plugin URI: http://neverblog.net/tagline-rotator-plugin-for-wordpress 
    66Description: Displays a random tagline from a database list. You can manage taglines through Settings->Tagline Rotator. 
    7 Version: 2.0  
     7Version: 2.1  
    88Author: Vasken Hauri 
    99Author URI: http://neverblog.net 
     
    1111 
    1212/*   
    13 Copyright 2008  Vasken Hauri  (email : vhauri (at) gmail dot com) 
     13Copyright 2008-2011  Vasken Hauri  (email : vhauri (at) gmail dot com) 
    1414 
    1515    This program is free software; you can redistribute it and/or modify 
     
    6060        public static function tagline_options_page() { 
    6161            $taglines = get_option('tagline_rotator_taglines'); 
     62            if(isset($_POST['text'])){ 
     63                $text = $_POST['text']; 
     64                foreach ($text as $key => $tagline){ 
     65                    if($tagline !== '') 
     66                        $taglines[$key] = $tagline; 
     67                    } 
     68                } 
    6269             
    6370            //loop through the checkboxes to see what to delete 
     
    6875                }    
    6976            }   
    70  
    71             if(isset($_POST['text'])){ 
    72                 $text = $_POST['text']; 
    73                 foreach ($text as $key => $tagline){ 
    74                     if($tagline !== '') 
    75                         $taglines[$key] = $tagline; 
    76                     } 
    77                 } 
    7877             
    7978            // check for new tagline and insert if found 
     
    115114            <th scope="row">Delete this tagline</th> 
    116115            <?php $sanitized_tagline = preg_replace('/"/','&quot;',$tagline); ?> 
    117             <td><input type="checkbox" name="box[]" value="<?php echo $key;?>" /><input type="text" size="80" name="text[]" value="<?php echo $sanitized_tagline;?>" /><input type="hidden" name="vhtr_ids[]" value="<?php echo $key;?>" /></td></tr> 
     116            <td><input type="checkbox" name="box[<?php echo $key; ?>]" value="<?php echo $key;?>" /><input type="text" size="80" name="text[<?php echo $key; ?>]" value="<?php echo stripslashes($sanitized_tagline);?>" /><input type="hidden" name="vhtr_ids[]" value="<?php echo $key;?>" /></td></tr> 
    118117 
    119118            <?php 
Note: See TracChangeset for help on using the changeset viewer.