Title: [Small bug fix] Save function
Last modified: August 20, 2016

---

# [Small bug fix] Save function

 *  [Juliette Reinders Folmer](https://wordpress.org/support/users/jrf/)
 * (@jrf)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/small-bugfix-save-function/)
 * Hiya,
 * Thanks for the plugin.
 * I found a small bug in the code. Please find my fix included. Also, it would 
   of course be good if some input validation was added to the save function….
 * File **includes/class-add-links-to-pages.php**
 * Find _**line 124**_:
 *     ```
       add_post_meta($post_id, "altp_links_html", htmlentities( $_POST['altp_links_html'] ), true); update_post_meta($post_id, "altp_links_html", htmlentities( $_POST['altp_links_html'] ));
       ```
   
 * _Replace with_:
 *     ```
       if( isset( $_POST['altp_links_html'] ) ) {
       		    if( add_post_meta($post_id, "altp_links_html", htmlentities( $_POST['altp_links_html'] ), true) === false ) {
       				update_post_meta($post_id, "altp_links_html", htmlentities( $_POST['altp_links_html'] ));
       			}
       		}
       ```
   
 * Hope this helps.
 * Smile,
    Juliette
 * [http://wordpress.org/extend/plugins/add-links-to-pages/](http://wordpress.org/extend/plugins/add-links-to-pages/)

The topic ‘[Small bug fix] Save function’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/add-links-to-pages.svg)
 * [Add Links to Pages](https://wordpress.org/plugins/add-links-to-pages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/add-links-to-pages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/add-links-to-pages/)
 * [Active Topics](https://wordpress.org/support/plugin/add-links-to-pages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/add-links-to-pages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/add-links-to-pages/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Juliette Reinders Folmer](https://wordpress.org/support/users/jrf/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/small-bugfix-save-function/)
 * Status: not resolved