Changeset 885 for trunk/wp-includes/functions.php
- Timestamp:
- 02/17/2004 04:56:29 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r883 r885 265 265 266 266 function get_settings($setting) { 267 267 global $wpdb, $cache_settings, $use_cache; 268 268 if (strstr($_SERVER['REQUEST_URI'], 'install.php')) { 269 269 return false; 270 270 } 271 271 272 if ((empty($cache_settings)) OR (!$use_cache)) { 272 273 $settings = get_alloptions(); … … 275 276 $settings = $cache_settings; 276 277 } 277 if (!isset($settings->$setting)) { 278 return false; 279 } 280 281 return $settings->$setting;278 279 if (!isset($settings->$setting)) { 280 return false; 281 } else { 282 return stripslashes($settings->$setting); 282 283 } 283 284 } 284 285 285 286 function get_alloptions() { 286 global $tableoptions, $wpdb; 287 $options = $wpdb->get_results("SELECT option_name, option_value FROM $tableoptions"); 288 if ($options) { 289 foreach ($options as $option) { 290 $all_options->{$option->option_name} = $option->option_value; 291 } 292 } 293 return $all_options; 287 global $tableoptions, $wpdb; 288 $options = $wpdb->get_results("SELECT option_name, option_value FROM $tableoptions"); 289 if ($options) { 290 foreach ($options as $option) { 291 // "When trying to design a foolproof system, 292 // never underestimate the ingenuity of the fools :)" 293 if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value); 294 $all_options->{$option->option_name} = $option->option_value; 295 } 296 } 297 return $all_options; 294 298 } 295 299 … … 1462 1466 } 1463 1467 1468 function remove_slashes($string) { 1469 return stripslashes(stripslashes($string)); 1470 } 1471 1464 1472 ?>
Note: See TracChangeset
for help on using the changeset viewer.