| | 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 | } |