Show
Ignore:
Timestamp:
08/31/08 05:31:07 (4 months ago)
Author:
ringmaster
Message:

Apply InputFilter::filter() to submitted content, and encode entities found in other fields.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/lockdown/trunk/lockdown.plugin.php

    r863 r864  
    105105        return false; 
    106106    } 
     107     
     108    /** 
     109     * Prevent certain published content from causing problems. 
     110     **/             
     111    function filter_post_content( $content ) 
     112    { 
     113        $newcontent = InputFilter::filter($content); 
     114        if($content != $newcontent) { 
     115            Session::notice('Certain content is filtered from posts to maintain the integrity of the demo.', 'lockdown_plugin'); 
     116        } 
     117        return $newcontent; 
     118    } 
     119     
     120    /** 
     121     * Filter title, slug, and tags fields for HTML content 
     122     **/         
     123    function action_publish_post( $post, $form ) 
     124    { 
     125        $post->title = htmlentities($post->title); 
     126        $post->slug = urlencode($post->slug); 
     127        $post->tags = htmlentities($form->tags); 
     128    } 
    107129 
    108130}