Plugin Directory

Changeset 533904


Ignore:
Timestamp:
04/20/2012 09:35:40 AM (13 years ago)
Author:
f1logic
Message:

version 1.0.2 release

Location:
newsletter-manager/trunk
Files:
4 added
30 edited

Legend:

Unmodified
Added
Removed
  • newsletter-manager/trunk/admin/about.php

    r530634 r533904  
    8787    <div style="clear: both;"></div>
    8888
    89     <style>
    90    
    91     .xyz_feedback{
    92     background: #CEEAF7; /* Old browsers */
    93 border: 1px solid #64cfe8;
    94 width: 98%;   
    95     padding-left: 10px;
    96     }
    97    
    98     .xyz_feedback ul{
    99     font-weight: bold;
    100     }
    101    
    102     </style>
    103 
    104 <div class="xyz_feedback">
    105     <h2>Feedback</h2>
    106 
    107    Your feedback and suggestions are our sources for betterment of this plugin. You can provide your feedback using any of the options below.
    108    <p></p>
    109    <ul style="float: left;">
    110    
    111    <li><a target="_blank" href="http://xyzscripts.com/donate/1">Donate a dollar</a></li>
    112    <li><a target="_blank" href="http://wordpress.org/extend/plugins/newsletter-manager/">Rate our plugin on wordpress</a></li>
    113    <li><a target="_blank" href="http://xyzscripts.com/support/">Send your suggestions</a></li>
    114    </ul>
    115    <ul style="float: left;padding-left: 30px">
    116 <li><a target="_blank" href="http://facebook.com/xyzscripts" class="xyz_fbook">Like us on facebook</a></li>
    117    <li><a target="_blank" href="http://twitter.com/xyzscripts" class="xyz_twitt">Follow us on twitter</a></li>
    118    <li><a target="_blank" href="https://plus.google.com/101215320403235276710/" class="xyz_gplus">+1 us on Google+</a></li>
    119      
    120    </ul>
    121     <p style="clear: both;"></p>
    122    
    123     </div>
    124    
    125 
    126 <h2>More</h2>
    127 
    128 <div>
    129 Did you like Newsletter Manager ? Want more features and options ? Learn more about <a target="_blank" href="http://xyzscripts.com/advertising/xyz-email-manager/details">XYZ Email Manager</a>, the standalone version of this plugin. Subscribe to our newsletter below and get <b><blink>10 USD off</blink></b> for XYZ Email Manager. 
    130 </div>
    131 
    132 <p></p>
    133 
    134 <div>
    135                    
    136 <script language="javascript">
    137 function check_email(emailString)
    138 {
    139     var mailPattern = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
    140     var matchArray = emailString.match(mailPattern);
    141     if (emailString.length == 0)
    142     return false;
    143        
    144     if (matchArray == null) {
    145     return false;
    146     }else{
    147     return true;
    148     }
    149 }
    150 
    151    
    152 function verify_lists(form)
    153 {
    154    
    155     var total=0;
    156     var checkBox=form['chk[]'];
    157    
    158     if(checkBox.length){
    159    
    160     for(var i=0;i<checkBox.length;i++){
    161     checkBox[i].checked?total++:null;
    162     }
    163     }else{
    164        
    165     checkBox.checked?total++:null;
    166        
    167     }
    168     if(total>0){
    169     return true;
    170     }else{
    171     return false;
    172     }
    173 
    174 }
    175    
    176 function verify_fields()
    177 {
    178 
    179     if(check_email(document.email_subscription.email.value) == false){
    180     alert("Please check whether the email is correct.");
    181     document.email_subscription.email.select();
    182     return false;
    183     }else if(verify_lists(document.email_subscription)==false){
    184     alert("Select atleast one list.");
    185     }
    186     else{
    187     document.email_subscription.submit();
    188     }
    189 
    190 }
    191 </script>
    192 
    193 <form action=http://xyzscripts.com/newsletter/index.php?page=list/subscribe method="post" name="email_subscription" id="email_subscription" >
    194 <input type="hidden" name="fieldNameIds" value="1,">
    195 <input type="hidden" name="redirActive" value="http://xyzscripts.com/subscription/pending/XYZEM">
    196 <input type="hidden" name="redirPending" value="http://xyzscripts.com/subscription/active/XYZEM">
    197 <input type="hidden" name="mode" value="1">
    198 <table border="0" style=" width: 100%; border: 1px solid #FFFFFF; color: black;">
    199 <tr>
    200 <td colspan="3">
    201 <span style="font-size:14px;"><b>Field marked <font style="color:#FF0000">*</font> are mandatory </b></span>
    202 </td>
    203 </tr>
    204    
    205 <tr><td colspan="3"> </td></tr>
    206    
    207 <tr>
    208 <td id="align" width="150p">Name</td>
    209 <td id="align" > : </td>
    210 <td id="align">
    211 <input style="border: 1px solid #3fafe3; margin-right:10px;" type="text" name="field1" ></td>
    212 </tr>
    213 <tr >
    214 <td >Email Address</td><td > : </td>
    215 <td >
    216 <input style="border: 1px solid #3fafe3;" name="email"
    217 type="text" /><span style="color:#FF0000">*</span>         
    218 </td>
    219 </tr>
    220 
    221 <tr><td colspan="3" > </td></tr>
    222 
    223 <input type="hidden" name="listName" value="1,3,">
    224 
    225 <tr>
    226 <td> </td><td> </td>
    227 <td >
    228 <input type="submit" value="subscribe" name="Submit"  onclick="javascript: if(!verify_fields()) return false; " />
    229 </td>
    230 <td> </td>
    231 </tr>
    232 <tr>
    233 <td colspan="3" > </td>
    234 </tr>
    235 </table>
    236 </form>
    237     </div>
    238                
    23989
    24090
  • newsletter-manager/trunk/admin/add_emails.php

    r527436 r533904  
    7878                </td>
    7979                <td>
    80                     <textarea name="xyz_em_emails" type="text" id="xyz_em_emails"><?php if($xyz_em_dss !="") echo $xyz_em_dss; ?></textarea>
     80                    <textarea name="xyz_em_emails"  id="xyz_em_emails"></textarea>
    8181                </td>
    8282            </tr>
     
    9292            <td colspan="2" id="bottomBorderNone">
    9393           
    94             <b>Note :</b> You can input any unformatted text here. Only valid email address fromats will be extracted from your input.
     94            <b>Note :</b> You can input any unformatted text here. Only valid email address formats will be extracted from your input.
    9595           
    9696            </td></tr>
  • newsletter-manager/trunk/admin/attachment_delete.php

    r526902 r533904  
    33$_POST = stripslashes_deep($_POST);
    44$_GET = stripslashes_deep($_GET);
    5 $xyz_em_attachId = $_GET['id'];
    6 $xyz_em_campId = $_GET['campId'];
     5$xyz_em_attachId = intval($_GET['id']);
     6$xyz_em_campId = intval($_GET['campId']);
    77if($xyz_em_attachId=="" || !is_numeric($xyz_em_attachId)){
    88    header("Location:".admin_url('admin.php?page=newsletter-manager-emailcampaigns'));
  • newsletter-manager/trunk/admin/campaign_delete.php

    r526902 r533904  
    33$_POST = stripslashes_deep($_POST);
    44$_GET = stripslashes_deep($_GET);
    5 $xyz_em_campId = $_GET['id'];
    6 $xyz_em_pageno = $_GET['pageno'];
     5$xyz_em_campId = intval($_GET['id']);
     6$xyz_em_pageno = intval($_GET['pageno']);
    77
    88if($xyz_em_campId=="" || !is_numeric($xyz_em_campId)){
  • newsletter-manager/trunk/admin/campaign_status.php

    r526902 r533904  
    33$_POST = stripslashes_deep($_POST);
    44$_GET = stripslashes_deep($_GET);
    5 $xyz_em_campId = $_GET['id'];
    6 $xyz_em_campStatus = $_GET['status'];
    7 $xyz_em_pageno = $_GET['pageno'];
     5$xyz_em_campId = intval($_GET['id']);
     6$xyz_em_campStatus = intval($_GET['status']);
     7$xyz_em_pageno = intval($_GET['pageno']);
    88
    99if($xyz_em_campId=="" || !is_numeric($xyz_em_campId)){
  • newsletter-manager/trunk/admin/create_campaign.php

    r530634 r533904  
    11<?php
     2
     3require( dirname( __FILE__ ) . '/tinymce_filters.php' );
     4
    25// Load the options
    36global $wpdb;
    4 $_POST = stripslashes_deep($_POST);
    57$_GET = stripslashes_deep($_GET);
    68require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    7 if(isset($_POST['xyz_em_campName'])){
     9if($_POST){
     10$_POST = stripslashes_deep($_POST);
     11$_POST = xyz_trim_deep($_POST);
     12
    813    //  echo '<pre>';
    914    //  print_r($_POST);
     
    4045        $xyz_em_campSubject = $_POST['xyz_em_campSubject'];
    4146        $xyz_em_altBody = $_POST['xyz_em_altBody'];
    42         $xyz_em_batchSize = $_POST['xyz_em_batchSize'];
     47        $xyz_em_batchSize = abs(intval($_POST['xyz_em_batchSize']));
    4348        $xyz_em_senderName = $_POST['xyz_em_senderName'];
    44         $xyz_em_redirectAfterLink = $_POST['xyz_em_redirectAfterLink'];
     49        $xyz_em_redirectAfterLink = strip_tags($_POST['xyz_em_redirectAfterLink']);
    4550        $xyz_em_senderEmail = $_POST['xyz_em_senderEmail'];
    46 
    47         $xyz_em_xyz_em_altBody = $_POST['xyz_em_uploadFile_'];
    4851
    4952
     
    8487        }
    8588
    86         if ((is_numeric($xyz_em_batchSize)) && ((int)$xyz_em_batchSize == $xyz_em_batchSize && (int)$xyz_em_batchSize > 0) && (!is_float($xyz_em_batchSize)) ){
     89        if ( $xyz_em_batchSize > 0){
    8790
    8891            if($xyz_em_defaultEditor == 2){
     
    230233    <h2>Create Campaign</h2>
    231234    <form method="post" enctype="multipart/form-data">
    232         <table class="widefat" style="width:99%;">
     235        <table class="widefat" style="width:98%;">
    233236
    234237            <tr valign="top">
     
    238241                <td><input id="input" name="xyz_em_campName" type="text"
    239242                    id="xyz_em_campName"
    240                     value="<?php if($_POST['xyz_em_campName'] !="") echo $_POST['xyz_em_campName']; ?>" />
     243                    value="<?php if($_POST['xyz_em_campName'] !="") echo esc_html($_POST['xyz_em_campName']); ?>" />
    241244                </td>
    242245            </tr>
     
    308311                <td><input id="input" name="xyz_em_campSubject" type="text"
    309312                    id="xyz_em_campSubject"
    310                     value="<?php if($_POST['xyz_em_campSubject'] !="") echo $_POST['xyz_em_campSubject']; ?>" />
     313                    value="<?php if($_POST['xyz_em_campSubject'] !="") echo esc_html($_POST['xyz_em_campSubject']); ?>" />
    311314                </td>
    312315            </tr>
     
    322325
    323326                            ?>
    324                         <textarea  class="areaSize" name="xyz_em_body"><?php if($_POST['xyz_em_body'] !="") echo $_POST['xyz_em_body']; ?></textarea>
     327                        <textarea  class="areaSize" name="xyz_em_body"><?php if($_POST['xyz_em_body'] !="") echo esc_textarea($_POST['xyz_em_body']); ?></textarea>
    325328                        <?php
    326329                           
     
    343346                    <div id="plainText">
    344347
    345                         <textarea class="areaSize" name="xyz_em_bodyPlain"><?php if($_POST['xyz_em_bodyPlain'] !="") echo $_POST['xyz_em_bodyPlain']; ?></textarea>
     348                        <textarea class="areaSize" name="xyz_em_bodyPlain"><?php if($_POST['xyz_em_bodyPlain'] !="") echo esc_textarea($_POST['xyz_em_bodyPlain']); ?></textarea>
    346349
    347350                    </div>
     
    366369                <td ><textarea id="textarea"
    367370                        name="xyz_em_altBody">
    368                                         <?php //if($_POST['xyz_em_altBody'] !="") echo $_POST['xyz_em_altBody'];  ?>
     371                                        <?php //if($_POST['xyz_em_altBody'] !="") echo esc_textarea($_POST['xyz_em_altBody']);  ?>
    369372                                    </textarea> <br /> <br />
    370373                    <div class="campCreateDiv5">
     
    383386                <td><input id="input" name="xyz_em_batchSize" type="text"
    384387                    id="xyz_em_batchSize"
    385                     value="<?php if($_POST['xyz_em_batchSize'] !="") echo $_POST['xyz_em_batchSize']; ?>" />
     388                    value="<?php if($_POST['xyz_em_batchSize'] !="") echo abs(intval($_POST['xyz_em_batchSize'])); ?>" />
    386389                </td>
    387390            </tr>
     
    391394                <td><input id="input" name="xyz_em_senderName" type="text"
    392395                    id="xyz_em_senderName"
    393                     value="<?php if($_POST['xyz_em_senderName'] !="") echo $_POST['xyz_em_senderName'];else print(get_option('xyz_em_dsn')); ?>" />
     396                    value="<?php if($_POST['xyz_em_senderName'] !="") echo esc_html($_POST['xyz_em_senderName']);else print(esc_html(get_option('xyz_em_dsn'))); ?>" />
    394397                </td>
    395398            </tr>
     
    400403                <td><input id="input" name="xyz_em_redirectAfterLink" type="text"
    401404                    id="xyz_em_redirectAfterLink"
    402                     value="<?php if($_POST['xyz_em_redirectAfterLink'] !="") echo $_POST['xyz_em_redirectAfterLink']; else echo get_option('xyz_em_redirectAfterLink');?>" />
     405                    value="<?php if($_POST['xyz_em_redirectAfterLink'] !="") echo strip_tags($_POST['xyz_em_redirectAfterLink']); else echo get_option('xyz_em_redirectAfterLink');?>" />
    403406                </td>
    404407            </tr>
     
    408411                <td><input id="input" name="xyz_em_senderEmail" type="text"
    409412                    id="xyz_em_senderEmail"
    410                     value="<?php if($_POST['xyz_em_senderEmail'] !="") echo $_POST['xyz_em_senderEmail'];else print(get_option('xyz_em_dse')); ?>" />
     413                    value="<?php if($_POST['xyz_em_senderEmail'] !="") echo esc_html($_POST['xyz_em_senderEmail']);else print(esc_html(get_option('xyz_em_dse'))); ?>" />
    411414                </td>
    412415            </tr>
     
    418421
    419422            <tr valign="top">
    420                 <td scope="row"><label for="xyz_em_senderEmail">Attachment&nbsp;<?php echo $i;?>
     423                <td scope="row"><label >Attachment&nbsp;<?php echo $i;?>
    421424                </label>
    422425                </td>
  • newsletter-manager/trunk/admin/edit_campaign.php

    r530634 r533904  
    11<?php
     2
     3require( dirname( __FILE__ ) . '/tinymce_filters.php' );
     4
    25// Load the options
    36global $wpdb;
    4 $_POST = stripslashes_deep($_POST);
    57$_GET = stripslashes_deep($_GET);
    68//require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    7 if(isset($_POST['xyz_em_campName'])){
     9if($_POST){
     10$_POST = stripslashes_deep($_POST);
     11$_POST = xyz_trim_deep($_POST);
    812    //  echo '<pre>';
    913    //  print_r($_POST);
    1014    //  die;
    1115   
    12     $xyz_em_pagenum = $_POST['pageno'];
     16    $xyz_em_pagenum = abs(intval($_POST['pageno']));
    1317   
    14     $_POST = stripslashes_deep($_POST);
    15     $xyz_em_campId = $_POST['campId'];
     18    $xyz_em_campId = intval($_POST['campId']);
    1619
    1720    $xyz_em_defaultEditor = $_POST['xyz_em_defaultEditor'];
     
    4649        $xyz_em_campSubject = $_POST['xyz_em_campSubject'];
    4750        $xyz_em_altBody = $_POST['xyz_em_altBody'];
    48         $xyz_em_batchSize = $_POST['xyz_em_batchSize'];
     51        $xyz_em_batchSize = abs(intval($_POST['xyz_em_batchSize']));
    4952        $xyz_em_senderName = $_POST['xyz_em_senderName'];
    50         $xyz_em_redirectAfterLink = $_POST['xyz_em_redirectAfterLink'];
     53        $xyz_em_redirectAfterLink = strip_tags($_POST['xyz_em_redirectAfterLink']);
    5154        $xyz_em_senderEmail = $_POST['xyz_em_senderEmail'];
    52 
    53         $xyz_em_xyz_em_altBody = $_POST['xyz_em_uploadFile_'];
    5455
    5556
     
    9091        }
    9192
    92         if ((is_numeric($xyz_em_batchSize)) && ((int)$xyz_em_batchSize == $xyz_em_batchSize && (int)$xyz_em_batchSize > 0) && (!is_float($xyz_em_batchSize)) ){
     93        if ($xyz_em_batchSize > 0){
    9394
    9495            if($xyz_em_defaultEditor == 2){
     
    262263<?php
    263264
    264 $xyz_em_campId = $_GET['id'];
     265$xyz_em_campId = intval($_GET['id']);
    265266
    266267if($_GET['pageno'] != ""){
    267     $xyz_em_pageno = $_GET['pageno'];
     268    $xyz_em_pageno = abs(intval($_GET['pageno']));
    268269}else{
    269270    $xyz_em_pageno= 1;
     
    300301                <td><input id="input" name="xyz_em_campName" type="text"
    301302                    id="xyz_em_campName"
    302                     value="<?php if(isset($_POST['xyz_em_campName']) && $_POST['xyz_em_campName'] !=""){ echo $_POST['xyz_em_campName'];}else{ echo esc_html($details->name); }?>" />
     303                    value="<?php if(isset($_POST['xyz_em_campName'])){ echo esc_html($_POST['xyz_em_campName']);}else{ echo esc_html($details->name); }?>" />
    303304                </td>
    304305            </tr>
     
    368369                </td>
    369370                <td><input id="input" name="xyz_em_campSubject" type="text"
    370                     id="xyz_em_campSubject" value="<?php if(isset($_POST['xyz_em_campSubject']) && $_POST['xyz_em_campSubject'] != ""){echo $_POST['xyz_em_campSubject'];}else{ echo $details->subject;} ?>" />
     371                    id="xyz_em_campSubject" value="<?php if(isset($_POST['xyz_em_campSubject'])){echo esc_html($_POST['xyz_em_campSubject']);}else{ echo esc_html($details->subject);} ?>" />
    371372                </td>
    372373            </tr>
     
    384385                        <textarea class="areaSize"  name="xyz_em_body"><?php
    385386
    386                             if(isset($_POST['xyz_em_body']) && $_POST['xyz_em_body']!= ""){
    387                                 echo $_POST['xyz_em_body'];
     387                            if(isset($_POST['xyz_em_body'])){
     388                                echo esc_textarea($_POST['xyz_em_body']);
    388389                            }else{
    389                             echo $details->body;
     390                            echo esc_textarea($details->body);
    390391                            }
    391392                            ?></textarea>
     
    394395                        }else if(get_option('xyz_em_defaultEditor') == "HTML Editor"){
    395396
    396                             if($xyz_em_body !=""){
     397                            if(isset($_POST['xyz_em_body'])){
    397398                                the_editor($_POST['xyz_em_body'],'xyz_em_body');
    398399                            }else{
     
    407408
    408409                        <textarea class="areaSize" name="xyz_em_bodyPlain"><?php
    409                             if(isset($_POST['xyz_em_bodyPlain']) && $_POST['xyz_em_bodyPlain']!= ""){
    410                                 echo $_POST['xyz_em_bodyPlain'];
     410                            if(isset($_POST['xyz_em_bodyPlain'])){
     411                                echo esc_textarea($_POST['xyz_em_bodyPlain']);
    411412                            }else{
    412                                 echo $details->body;
     413                                echo esc_textarea($details->body);
    413414                            }
    414415                             ?></textarea>
     
    437438                    <?php
    438439
    439 //                  if($_POST['xyz_em_altBody'] != ""){
    440 //                      echo $_POST['xyz_em_altBody'];
     440//                  if(isset($_POST['xyz_em_altBody']){
     441//                      echo esc_html($_POST['xyz_em_altBody']);
    441442//                  }else{
    442 //                      echo $details->alt_body;
     443//                      echo esc_html($details->alt_body);
    443444//                  }
    444445                     ?>
     
    460461                <td><input id="input" name="xyz_em_batchSize" type="text"
    461462                    id="xyz_em_batchSize"
    462                     value="<?php if(isset($_POST['xyz_em_batchSize']) && $_POST['xyz_em_batchSize'] !="") echo $_POST['xyz_em_batchSize'];else echo $details->batch_size; ?>" />
     463                    value="<?php if(isset($_POST['xyz_em_batchSize']) ) echo abs(intval($_POST['xyz_em_batchSize']));else echo $details->batch_size; ?>" />
    463464                </td>
    464465            </tr>
     
    468469                <td><input id="input" name="xyz_em_senderName" type="text"
    469470                    id="xyz_em_senderName"
    470                     value="<?php if(isset($_POST['xyz_em_senderName']) && $_POST['xyz_em_senderName'] !="") echo $_POST['xyz_em_senderName'];else echo esc_html($details->sender_name); ?>" />
     471                    value="<?php if(isset($_POST['xyz_em_senderName']) ) echo esc_html($_POST['xyz_em_senderName']);else echo esc_html($details->sender_name); ?>" />
    471472                </td>
    472473            </tr>
     
    477478                <td><input id="input" name="xyz_em_redirectAfterLink" type="text"
    478479                    id="xyz_em_redirectAfterLink"
    479                     value="<?php if(isset($_POST['xyz_em_redirectAfterLink']) && $_POST['xyz_em_redirectAfterLink']  !="") echo $_POST['xyz_em_redirectAfterLink'];else echo esc_html($details->unsubscription_link); ?>" />
     480                    value="<?php if(isset($_POST['xyz_em_redirectAfterLink']) ) echo striptags($_POST['xyz_em_redirectAfterLink']);else echo ($details->unsubscription_link); ?>" />
    480481                </td>
    481482            </tr>
     
    485486                <td><input id="input" name="xyz_em_senderEmail" type="text"
    486487                    id="xyz_em_senderEmail"
    487                     value="<?php if(isset($_POST['xyz_em_senderEmail']) && $_POST['xyz_em_senderEmail'] !="") echo $_POST['xyz_em_senderEmail'];else echo $details->sender_email; ?>" />
     488                    value="<?php if(isset($_POST['xyz_em_senderEmail'])) echo esc_html($_POST['xyz_em_senderEmail']);else echo esc_html($details->sender_email); ?>" />
    488489                </td>
    489490            </tr>
     
    547548                                ?>
    548549                            <tr>
    549                                 <td scope="row" style="width:350px;"><label for="xyz_em_senderEmail">Attachment&nbsp;<?php echo $i;?>
     550                                <td scope="row" style="width:350px;"><label >Attachment&nbsp;<?php echo $i;?>
    550551                                </label>
    551552                                </td>
     
    570571                <td id="bottomBorderNone" scope="row"><a
    571572                    href='javascript:history.back(-1);'>Go back </a>
    572                 </td>
    573             </tr>
    574             <input type="hidden" name="campId"
    575                 value="<?php echo $details->id; ?>">
    576                 <input type="hidden" name="pageno"
    577             value="<?php echo $xyz_em_pageno; ?>">
     573            <input type="hidden" name="campId"              value="<?php echo $details->id; ?>">
     574                <input type="hidden" name="pageno"          value="<?php echo $xyz_em_pageno; ?>">
     575                </td>
     576            </tr>
    578577        </table>
    579578    </form>
     
    608607
    609608    jQuery("#xyz_em_defaultEditor").change(function(){
    610         editor_change()
     609        editor_change();
    611610    });
    612611   
    613     editor_change()
     612    editor_change();
    614613         
    615614    });
  • newsletter-manager/trunk/admin/edit_email.php

    r526902 r533904  
    11<?php
     2$xyz_em_search='';
    23global $wpdb;
    34$_GET = stripslashes_deep($_GET);
    4 if(isset($_POST['xyz_em_email'])){
    5     if ($_POST['xyz_em_email']!= ""){
     5if($_POST){
    66
    77$_POST = stripslashes_deep($_POST);
    8         $xyz_em_emailId = $_POST['emailId'];
    9         $xyz_em_email = $_POST['xyz_em_email'];
    10         $xyz_em_name = $_POST['xyz_em_name'];
     8$_POST = xyz_trim_deep($_POST);
     9
     10        $xyz_em_emailId = abs(intval($_POST['emailId']));
     11        $xyz_em_email = trim($_POST['xyz_em_email']);
     12        $xyz_em_name = trim($_POST['xyz_em_name']);
     13        $xyz_em_search = trim($_POST['search']);
     14
    1115       
    12         $xyz_em_pagenum = $_POST['pageno'];
     16        $xyz_em_pagenum = abs(intval($_POST['pageno']));
    1317
    1418        if(is_email($xyz_em_email)){
     
    1721            //              print_r($email_count);
    1822            //      die;
    19             $xyz_em_flag = 0;
    2023            if($email_count == 0){
    2124
    2225                $nameCount = $wpdb->query( 'SELECT * FROM xyz_em_additional_field_value WHERE ea_id="'.$xyz_em_emailId.'" ' ) ;
    23 
    24                 //                              echo '<pre>';
    25                 //                              print_r($nameCount);
    26                 //                      die;
    27 
    2826
    2927                if($nameCount>0){
     
    3129                    $wpdb->update('xyz_em_additional_field_value',array('field1'=>$xyz_em_name),array('ea_id'=>$xyz_em_emailId));
    3230                       
    33                     //$wpdb->query( 'UPDATE  xyz_em_additional_field_value SET field1="'.$xyz_em_name.'" WHERE ea_id="'.$xyz_em_emailId.'" ' ) ;
    34                     $xyz_em_flag = 1;
    3531                }else{
    3632                       
    3733                    $wpdb->insert('xyz_em_additional_field_value', array('ea_id' => $xyz_em_emailId,'field1' => $xyz_em_name),array('%d','%s'));
    38                     $xyz_em_flag = 1;
    3934                }
    40                 if($xyz_em_flag == 1){
    4135                       
     36                    if($xyz_em_name=='')
     37                        $wpdb->query( 'delete  FROM xyz_em_additional_field_value WHERE ea_id="'.$xyz_em_emailId.'" ' ) ;
     38                   
    4239                    $wpdb->update('xyz_em_email_address',array('email'=>$xyz_em_email),array('id'=>$xyz_em_emailId));
    43                     //$wpdb->query( 'UPDATE  xyz_em_email_address SET email="'.$xyz_em_email.'" WHERE id="'.$xyz_em_emailId.'" ' ) ;
    44                 }
    4540               
    46                
     41                    if($xyz_em_search=='')
    4742                header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses&emailmsg=1&pagenum='.$xyz_em_pagenum));
     43                    else
     44                header("Location:".admin_url('admin.php?page=newsletter-manager-searchemails&search='.$xyz_em_search));
    4845                exit();
    4946
     
    6764        }
    6865
    69 
    70         $wpdb->flush();
    71 
    72     }else{
    73 
    74         ?>
    75 <div class="system_notice_area_style0" id="system_notice_area">
    76     Please enter a valid email.&nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
    77 </div>
    78 
    79 <?php
    80 
    81 
    82     }
     66   
    8367}
    8468
    8569
    86 $xyz_em_emailId = $_GET['id'];
     70$xyz_em_emailId = abs(intval($_GET['id']));
    8771
    8872if($_GET['pageno'] != ""){
    89 $xyz_em_pageno = $_GET['pageno'];
     73$xyz_em_pageno = abs(intval($_GET['pageno']));
    9074}else{
    9175    $xyz_em_pageno= 1;
    9276}
    9377
    94 if($xyz_em_emailId=="" || !is_numeric($xyz_em_emailId)){
     78if($_GET['search'] != "")
     79$xyz_em_search = trim($_GET['search']);
     80   
     81
     82if($xyz_em_emailId==0){
    9583    header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses'));
    9684    exit();
    9785
    9886}
    99 $emailCount = $wpdb->query( 'SELECT * FROM xyz_em_email_address WHERE id="'.$xyz_em_emailId.'" ' ) ;
     87$emailres = $wpdb->get_results( 'SELECT * FROM xyz_em_email_address WHERE id="'.$xyz_em_emailId.'" LIMIT 0,1' ) ;
    10088
    101 if($emailCount==0){
     89if(count($emailres)==0){
    10290    header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses'));
    10391    exit();
    10492}else{
    105     $emailDetails = $wpdb->get_results( 'SELECT * FROM xyz_em_email_address WHERE id="'.$xyz_em_emailId.'" LIMIT 0,1' ) ;
    10693
    107     $nameCount = $wpdb->query( 'SELECT * FROM xyz_em_additional_field_value WHERE ea_id="'.$xyz_em_emailId.'" ' ) ;
    108     if($nameCount>0){
    109         $nameDetails = $wpdb->get_results( 'SELECT * FROM xyz_em_additional_field_value WHERE ea_id="'.$xyz_em_emailId.'" ' ) ;
    110     }
     94    $nameres = $wpdb->get_results( 'SELECT * FROM xyz_em_additional_field_value WHERE ea_id="'.$xyz_em_emailId.'" ' ) ;
    11195
    112     if($emailDetails){
    113         $emailDetails = $emailDetails[0];
    114         $details = $emailDetails;
     96        $emailDetails = $emailres[0];
    11597        ?>
    11698<div>
     
    124106                </td>
    125107                <td><input name="xyz_em_email" type="text" id="xyz_em_email"
    126                     value="<?php if(isset($_POST['xyz_em_email']) && $_POST['xyz_em_email'] != ""){echo $_POST['xyz_em_email'];}else{ echo $details->email; }?>" />
     108                    value="<?php if(isset($_POST['xyz_em_email']) ){echo esc_html($_POST['xyz_em_email']);}else{ echo esc_html($emailDetails->email); }?>" />
    127109                </td>
    128110            </tr>
     
    132114                <td><input name="xyz_em_name" type="text" id="xyz_em_name"
    133115                    value="<?php
    134 
    135                     if($nameCount>0){
    136                         if($nameDetails){
    137                             foreach ($nameDetails as $detailsName){
    138                                 if(isset($_POST['xyz_em_name']) && $_POST['xyz_em_name'] != ""){
    139                                     echo $_POST['xyz_em_name'];
     116                                if(isset($_POST['xyz_em_name']) ){
     117                                    echo esc_html($_POST['xyz_em_name']);
    140118                                }else{                             
    141                                     echo esc_html($detailsName->field1);
     119                                    foreach ($nameres as $detailsName){
     120                                        echo esc_html($detailsName->field1);
     121                                    }
    142122                                }
    143                             }
    144                         }
    145                     }
    146                    
    147                    
    148123                    ?>" />
    149124                </td>
     
    167142        <input type="hidden" name="pageno"
    168143            value="<?php echo $xyz_em_pageno; ?>">
     144        <input type="hidden" name="search"
     145            value="<?php echo ($xyz_em_search); ?>">
    169146    </form>
    170147
     
    172149<?php
    173150
    174     }
    175151}
    176152
  • newsletter-manager/trunk/admin/email_activate.php

    r530639 r533904  
    44$_GET = stripslashes_deep($_GET);
    55
    6 $xyz_em_emailId = $_GET['id'];
    7 $xyz_em_pageno = $_GET['pageno'];
     6$xyz_em_emailId = intval($_GET['id']);
     7$xyz_em_pageno = intval($_GET['pageno']);
     8$xyz_em_search = '';
     9if(isset($_GET['search']))
     10    $xyz_em_search = trim($_GET['search']);
     11
    812if($xyz_em_emailId=="" || !is_numeric($xyz_em_emailId)){
    913    header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses'));
     
    2327   
    2428    //$wpdb->query( 'UPDATE  xyz_em_address_list_mapping SET status="'.$xyz_em_status.'" WHERE ea_id="'.$xyz_em_emailId.'" ' ) ;
     29    if($xyz_em_search=='')
     30        header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses&emailmsg=5&pagenum='.$xyz_em_pageno));
     31    else
     32        header("Location:".admin_url('admin.php?page=newsletter-manager-searchemails&search='.$xyz_em_search));
    2533   
    26     header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses&emailmsg=5&pagenum='.$xyz_em_pageno));
    2734    exit();
    2835
  • newsletter-manager/trunk/admin/email_campaigns.php

    r530634 r533904  
    190190</script>
    191191
    192 <div>
     192<div style="width: 99%">
    193193
    194194
     
    204204    ?>
    205205
    206     <table class="widefat">
     206    <table class="widefat" >
    207207        <thead>
    208208            <tr>
  • newsletter-manager/trunk/admin/email_delete.php

    r526902 r533904  
    44$_GET = stripslashes_deep($_GET);
    55
    6 $xyz_em_emailId = $_GET['id'];
    7 $xyz_em_pageno = $_GET['pageno'];
     6$xyz_em_search = '';
     7if(isset($_GET['search']))
     8    $xyz_em_search = trim($_GET['search']);
     9$xyz_em_emailId = absint($_GET['id']);
     10$xyz_em_pageno = absint($_GET['pageno']);
    811if($xyz_em_emailId=="" || !is_numeric($xyz_em_emailId)){
    912    header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses'));
     
    2326
    2427    //$wpdb->query('ANALYZE TABLE xyz_em_email_address');
     28    if($xyz_em_search=='')
     29        header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses&emailmsg=3&pagenum='.$xyz_em_pageno));
     30    else
     31        header("Location:".admin_url('admin.php?page=newsletter-manager-searchemails&search='.$xyz_em_search));
    2532   
    26     header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses&emailmsg=3&pagenum='.$xyz_em_pageno));
    2733    exit();
    2834
  • newsletter-manager/trunk/admin/email_unsubscribe.php

    r526902 r533904  
    44$_GET = stripslashes_deep($_GET);
    55
    6 $xyz_em_emailId = $_GET['id'];
    7 $xyz_em_pageno = $_GET['pageno'];
     6$xyz_em_emailId = absint($_GET['id']);
     7$xyz_em_pageno = absint($_GET['pageno']);
     8$xyz_em_search = '';
     9if(isset($_GET['search']))
     10$xyz_em_search = trim($_GET['search']);
    811if($xyz_em_emailId=="" || !is_numeric($xyz_em_emailId)){
    912    header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses'));
     
    2326   
    2427    //$wpdb->query( 'UPDATE  xyz_em_address_list_mapping SET status="'.$xyz_em_status.'" WHERE ea_id="'.$xyz_em_emailId.'" ' ) ;
     28    if($xyz_em_search=='')
     29        header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses&emailmsg=2&pagenum='.$xyz_em_pageno));
     30    else
     31        header("Location:".admin_url('admin.php?page=newsletter-manager-searchemails&search='.$xyz_em_search));
    2532   
    26     header("Location:".admin_url('admin.php?page=newsletter-manager-emailaddresses&emailmsg=2&pagenum='.$xyz_em_pageno));
    2733    exit();
    2834
  • newsletter-manager/trunk/admin/import_export.php

    r526902 r533904  
    1919
    2020
    21 $xyz_em_exportbatchSize = $_POST['xyz_em_exportbatchSize'];
    22 if ((is_numeric($xyz_em_exportbatchSize)) && ((int)$xyz_em_exportbatchSize == $xyz_em_exportbatchSize && (int)$xyz_em_exportbatchSize > 0)
    23         && (!is_float($xyz_em_exportbatchSize)) ){
     21$xyz_em_exportbatchSize = absint($_POST['xyz_em_exportbatchSize']);
     22if ($xyz_em_exportbatchSize > 0){
    2423    $execFlag = 1;
    2524
     
    3534    $nameofForm = $_POST['exportForm'];
    3635
    37     $limitFrom = $_POST['limitFrom'];
     36    $limitFrom = absint($_POST['limitFrom']);
    3837    if($limitFrom == ""){
    3938        $limitFrom = 0;
     
    286285                    name="xyz_em_exportbatchSize" type="text"
    287286                    id="xyz_em_exportbatchSize"
    288                     value="<?php if(isset($_POST['xyz_em_exportbatchSize']) && $_POST['xyz_em_exportbatchSize'] !="") echo $_POST['xyz_em_exportbatchSize'];else echo "1000"; ?>" />
     287                    value="<?php if(isset($_POST['xyz_em_exportbatchSize'])) echo absint($_POST['xyz_em_exportbatchSize']);else echo "1000"; ?>" />
    289288                </td>
    290289            </tr>
     
    342341
    343342        $xyz_em_emailListId = 1;
    344         $xyz_em_number_lines = $_POST['xyz_em_batchSize'];
    345 
    346         if ((is_numeric($xyz_em_number_lines)) && ((int)$xyz_em_number_lines == $xyz_em_number_lines && (int)$xyz_em_number_lines > 0) && (!is_float($xyz_em_number_lines)) ){
     343        $xyz_em_number_lines =absint( $_POST['xyz_em_batchSize']);
     344
     345        if ($xyz_em_number_lines > 0){
    347346            $xyz_em_separatorChar = $_POST['xyz_em_separator'];
    348347            $xyz_em_enclosingChar = $_POST['xyz_em_enclCharacter'];
     
    402401                $afterPost = 1;
    403402
    404                 $xyz_em_hiddenLineNumberFrom = $_POST['xyz_em_hiddenLineNumber'];
    405 
    406                 if($xyz_em_hiddenLineNumberFrom == 0){
    407                     $xyz_em_hiddenLineNumberFrom = 0;
    408                 }
    409 
     403                $xyz_em_hiddenLineNumberFrom = absint($_POST['xyz_em_hiddenLineNumber']);
    410404
    411405
    412406                $xyz_em_lineCountTo = $xyz_em_hiddenLineNumberFrom + $xyz_em_number_lines;
    413407
    414                 $xyz_em_totalLines = $_POST['xyz_em_totalLinesNumber'];
     408                $xyz_em_totalLines = absint($_POST['xyz_em_totalLinesNumber']);
    415409                if($xyz_em_totalLines == 0){
    416410                    $xyz_em_totalLines = count(file($file));
    417 
    418                 }else{
    419                     $xyz_em_totalLines = $_POST['xyz_em_totalLinesNumber'];
    420411                }
    421412
     
    447438
    448439                        $lines= fgets($file);
    449 
    450                         $string = preg_replace("'$xyz_em_enclosingChar'","",$lines);
    451                         $fieldArray = explode(",",$string);
     440                        $lines= str_replace("\r\n", "", $lines);
     441                        $lines= str_replace("\r", "", $lines);
     442                        $lines= str_replace("\n", "", $lines);
     443                        $string = preg_replace("/$xyz_em_enclosingChar/","",$lines);
     444                        $fieldArray = explode($xyz_em_separatorChar,$string);
    452445
    453446                        $errorFlag = 0;
     
    585578            type="hidden" name="xyz_em_totalLinesNumber"
    586579            value="<?php echo $xyz_em_totalLines;?>" /> <input type="hidden"
    587             name="xyz_em_separator" value="<?php echo $xyz_em_separatorChar;?>" />
     580            name="xyz_em_separator" value="<?php echo esc_html($xyz_em_separatorChar);?>" />
    588581
    589582        <input type="hidden" name="xyz_em_enclCharacter"
    590             value='<?php echo "$xyz_em_enclosingChar";?>' /> <input type="hidden"
     583            value='<?php echo esc_html($xyz_em_enclosingChar);?>' /> <input type="hidden"
    591584            name="xyz_em_hiddenFtellValues" value="<?php echo $ftellValue;?>" />
    592585        <input type="hidden" name="submited" value="1" />
     
    626619            ?>
    627620    <div class="system_notice_area_style0" id="system_notice_area">
    628         Number of lines per batch must be a positive whole
    629         number.&nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
     621        Number of lines per batch must be a positive number.&nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss">Dismiss</span>
    630622    </div>
    631623    <?php   
     
    686678                <td><input id="input" name="xyz_em_batchSize" type="text"
    687679                    id="xyz_em_batchSize"
    688                     value="<?php if(isset($_GET['batchsize']) && $_GET['batchsize'] !="") echo $_GET['batchsize'];else echo "1000"; ?>" />
     680                    value="<?php if(isset($_GET['batchsize'])) echo absint($_GET['batchsize']);else echo "1000"; ?>" />
    689681                </td>
    690682            </tr>
     
    736728        $xyz_em_email = $wpdb->get_results('SELECT * FROM xyz_em_email_address WHERE email="'.$email.'" ') ;
    737729
    738         $xyz_em_email = $xyz_em_email[0];
    739 
    740 
    741730        if(count($xyz_em_email) > 0){
    742             $emailLastId = $xyz_em_email->id;
     731
     732            $xyz_em_email = $xyz_em_email[0];
     733
     734            $xyz_em_emailLastid = $xyz_em_email->id;
    743735        }else{
    744736
  • newsletter-manager/trunk/admin/install.php

    r530634 r533904  
    233233   
    234234   
     235   
     236    //Bug fix:
     237    $wpdb->query( 'delete from xyz_em_address_list_mapping WHERE ea_id=0' ) ;
     238   
     239   
    235240}
    236241
  • newsletter-manager/trunk/admin/menu.php

    r530634 r533904  
    5454    add_submenu_page('newsletter-manager-settings', 'Newsletter Manager - Add Emails', 'Add Emails', 'manage_options', 'newsletter-manager-addemails' ,'em_add_emails');
    5555
     56    add_submenu_page('newsletter-manager-settings', 'Newsletter Manager - Search Emails', 'Search Emails', 'manage_options', 'newsletter-manager-searchemails' ,'em_search_emails');
     57
    5658    add_submenu_page('newsletter-manager-settings', 'Newsletter Manager - Email Addresses', 'Email Addresses', 'manage_options', 'newsletter-manager-emailaddresses' ,'em_email_addresses');
    5759
     
    7577function em_settings(){
    7678    require( dirname( __FILE__ ) . '/newsletter_manager_settings.php' );
     79    require( dirname( __FILE__ ) . '/footer.php' );
    7780}
    7881
     
    9497        require( dirname( __FILE__ ) . '/import_export.php' );
    9598    }
     99    require( dirname( __FILE__ ) . '/footer.php' );
    96100}
    97101
     
    101105
    102106    require( dirname( __FILE__ ) . '/subscription_code.php' );
     107    require( dirname( __FILE__ ) . '/footer.php' );
    103108}
    104109
     
    106111function em_status(){
    107112    require( dirname( __FILE__ ) . '/status.php' );
     113    require( dirname( __FILE__ ) . '/footer.php' );
    108114}
    109115
    110116function em_about(){
    111117    require( dirname( __FILE__ ) . '/about.php' );
     118    require( dirname( __FILE__ ) . '/footer.php' );
    112119}
    113120
     
    121128function em_add_emails(){
    122129    require( dirname( __FILE__ ) . '/add_emails.php' );
    123 }
    124 
     130    require( dirname( __FILE__ ) . '/footer.php' );
     131}
     132
     133function em_search_emails(){
     134    require( dirname( __FILE__ ) . '/search_emails.php' );
     135    require( dirname( __FILE__ ) . '/footer.php' );
     136   
     137}
    125138function em_email_addresses(){
    126139
     
    161174
    162175    }
     176    require( dirname( __FILE__ ) . '/footer.php' );
    163177}
    164178
    165179function em_create_campaign(){
    166180    require( dirname( __FILE__ ) . '/create_campaign.php' );
     181    require( dirname( __FILE__ ) . '/footer.php' );
    167182
    168183}
     
    226241
    227242
     243    require( dirname( __FILE__ ) . '/footer.php' );
    228244
    229245}
  • newsletter-manager/trunk/admin/newsletter_manager_settings.php

    r530634 r533904  
    11<?php
     2
     3require( dirname( __FILE__ ) . '/tinymce_filters.php' );
     4
    25global $wpdb;
    36// Load the options
    4 if(isset($_POST['xyz_em_hesl'])){
     7if($_POST){
    58   
    69//  echo "hesl:".$_POST['xyz_em_hesl']."<br/>";
     
    811//  echo "dsn:".$_POST['xyz_em_dsn']."<br/>";
    912//  echo "dsubname:".$_POST['xyz_em_dsubname']."<br/>";die;
    10    
    11 if (($_POST['xyz_em_hesl']!= "") && ($_POST['xyz_em_dse'] != "") && ($_POST['xyz_em_dsn'] != "") && ($_POST['xyz_em_dsubname']!= "")){
     13$_POST=xyz_trim_deep($_POST);
    1214$_POST = stripslashes_deep($_POST);
    13     $heslValue = $_POST['xyz_em_hesl'];
    14    
    15     if ((is_numeric($heslValue)) && ((int)$heslValue == $heslValue && (int)$heslValue > 0) && (!is_float($heslValue)) ){
     15
     16if (($_POST['xyz_em_hesl']!= "") && ($_POST['xyz_em_dse'] != "") && ($_POST['xyz_em_dsn'] != "") && ($_POST['xyz_em_dsubname']!= "")
     17        && ($_POST['xyz_em_afterSubscription']!= "") && ($_POST['xyz_em_emailConfirmation']!= "") && ($_POST['xyz_em_redirectAfterLink']!= "") ){
     18            $xyz_em_hesl = abs(intval($_POST['xyz_em_hesl']));
     19   
     20    if ( $xyz_em_hesl > 0 ){
    1621        if(is_email($_POST['xyz_em_dse'])){
    1722
    18             $xyz_em_hesl = abs(intval($_POST['xyz_em_hesl']));
    1923            $xyz_em_dss = $_POST['xyz_em_dss'];
    2024            $xyz_em_defaultEditor = $_POST['xyz_em_defaultEditor'];
     
    2428            $xyz_em_enableUnsubNotification = $_POST['xyz_em_enableUnsubNotification'];
    2529           
    26             $xyz_em_afterSubscription = $_POST['xyz_em_afterSubscription'];
    27             $xyz_em_emailConfirmation = $_POST['xyz_em_emailConfirmation'];
    28             $xyz_em_redirectAfterLink = $_POST['xyz_em_redirectAfterLink'];
    29            
    30             $xyz_em_limit = $_POST['xyz_em_limit'];
     30            $xyz_em_afterSubscription = strip_tags($_POST['xyz_em_afterSubscription']);
     31            $xyz_em_emailConfirmation = strip_tags($_POST['xyz_em_emailConfirmation']);
     32            $xyz_em_redirectAfterLink = strip_tags($_POST['xyz_em_redirectAfterLink']);
     33           
     34            $xyz_em_limit = abs(intval($_POST['xyz_em_limit']));
    3135           
    3236            $xyz_em_widgetName = $_POST['xyz_em_widgetName'];
    3337           
    34             if ((is_numeric($xyz_em_limit)) && ((int)$xyz_em_limit == $xyz_em_limit && (int)$xyz_em_limit > 0) && (!is_float($xyz_em_limit)) ){
     38            if ( $xyz_em_limit > 0 ){
    3539
    3640
     
    138142                </td>
    139143                <td id="bottomBorderNone"><input  name="xyz_em_limit" type="text"
    140                     id="xyz_em_limit" value="<?php if(isset($_POST['xyz_em_limit']) && $_POST['xyz_em_limit'] != ""){echo $_POST['xyz_em_limit'];}else{print(get_option('xyz_em_limit'));} ?>" />
     144                    id="xyz_em_limit" value="<?php if(isset($_POST['xyz_em_limit']) ){echo abs(intval($_POST['xyz_em_limit']));}else{print(get_option('xyz_em_limit'));} ?>" />
    141145                </td>
    142146            </tr>
     
    152156                </td>
    153157                <td><input  name="xyz_em_hesl" type="text"
    154                     id="xyz_em_hesl" value="<?php if(isset($_POST['xyz_em_hesl']) &&$_POST['xyz_em_hesl'] != ""){echo $_POST['xyz_em_hesl'];}else{ print(esc_html(get_option('xyz_em_hesl'))); }?>" />
     158                    id="xyz_em_hesl" value="<?php if(isset($_POST['xyz_em_hesl']) ){echo abs(intval($_POST['xyz_em_hesl']));}else{ print(get_option('xyz_em_hesl')); }?>" />
    155159                </td>
    156160            </tr>
     
    159163                </td>
    160164                <td><input name="xyz_em_dse" type="text" id="xyz_em_dse"
    161                     value="<?php if(isset($_POST['xyz_em_dse']) && $_POST['xyz_em_dse'] != ""){echo $_POST['xyz_em_dse'];}else{print(esc_html(get_option('xyz_em_dse')));} ?>" /></td>
     165                    value="<?php if(isset($_POST['xyz_em_dse']) ){echo esc_html($_POST['xyz_em_dse']);}else{print(esc_html(get_option('xyz_em_dse')));} ?>" /></td>
    162166            </tr>
    163167            <tr valign="top">
     
    165169                </td>
    166170                <td><input name="xyz_em_dsn" type="text" id="xyz_em_dsn"
    167                     value="<?php if(isset($_POST['xyz_em_dsn']) && $_POST['xyz_em_dsn'] != ""){echo $_POST['xyz_em_dsn'];}else{print(esc_html(get_option('xyz_em_dsn')));} ?>" /></td>
     171                    value="<?php if(isset($_POST['xyz_em_dsn']) ){echo esc_html($_POST['xyz_em_dsn']);}else{print(esc_html(get_option('xyz_em_dsn')));} ?>" /></td>
    168172            </tr>
    169173            <tr valign="top">
     
    172176                <td id="bottomBorderNone" ><input name="xyz_em_dsubname" type="text" id="xyz_em_dsubname"
    173177                    value="<?php
    174                         if(isset($_POST['xyz_em_dsubname']) && $_POST['xyz_em_dsubname'] != ""){
    175                             echo $_POST['xyz_em_dsubname'];
     178                        if(isset($_POST['xyz_em_dsubname']) ){
     179                            echo esc_html($_POST['xyz_em_dsubname']);
    176180                        }else{
    177181                            global $wpdb;                           
     
    196200                </td>
    197201                <td  ><input  name="xyz_em_widgetName" type="text"
    198                     id="xyz_em_widgetName" value="<?php if(isset($_POST['xyz_em_widgetName']) && $_POST['xyz_em_widgetName'] != ""){echo $_POST['xyz_em_widgetName'];}else{ print(esc_html(get_option('xyz_em_widgetName'))); }?>" />
     202                    id="xyz_em_widgetName" value="<?php if(isset($_POST['xyz_em_widgetName'])){echo esc_html($_POST['xyz_em_widgetName']);}else{ echo esc_html(get_option('xyz_em_widgetName')); }?>" />
    199203                </td>
    200204            </tr>
     
    216220                <td><input id="input" name="xyz_em_afterSubscription" type="text"
    217221                    id="xyz_em_afterSubscription"
    218                     value="<?php if(isset($_POST['xyz_em_afterSubscription']) && $_POST['xyz_em_afterSubscription'] !="") echo $_POST['xyz_em_afterSubscription']; else echo get_option('xyz_em_afterSubscription');//echo esc_html(plugins_url("newsletter-manager/thanks.php"));?>" />
     222                    value="<?php if(isset($_POST['xyz_em_afterSubscription']) ) echo strip_tags($_POST['xyz_em_afterSubscription']); else echo get_option('xyz_em_afterSubscription');//echo esc_html(plugins_url("newsletter-manager/thanks.php"));?>" />
    219223                </td>
    220224            </tr>
     
    224228                <td  ><input id="input" name="xyz_em_emailConfirmation" type="text"
    225229                    id="xyz_em_emailConfirmation"
    226                     value="<?php if(isset($_POST['xyz_em_emailConfirmation']) && $_POST['xyz_em_emailConfirmation'] !="") echo $_POST['xyz_em_emailConfirmation']; else echo get_option('xyz_em_emailConfirmation');//echo esc_html(plugins_url("newsletter-manager/confirm.php"));?>" />
     230                    value="<?php if(isset($_POST['xyz_em_emailConfirmation']) ) echo strip_tags($_POST['xyz_em_emailConfirmation']); else echo get_option('xyz_em_emailConfirmation');//echo esc_html(plugins_url("newsletter-manager/confirm.php"));?>" />
    227231                </td>
    228232            </tr>
     
    253257                <td  ><input id="input" name="xyz_em_redirectAfterLink" type="text"
    254258                    id="xyz_em_redirectAfterLink"
    255                     value="<?php if(isset($_POST['xyz_em_redirectAfterLink']) && $_POST['xyz_em_redirectAfterLink'] !="") echo $_POST['xyz_em_redirectAfterLink']; else echo get_option('xyz_em_redirectAfterLink');//echo esc_html(plugins_url("newsletter-manager/unsubscribe.php"));?>" />
     259                    value="<?php if(isset($_POST['xyz_em_redirectAfterLink']) ) echo strip_tags($_POST['xyz_em_redirectAfterLink']); else echo get_option('xyz_em_redirectAfterLink');//echo esc_html(plugins_url("newsletter-manager/unsubscribe.php"));?>" />
    256260                </td>
    257261            </tr>   
     
    305309                <td><input  name="xyz_em_subject3" type="text"
    306310                    id="xyz_em_subject3" value="<?php
    307                     if(isset($_POST['xyz_em_subject3']) && $_POST['xyz_em_subject3'] != ""){echo $_POST['xyz_em_subject3'];}else{echo esc_html($xyz_em_temmplate3->subject);}
     311                    if(isset($_POST['xyz_em_subject3']) ){echo esc_html($_POST['xyz_em_subject3']);}else{echo esc_html($xyz_em_temmplate3->subject);}
    308312                    ?>" />
    309313                </td>
     
    322326                    <textarea name="xyz_em_message3" type="text" id="xyz_em_message3" style="width:100%;margin-left:0px;"><?php
    323327
    324                     if(isset($_POST['xyz_em_message3']) && $_POST['xyz_em_message3'] != ""){echo $_POST['xyz_em_message3'];}else{echo $xyz_em_temmplate3->message;} ?></textarea>
     328                    if(isset($_POST['xyz_em_message3']) ){echo esc_textarea($_POST['xyz_em_message3']);}else{echo esc_textarea( $xyz_em_temmplate3->message);} ?></textarea>
    325329                    <?php
    326330                   
    327331                    }elseif(get_option('xyz_em_defaultEditor') == "HTML Editor"){
    328                         if(isset($_POST['xyz_em_message3']) && $_POST['xyz_em_message3'] != ""){
    329                             the_editor($_POST['xyz_em_message3'],'xyz_em_message3');
     332                        if(isset($_POST['xyz_em_message3']) ){
     333                            the_editor(($_POST['xyz_em_message3']),'xyz_em_message3');
    330334                        }else{
    331                             the_editor($xyz_em_temmplate3->message,'xyz_em_message3');
     335                            the_editor(($xyz_em_temmplate3->message),'xyz_em_message3');
    332336                        }                   
    333337                    }
     
    353357                   
    354358                   
    355                         if(isset($_POST['xyz_em_subject1']) && $_POST['xyz_em_subject1'] != ""){echo $_POST['xyz_em_subject1'];}else{echo esc_html($xyz_em_temmplate1->subject);}
     359                        if(isset($_POST['xyz_em_subject1']) ){echo esc_html($_POST['xyz_em_subject1']);}else{echo esc_html($xyz_em_temmplate1->subject);}
    356360                   
    357361                   
     
    372376                    <textarea name="xyz_em_message1" type="text" id="xyz_em_message1" style="width:100%;margin-left:0px;"><?php
    373377
    374                     if(isset($_POST['xyz_em_message1']) && $_POST['xyz_em_message1'] != ""){echo $_POST['xyz_em_message1'];}else{echo $xyz_em_temmplate1->message;} ?></textarea>
     378                    if(isset($_POST['xyz_em_message1']) ){echo esc_textarea($_POST['xyz_em_message1']);}else{echo esc_textarea($xyz_em_temmplate1->message);} ?></textarea>
    375379                    <?php
    376380                   
    377381                    }elseif(get_option('xyz_em_defaultEditor') == "HTML Editor"){
    378                         if(isset($_POST['xyz_em_message1']) && $_POST['xyz_em_message1'] != ""){
    379                             the_editor($_POST['xyz_em_message1'],'xyz_em_message1');
     382                        if(isset($_POST['xyz_em_message1']) ){
     383                            the_editor(($_POST['xyz_em_message1']),'xyz_em_message1');
    380384                        }else{
    381                             the_editor($xyz_em_temmplate1->message,'xyz_em_message1');
     385                            the_editor(($xyz_em_temmplate1->message),'xyz_em_message1');
    382386                        }                   
    383387                    }
     
    399403                    id="xyz_em_subject2" value="<?php
    400404                    //if($xyz_em_subject2 != ""){echo $xyz_em_subject2;}else{echo esc_html($xyz_em_temmplate2->subject);}
    401                     if(isset($_POST['xyz_em_subject2']) && $_POST['xyz_em_subject2'] != ""){
    402                         echo $_POST['xyz_em_subject2'];
     405                    if(isset($_POST['xyz_em_subject2']) ){
     406                        echo esc_html($_POST['xyz_em_subject2']);
    403407                    }else{echo esc_html($xyz_em_temmplate2->subject);
    404408                    }
     
    419423                    <textarea name="xyz_em_message2" type="text" id="xyz_em_message2" style="width:100%;margin-left:0px;"><?php
    420424
    421                     if(isset($_POST['xyz_em_message2']) && $_POST['xyz_em_message2'] != ""){echo $_POST['xyz_em_message2'];}else{echo $xyz_em_temmplate2->message;} ?></textarea>
     425                    if(isset($_POST['xyz_em_message2']) ){echo esc_textarea($_POST['xyz_em_message2']);}else{echo esc_textarea($xyz_em_temmplate2->message);} ?></textarea>
    422426                    <?php
    423427                   
    424428                    }elseif(get_option('xyz_em_defaultEditor') == "HTML Editor"){
    425                         if(isset($_POST['xyz_em_message2']) && $_POST['xyz_em_message2'] != ""){
    426                             the_editor($_POST['xyz_em_message2'],'xyz_em_message2');
     429                        if(isset($_POST['xyz_em_message2'])){
     430                            the_editor(($_POST['xyz_em_message2']),'xyz_em_message2');
    427431                        }else{
    428                             the_editor($xyz_em_temmplate2->message,'xyz_em_message2');
     432                            the_editor(($xyz_em_temmplate2->message),'xyz_em_message2');
    429433                        }                   
    430434                    }
     
    446450    <table class="widefat"  style="width:99%;">
    447451            <tr valign="top">
    448                 <td scope="row"  class=" settingInput" style="width:30%"><label for="xyz_em_redirectAfterLink">Cron job command</label>
     452                <td scope="row"  class=" settingInput" style="width:30%"><label >Cron job command</label>
    449453                </td>
    450454                <td  > wget <?php echo plugins_url().'/newsletter-manager/cron.php'; ?></td>
    451455            </tr>   
    452456                <tr valign="top">
    453                 <td scope="row"  class=" settingInput"><label for="xyz_em_redirectAfterLink">Shortcode to be used in page after subscription</label>
     457                <td scope="row"  class=" settingInput"><label >Shortcode to be used in page after subscription</label>
    454458                </td>
    455459                <td  >[xyz_em_thanks]</td>
    456460            </tr>   
    457461                            <tr valign="top">
    458                 <td scope="row"  class=" settingInput"><label for="xyz_em_redirectAfterLink">Shortcode to be used in page after email confirmation</label>
     462                <td scope="row"  class=" settingInput"><label >Shortcode to be used in page after email confirmation</label>
    459463                </td>
    460464                <td  >[xyz_em_confirm]</td>
    461465            </tr>   
    462466                        <tr valign="top">
    463                 <td scope="row" class=" settingInput" id="bottomBorderNone"><label for="xyz_em_enableUnsubNotification">Shortcode to be used in page after unsubscription</label>
     467                <td scope="row" class=" settingInput" id="bottomBorderNone"><label >Shortcode to be used in page after unsubscription</label>
    464468                </td>
    465469                <td id="bottomBorderNone">[xyz_em_unsubscribe]              </td>
  • newsletter-manager/trunk/admin/preview.php

    r526902 r533904  
    11<?php
    22require( dirname( __FILE__ ) . '../../../../../wp-load.php' );
     3if ( !current_user_can('manage_options') )
     4    die;
    35global $wpdb;
    46$_POST = stripslashes_deep($_POST);
    57$_GET = stripslashes_deep($_GET);
    6 $xyz_em_campId = $_GET['id'];
     8$xyz_em_campId = absint($_GET['id']);
    79
    810$campList = $wpdb->get_results( 'SELECT * FROM xyz_em_email_campaign WHERE id="'.$xyz_em_campId.'"') ;
     
    6264}
    6365
    64 //http://localhost/workspace/wordpress/wp-admin/admin.php?page=newsletter-manager-emailcampaigns&action=preview&id=2
     66?>
  • newsletter-manager/trunk/admin/restart.php

    r526902 r533904  
    55$_GET = stripslashes_deep($_GET);
    66
    7 $xyz_em_campId = $_GET['id'];
    8 $xyz_em_pageno = $_GET['pageno'];
     7$xyz_em_campId = absint($_GET['id']);
     8$xyz_em_pageno = absint($_GET['pageno']);
    99
    1010if($xyz_em_campId=="" || !is_numeric($xyz_em_campId)){
  • newsletter-manager/trunk/admin/send_mail.php

    r530634 r533904  
    77
    88
    9 $xyz_em_campId = $_GET['id'];
    10 $xyz_em_campStatus = $_GET['status'];
    11 $xyz_em_pageno = $_GET['pageno'];
     9$xyz_em_campId =absint ($_GET['id']);
     10$xyz_em_pageno = absint($_GET['pageno']);
    1211
    1312if($xyz_em_campId=="" || !is_numeric($xyz_em_campId)){
  • newsletter-manager/trunk/admin/test_mail.php

    r530634 r533904  
    1111$_GET = stripslashes_deep($_GET);
    1212
    13 $xyz_em_pageno = $_GET['pageno'];
     13$xyz_em_pageno = absint($_GET['pageno']);
    1414
    1515
     
    1717    if ($_POST['xyz_em_testMailId']!= ""){
    1818$xyz_em_testEmail = $_POST['xyz_em_testMailId'];
    19 $xyz_em_campId = $_POST['campId'];
    20 $xyz_em_campStatus = $_GET['status'];
     19$xyz_em_campId = absint($_POST['campId']);
    2120if($xyz_em_campId=="" || !is_numeric($xyz_em_campId)){
    2221    header("Location:".admin_url('admin.php?page=newsletter-manager-emailcampaigns'));
     
    129128                </td>
    130129                <td>
    131                     <input type="text" name="xyz_em_testMailId">
     130                    <input type="text" name="xyz_em_testMailId" value="<?php if(isset($_POST['xyz_em_testMailId'])) echo esc_html($_POST['xyz_em_testMailId']); ?>">
    132131                </td>
    133132            </tr>
  • newsletter-manager/trunk/confirmation.php

    r530634 r533904  
    88$_POST = stripslashes_deep($_POST);
    99$_GET = stripslashes_deep($_GET);
    10 $xyz_em_emailId = $_GET['eId'];
    11 $xyz_em_listId = $_GET['lId'];
     10$xyz_em_emailId = absint($_GET['eId']);
     11$xyz_em_listId = absint($_GET['lId']);
     12
     13$xyz_em_both = $_GET['both'];
     14
     15$xyz_em_email = $wpdb->get_results( 'SELECT * FROM xyz_em_email_address WHERE id="'.$xyz_em_emailId.'" ') ;
     16$xyz_em_email = $xyz_em_email[0];
     17
     18$combine = $xyz_em_emailId.$xyz_em_listId.$xyz_em_email->email;
     19$combineValue = md5($combine);
     20
     21
    1222$xyz_em_url = base64_decode($_GET['appurl']);
    1323if($xyz_em_url=='')
    1424    $xyz_em_url=get_option('xyz_em_emailConfirmation');
     25
     26if($combineValue == $xyz_em_both){
    1527
    1628$xyz_em_statusWelcomeFlag = 0;
     
    2638    if(get_option('xyz_em_enableWelcomeEmail') == "True"){
    2739        if($xyz_em_statusWelcomeFlag == 1){
    28             $xyz_em_email = $wpdb->get_results( 'SELECT * FROM xyz_em_email_address WHERE id="'.$xyz_em_emailId.'" ') ;
    29             $xyz_em_email = $xyz_em_email[0];
    3040               
    3141            $xyz_em_template = $wpdb->get_results( 'SELECT * FROM xyz_em_email_template WHERE id="1" ') ;
     
    109119}
    110120
     121}else{
     122   
     123   
     124    if(strpos($xyz_em_url,'?') > 0)
     125        header("Location:".$xyz_em_url."&result=failure");
     126    else
     127        header("Location:".$xyz_em_url."?result=failure");
     128    exit();
     129}
     130
     131
    111132?>
  • newsletter-manager/trunk/download.php

    r526902 r533904  
    11<?php
    22require( dirname( __FILE__ ) . '../../../../wp-load.php' );
     3
     4if ( !current_user_can('manage_options') )
     5    die;
     6
    37
    48$listName = $_GET['fileName'];
  • newsletter-manager/trunk/newsletter-manager.php

    r531878 r533904  
    44Plugin URI: http://xyzscripts.com/wordpress-plugins/newsletter-manager/
    55Description: Create and send html or plain text email newsletters to your subscribers. The plugin supports unlimited email campaigns, unlimited email addresses,  double opt-in anti-spam compliance, hourly email sending limit and much more. Opt-in form is available as HTML code, shortcode as well as standard Wordpress widget. The import/export tool allows to create and restore backup of your subscriber list.       
    6 Version: 1.0.1
     6Version: 1.0.2
    77Author: xyzscripts.com
    88Author URI: http://xyzscripts.com/
  • newsletter-manager/trunk/readme.txt

    r530988 r533904  
    66Requires at least: 2.8
    77Tested up to: 3.3.1
    8 Stable tag: 1.0.1
     8Stable tag: 1.0.2
    99
    1010Create and send html or plain text email newsletters to your subscribers.
     
    127127== Changelog ==
    128128
     129= 1.0.2 =
     130* Option to search emails.
     131* Fix for tinymce <p> and <br> autoremoval.
     132
    129133= 1.0.1 =
    130134* Fix for utf-8 character issue.
     
    136140
    137141== Upgrade Notice ==
     142
     143= 1.0.2 =
     144If you had some issue with <p> and <br> tags in  tinymce editor, you must do this update. 
    138145
    139146= 1.0.1 =
  • newsletter-manager/trunk/shortcodes/htmlcode.php

    r530634 r533904  
    2424<tr>
    2525<td id="tdTop"  colspan="2">
    26 <span style="font-size:14px;"><b><?php echo get_option('xyz_em_widgetName')?></b></span>
     26<span style="font-size:14px;"><b><?php echo esc_html(get_option('xyz_em_widgetName'))?></b></span>
    2727</td>
    2828</tr>
  • newsletter-manager/trunk/subscription.php

    r530634 r533904  
    1010$_GET = stripslashes_deep($_GET);
    1111$_REQUEST = stripslashes_deep($_REQUEST);
     12$_POST = xyz_trim_deep($_POST);
     13$_GET = xyz_trim_deep($_GET);
     14$_REQUEST = xyz_trim_deep($_REQUEST);
    1215
    1316
     
    115118        $xyz_em_appendUrl = base64_encode($xyz_em_emailConfirmation);
    116119        $listId = 1;
    117         $xyz_em_confLink = plugins_url("newsletter-manager/confirmation.php?eId=".$xyz_em_emailLastId."&lId=".$listId."&appurl=".$xyz_em_appendUrl);
     120       
     121        $combine = $xyz_em_emailLastId.$listId.$xyz_em_email;
     122        $combineValue = md5($combine);
     123       
     124        $xyz_em_confLink = plugins_url("newsletter-manager/confirmation.php?eId=".$xyz_em_emailLastId."&lId=".$listId."&both=".$combineValue."&appurl=".$xyz_em_appendUrl);
    118125
    119126        $xyz_em_messageToSend = nl2br(str_replace($xyz_em_conf_link,$xyz_em_confLink,$xyz_em_emailTempalteMessage));
  • newsletter-manager/trunk/unsubscription.php

    r530634 r533904  
    88$_POST = stripslashes_deep($_POST);
    99$_GET = stripslashes_deep($_GET);
    10 $xyz_em_emailId = $_GET['eId'];
    11 $xyz_em_listId = $_GET['lId'];
     10$xyz_em_emailId = absint($_GET['eId']);
     11$xyz_em_listId = absint($_GET['lId']);
    1212$xyz_em_both = $_GET['both'];
    13 $xyz_em_campId = $_GET['campId'];
     13$xyz_em_campId = absint($_GET['campId']);
    1414
    1515$xyz_em_emailDetails = $wpdb->get_results( 'SELECT email FROM xyz_em_email_address WHERE id="'.$xyz_em_emailId.'" ') ;
  • newsletter-manager/trunk/widget.php

    r530634 r533904  
    1515    echo $before_widget;
    1616    echo $before_title;
    17     echo get_option('xyz_em_widgetName');
     17    echo esc_html(get_option('xyz_em_widgetName'));
    1818    echo $after_title;
    1919?> 
  • newsletter-manager/trunk/xyz-functions.php

    r530639 r533904  
    11<?php
    22
     3
     4if(!function_exists('xyz_trim_deep'))
     5{
     6
     7    function xyz_trim_deep($value) {
     8        if ( is_array($value) ) {
     9            $value = array_map('xyz_trim_deep', $value);
     10        } elseif ( is_object($value) ) {
     11            $vars = get_object_vars( $value );
     12            foreach ($vars as $key=>$data) {
     13                $value->{$key} = xyz_trim_deep( $data );
     14            }
     15        } else {
     16            $value = trim($value);
     17        }
     18
     19        return $value;
     20    }
     21
     22}
    323
    424
Note: See TracChangeset for help on using the changeset viewer.