Ignore:
Timestamp:
Jan 9, 2006 11:22:24 AM (18 years ago)
Author:
scdev
Message:

${1}

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Utilities.inc.php

    r50 r51  
    113113    return $txt; /// FIXME.
    114114   
    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&mdash;\\2';
    133 
    134     return preg_replace($search, $replace, $txt);
     115//     $search = array();
     116//     $replace = array();
     117//
     118//     // "double quoted text"  becomes  &ldquo;double quoted text&rdquo;
     119//     $search['double_quotes']    = '/(^|[^\w=])(?:"|&quot;|&#34;|&#x22;|&ldquo;)([^"]+?)(?:"|&quot;|&#34;|&#x22;|&rdquo;)([^\w]|$)/'; // " is the same as &quot; and &#34; and &#x22;
     120//     $replace['double_quotes']   = '\\1&ldquo;\\2&rdquo;\\3';
     121//
     122//     // text's apostrophes  become  text&rsquo;s apostrophes
     123//     $search['apostrophe']       = '/(\w)(?:\'|&#39;|&#039;)(\w)/';
     124//     $replace['apostrophe']      = '\\1&rsquo;\\2';
     125//
     126//     // 'single quoted text'  becomes  &lsquo;single quoted text&rsquo;
     127//     $search['single_quotes']    = '/(^|[^\w=])(?:\'|&#39;|&lsquo;)([^\']+?)(?:\'|&#39;|&rsquo;)([^\w]|$)/';
     128//     $replace['single_quotes']   = '\\1&lsquo;\\2&rsquo;\\3';
     129//
     130//     // em--dashes  become em&mdash;dashes
     131//     $search['em_dash']          = '/(\s*[^!<-])--([^>-]\s*)/';
     132//     $replace['em_dash']         = '\\1&mdash;\\2';
     133//
     134//     return preg_replace($search, $replace, $txt);
    135135}
    136136
     
    471471 * If magic_quotes_gpc is in use, run stripslashes() on $var. If $var is an
    472472 * array, stripslashes is run on each value, recursivly, and the stripped
    473  * array is returned
     473 * array is returned.
    474474 *
    475475 * @param  mixed $var   The string or array to un-quote, if necessary.
     
    518518    }
    519519    if (isset($_POST[$var])) {
    520         return trim(dispelMagicQuotes($_POST[$var]));
     520        return dispelMagicQuotes($_POST[$var]);
    521521    } else if (isset($_GET[$var])) {
    522         return trim(dispelMagicQuotes($_GET[$var]));
     522        return dispelMagicQuotes($_GET[$var]);
    523523    } else {
    524524        return $default;
     
    528528{
    529529    if (is_null($var)) {
    530         return trim(dispelMagicQuotes($_POST));
     530        return dispelMagicQuotes($_POST);
    531531    }
    532532    if (isset($_POST[$var])) {
    533         return trim(dispelMagicQuotes($_POST[$var]));
     533        return dispelMagicQuotes($_POST[$var]);
    534534    } else {
    535535        return $default;
     
    539539{
    540540    if (is_null($var)) {
    541         return trim(dispelMagicQuotes($_GET));
     541        return dispelMagicQuotes($_GET);
    542542    }
    543543    if (isset($_GET[$var])) {
    544         return trim(dispelMagicQuotes($_GET[$var]));
     544        return dispelMagicQuotes($_GET[$var]);
    545545    } else {
    546546        return $default;
Note: See TracChangeset for help on using the changeset viewer.