Changeset 51 for trunk/lib/Utilities.inc.php
- Timestamp:
- Jan 9, 2006 11:22:24 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Utilities.inc.php
r50 r51 113 113 return $txt; /// FIXME. 114 114 115 $search = array();116 $replace = array();117 118 // "double quoted text" becomes “double quoted text”119 $search['double_quotes'] = '/(^|[^\w=])(?:"|"|"|"|“)([^"]+?)(?:"|"|"|"|”)([^\w]|$)/'; // " is the same as " and " and "120 $replace['double_quotes'] = '\\1“\\2”\\3';121 122 // text's apostrophes become text’s apostrophes123 $search['apostrophe'] = '/(\w)(?:\'|'|')(\w)/';124 $replace['apostrophe'] = '\\1’\\2';125 126 // 'single quoted text' becomes ‘single quoted text’127 $search['single_quotes'] = '/(^|[^\w=])(?:\'|'|‘)([^\']+?)(?:\'|'|’)([^\w]|$)/';128 $replace['single_quotes'] = '\\1‘\\2’\\3';129 130 // em--dashes become em—dashes131 $search['em_dash'] = '/(\s*[^!<-])--([^>-]\s*)/';132 $replace['em_dash'] = '\\1—\\2';133 134 return preg_replace($search, $replace, $txt);115 // $search = array(); 116 // $replace = array(); 117 // 118 // // "double quoted text" becomes “double quoted text” 119 // $search['double_quotes'] = '/(^|[^\w=])(?:"|"|"|"|“)([^"]+?)(?:"|"|"|"|”)([^\w]|$)/'; // " is the same as " and " and " 120 // $replace['double_quotes'] = '\\1“\\2”\\3'; 121 // 122 // // text's apostrophes become text’s apostrophes 123 // $search['apostrophe'] = '/(\w)(?:\'|'|')(\w)/'; 124 // $replace['apostrophe'] = '\\1’\\2'; 125 // 126 // // 'single quoted text' becomes ‘single quoted text’ 127 // $search['single_quotes'] = '/(^|[^\w=])(?:\'|'|‘)([^\']+?)(?:\'|'|’)([^\w]|$)/'; 128 // $replace['single_quotes'] = '\\1‘\\2’\\3'; 129 // 130 // // em--dashes become em—dashes 131 // $search['em_dash'] = '/(\s*[^!<-])--([^>-]\s*)/'; 132 // $replace['em_dash'] = '\\1—\\2'; 133 // 134 // return preg_replace($search, $replace, $txt); 135 135 } 136 136 … … 471 471 * If magic_quotes_gpc is in use, run stripslashes() on $var. If $var is an 472 472 * array, stripslashes is run on each value, recursivly, and the stripped 473 * array is returned 473 * array is returned. 474 474 * 475 475 * @param mixed $var The string or array to un-quote, if necessary. … … 518 518 } 519 519 if (isset($_POST[$var])) { 520 return trim(dispelMagicQuotes($_POST[$var]));520 return dispelMagicQuotes($_POST[$var]); 521 521 } else if (isset($_GET[$var])) { 522 return trim(dispelMagicQuotes($_GET[$var]));522 return dispelMagicQuotes($_GET[$var]); 523 523 } else { 524 524 return $default; … … 528 528 { 529 529 if (is_null($var)) { 530 return trim(dispelMagicQuotes($_POST));530 return dispelMagicQuotes($_POST); 531 531 } 532 532 if (isset($_POST[$var])) { 533 return trim(dispelMagicQuotes($_POST[$var]));533 return dispelMagicQuotes($_POST[$var]); 534 534 } else { 535 535 return $default; … … 539 539 { 540 540 if (is_null($var)) { 541 return trim(dispelMagicQuotes($_GET));541 return dispelMagicQuotes($_GET); 542 542 } 543 543 if (isset($_GET[$var])) { 544 return trim(dispelMagicQuotes($_GET[$var]));544 return dispelMagicQuotes($_GET[$var]); 545 545 } else { 546 546 return $default;
Note: See TracChangeset
for help on using the changeset viewer.