Changeset 375634
- Timestamp:
- 04/21/2011 02:17:28 PM (15 years ago)
- Location:
- wpmu-prefill-post/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
wpmu-prefill-post.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpmu-prefill-post/trunk/readme.txt
r363771 r375634 41 41 42 42 == Changelog == 43 = 1.02 = 44 Fix problem with mysql_real_escape_string 43 45 = 1.01 = 44 46 Fix "tinyMCE is not defined" bug -
wpmu-prefill-post/trunk/wpmu-prefill-post.php
r363771 r375634 5 5 Description: Add the ability to create post template. Work with wordpress and wordpress mu. Works with qtranslate. Inspirated from "Article Templates". Note : You need php 5.2+ 6 6 Author: Benjamin Santalucia (ben@woow-fr.com) 7 Version: 1.0 17 Version: 1.02 8 8 Author URI: http://wordpress.org/extend/plugins/profile/ido8p 9 9 */ … … 150 150 } 151 151 $table_name= $wpdb->prefix.self::DOMAIN; 152 return $wpdb->update($table_name, array('post_title' => mysql_real_escape_string($post_title),153 'post_content' => mysql_real_escape_string($post_content),154 'post_excerpt' => mysql_real_escape_string($post_excerpt)152 return $wpdb->update($table_name, array('post_title' => addslashes($post_title), 153 'post_content' => addslashes($post_content), 154 'post_excerpt' => addslashes($post_excerpt) 155 155 ), array('ID' => $id),array('%s','%s','%s'), '%d'); 156 156 … … 167 167 $table_name= $wpdb->prefix.self::DOMAIN; 168 168 restore_current_blog(); 169 if($wpdb->get_var( 'select id from $table_name where post_title ="'. mysql_real_escape_string($post_title).'"')) {169 if($wpdb->get_var( 'select id from $table_name where post_title ="'.addslashes($post_title).'"')) { 170 170 return false; 171 171 } … … 173 173 $table_name= $wpdb->prefix.self::DOMAIN; 174 174 175 return $wpdb->insert($table_name, array('post_title' => mysql_real_escape_string($post_title),176 'post_content' => mysql_real_escape_string($post_content),177 'post_excerpt' => mysql_real_escape_string($post_excerpt),175 return $wpdb->insert($table_name, array('post_title' => addslashes($post_title), 176 'post_content' => addslashes($post_content), 177 'post_excerpt' => addslashes($post_excerpt), 178 178 'post_author' => $user_ID 179 179 ), array('%s','%s','%s','%d')); … … 240 240 return; 241 241 } 242 tinyMCE.get('content').setContent(content .replace(/\n/g,"<br />"));242 tinyMCE.get('content').setContent(content/*.replace(/\n/g,"<br />")*/); 243 243 244 244 } else if(document.getElementById("content")) { … … 452 452 <h3 class="hndle"><span><?php _e('Content :',WPMUPrefillPost::DOMAIN); ?></span></h3> 453 453 <div class="inside"> 454 <?php the_editor(stripslashes( $content),"content"); ?>454 <?php the_editor(stripslashes(preg_replace(array('/\\\n+/','/\\\r+/'), array("",""),$content)),"content"); ?> 455 455 </div> 456 456 </div>
Note: See TracChangeset
for help on using the changeset viewer.