diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-07 14:28:14 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-07 14:28:14 +0000 |
| commit | 9d42ec4ee5db0437e9ad14b793f044fa0f5de8fe (patch) | |
| tree | a0bb93e81f1856204377f936a97a8a285f77f2b7 /wp-inst/wp-includes/functions-formatting.php | |
| parent | 16cdc878fce216364bd57f498baeeb1b94ca8662 (diff) | |
WP Merge and new features
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@550 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/functions-formatting.php')
| -rw-r--r-- | wp-inst/wp-includes/functions-formatting.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/wp-inst/wp-includes/functions-formatting.php b/wp-inst/wp-includes/functions-formatting.php index 8b4f9da..5af4df5 100644 --- a/wp-inst/wp-includes/functions-formatting.php +++ b/wp-inst/wp-includes/functions-formatting.php @@ -278,7 +278,7 @@ function sanitize_user( $username, $strict = false ) { // If strict, reduce to ASCII for max portability. if ( $strict ) - $username = preg_replace('|[^a-z0-9 _.-@]|i', '', $username); + $username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username); return apply_filters('sanitize_user', $username, $raw_username, $strict); } @@ -404,9 +404,9 @@ function funky_javascript_fix($text) { Added Cleaning Hooks 1.0 First Version */ -function balanceTags($text, $is_comment = 0) { +function balanceTags($text, $is_comment = 0, $force = false) { - if ( get_option('use_balanceTags') == 0) + if ( !$force && get_option('use_balanceTags') == 0 ) return $text; $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = ''; @@ -1040,4 +1040,9 @@ function htmlentities2($myHTML) { return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($myHTML, $translation_table)); } +// Escape single quotes, specialchar double quotes, and fix line endings. +function js_escape($text) { + $text = wp_specialchars($text, 'double'); + return preg_replace("/\r?\n/", "\\n", addslashes($text)); +} ?> |
