Changeset 3469312
- Timestamp:
- 02/25/2026 10:20:27 AM (5 weeks ago)
- Location:
- pageapp
- Files:
-
- 36 added
- 4 edited
-
tags/1.4.9 (added)
-
tags/1.4.9/css (added)
-
tags/1.4.9/css/admin.css (added)
-
tags/1.4.9/images (added)
-
tags/1.4.9/images/pageapp20.png (added)
-
tags/1.4.9/inc (added)
-
tags/1.4.9/inc/cachelib.php (added)
-
tags/1.4.9/inc/httplib.php (added)
-
tags/1.4.9/inc/jsonlib.php (added)
-
tags/1.4.9/inc/pluginlib.php (added)
-
tags/1.4.9/inc/restlib.php (added)
-
tags/1.4.9/inc/settingslib.php (added)
-
tags/1.4.9/inc/utilslib.php (added)
-
tags/1.4.9/js (added)
-
tags/1.4.9/js/admin.js (added)
-
tags/1.4.9/pageapp-json.php (added)
-
tags/1.4.9/pageapp.php (added)
-
tags/1.4.9/readme.txt (added)
-
tags/1.5.0 (added)
-
tags/1.5.0/css (added)
-
tags/1.5.0/css/admin.css (added)
-
tags/1.5.0/images (added)
-
tags/1.5.0/images/pageapp20.png (added)
-
tags/1.5.0/inc (added)
-
tags/1.5.0/inc/cachelib.php (added)
-
tags/1.5.0/inc/httplib.php (added)
-
tags/1.5.0/inc/jsonlib.php (added)
-
tags/1.5.0/inc/pluginlib.php (added)
-
tags/1.5.0/inc/restlib.php (added)
-
tags/1.5.0/inc/settingslib.php (added)
-
tags/1.5.0/inc/utilslib.php (added)
-
tags/1.5.0/js (added)
-
tags/1.5.0/js/admin.js (added)
-
tags/1.5.0/pageapp-json.php (added)
-
tags/1.5.0/pageapp.php (added)
-
tags/1.5.0/readme.txt (added)
-
trunk/inc/cachelib.php (modified) (6 diffs)
-
trunk/inc/settingslib.php (modified) (1 diff)
-
trunk/pageapp.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pageapp/trunk/inc/cachelib.php
r3469278 r3469312 32 32 $option = $this->prefix.'version'; 33 33 $version = get_option($option); 34 $expiry = $this->expiry;34 $expiry = esc_sql($this->expiry); 35 35 if ($version != $plugin['Version']) { 36 36 global $wpdb; … … 54 54 global $wpdb; 55 55 $table = $this->table(); 56 $wpdb->query("DELETE FROM $table;"); 56 $query = $wpdb->prepare("DELETE FROM $table WHERE %d = %d;", 1, 1); 57 $wpdb->query($query); 57 58 } 58 59 } … … 62 63 global $wpdb; 63 64 $table = $this->table(); 64 $wpdb->query("DELETE FROM $table WHERE expires < NOW();"); 65 $query = $wpdb->prepare("DELETE FROM $table WHERE expires < DATE_ADD(NOW(), INTERVAL %d SECOND);", 0); 66 $wpdb->query($query); 65 67 } 66 68 } … … 69 71 global $wpdb; 70 72 $table = $this->table(); 71 $ name = esc_sql($name);72 $wpdb->query( "DELETE FROM $table WHERE name = '$name';");73 $query = $wpdb->prepare("DELETE FROM $table WHERE name = %s;", $name); 74 $wpdb->query($query); 73 75 } 74 76 } … … 77 79 global $wpdb; 78 80 $table = $this->table(); 79 $ name = esc_sql($name);80 return $wpdb->get_var( "SELECT data FROM $table WHERE name = '$name' AND expires > NOW();");81 $query = $wpdb->prepare("SELECT data FROM $table WHERE name = %s AND expires > NOW();", $name); 82 return $wpdb->get_var($query); 81 83 } 82 84 } … … 86 88 $table = $this->table(); 87 89 $expiry = esc_sql($expiry ? $expiry : $this->expiry); 88 $name = esc_sql($name); 89 $value = esc_sql($value); 90 $sql = "INSERT INTO $table (name, expires, data) 91 VALUES ('$name', DATE_ADD(NOW(), INTERVAL $expiry), '$value') 92 ON DUPLICATE KEY UPDATE data = '$value', expires = DATE_ADD(NOW(), INTERVAL $expiry) 93 ;"; 94 $wpdb->query($sql); 90 $query = $wpdb->prepare( 91 "INSERT INTO $table (name, expires, data) 92 VALUES (%s, DATE_ADD(NOW(), INTERVAL $expiry), %s) 93 ON DUPLICATE KEY UPDATE data = %s, expires = DATE_ADD(NOW(), INTERVAL $expiry) 94 ;", 95 $name, 96 $value, 97 $value 98 ); 99 $wpdb->query($query); 95 100 } 96 101 return $value; -
pageapp/trunk/inc/settingslib.php
r3469278 r3469312 98 98 public static function settings($setting) { 99 99 //TODO: add select 100 $allow = array( 101 'tr' => array( 102 'valign' => array(), 103 'class' => array() 104 ), 105 'th' => array( 106 'scope' => array() 107 ), 108 'td' => array(), 109 'div' => array( 110 'style' => array() 111 ), 112 'select' => array( 113 'id' => array(), 114 'name' => array() 115 ), 116 'input' => array( 117 'id' => array(), 118 'name' => array(), 119 'type' => array(), 120 'checked' => array(), 121 'value' => array(), 122 'style' => array(), 123 'placeholder' => array() 124 ), 125 'textarea' => array( 126 'id' => array(), 127 'name' => array(), 128 'rows' => array(), 129 'cols' => array() 130 ), 131 'option' => array( 132 'value' => array(), 133 'selected' => array() 134 ), 135 'label' => array( 136 'for' => array(), 137 'name' => array() 138 ) 139 ); 100 140 $setting = (object) $setting; 101 141 if ($setting->type == 'boolean') { 102 echo wp_kses(self::settings_checkbox($setting), array('tr', 'td', 'th', 'input', 'label'));142 echo wp_kses(self::settings_checkbox($setting), $allow); 103 143 } elseif ($setting->type == 'select') { 104 echo wp_kses(self::settings_select($setting), array('tr', 'td', 'th', 'select', 'option'));144 echo wp_kses(self::settings_select($setting), $allow); 105 145 } elseif ($setting->type == 'text') { 106 echo wp_kses(self::settings_text($setting), array('tr', 'td', 'th', 'textarea'));146 echo wp_kses(self::settings_text($setting), $allow); 107 147 } elseif ($setting->type == 'title') { 108 echo wp_kses(self::settings_row($setting), array('tr', 'td', 'th'));148 echo wp_kses(self::settings_row($setting), $allow); 109 149 } else { 110 echo wp_kses(self::settings_input($setting), array('tr', 'td', 'th', 'input'));150 echo wp_kses(self::settings_input($setting), $allow); 111 151 } 112 152 } -
pageapp/trunk/pageapp.php
r3469278 r3469312 4 4 Plugin URI: https://wordpress.org/plugins/pageapp/ 5 5 Description: Extensions to Wordpress wp-json for the PageApp API and mobile framework 6 Version: 1. 4.86 Version: 1.5.0 7 7 Author: PageApp 8 8 Author URI: https://www.thirteen.com/ -
pageapp/trunk/readme.txt
r3469278 r3469312 4 4 Requires at least: 4.0 5 5 Tested up to: 6.9.1 6 Stable tag: 1. 4.86 Stable tag: 1.5.0 7 7 License: MIT License 8 8 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=K6VKWB3HZB2T2&item_name=Donation%20to%20jameslow%2ecom¤cy_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8 … … 29 29 == Changelog == 30 30 31 = 1.5.0 = 32 * Fix displaying of options in settingslib 33 34 = 1.4.9 = 35 * Update cachelib to use wpdb::prepare 36 31 37 = 1.4.8 = 32 38 * Update/fixes for Wordpress best practices: … … 36 42 * Variables and options must be escaped when echo'd 37 43 * Allowing direct file access to plugin files 38 * TODO:Unsafe SQL calls44 * Unsafe SQL calls 39 45 * Plugin Check Report fixes: 40 46 * ERROR: trunk_stable_tag
Note: See TracChangeset
for help on using the changeset viewer.