Changeset 30 for tags/1.0.0/lib


Ignore:
Timestamp:
Dec 10, 2005 2:36:04 AM (19 years ago)
Author:
scdev
Message:

reverted some changes to make more compatible with old sites, using adm_ template nmes

Location:
tags/1.0.0/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/1.0.0/lib/App.inc.php

    r29 r30  
    352352    }
    353353
    354     $url = ohref($url, $carry_args, $always_include_sid);
     354    $url = url($url, $carry_args, $always_include_sid);
    355355   
    356356    header(sprintf('Location: %s', $url));
     
    459459 * @return string url with attached queries and, if not using cookies, the session id
    460460 */
    461 function oHREF($url='', $carry_args=null, $always_include_sid=false)
     461function url($url='', $carry_args=null, $always_include_sid=false)
    462462{
    463463    static $_using_trans_sid;
     
    509509    // Get the first delimiter that is needed in the url.
    510510    $delim = preg_match('/\?/', $url) ? ini_get('arg_separator.output') : '?';
    511    
     511
    512512    $q = '';
    513513    if ($do_carry_queries) {
     
    553553        $url .= $q . $delim . session_name() . '=' . session_id();
    554554//         logMsg(sprintf('oHREF appending session id to URL: %s', $url), LOG_DEBUG, __FILE__, __LINE__);
    555         return $url;
    556555    } else {
    557556        $url .= $q;
    558         return $url;
    559     }
     557    }
     558
     559    return $url;
     560}
     561
     562/**
     563 * Returns a URL processed with App::url and htmlentities for printing in html.
     564 *
     565 * @access  public
     566 * @param   string  $url    Input URL to parse.
     567 * @return  string          URL with App::url() and htmlentities() applied.
     568 * @author  Quinn Comendant <quinn@strangecode.com>
     569 * @since   09 Dec 2005 17:58:45
     570 */
     571function oHREF($url, $carry_args=null, $always_include_sid=false)
     572{
     573    $url = url($url, $carry_args, $always_include_sid);
     574    // Replace any & not followed by an html or unicode entity with it's &amp; equivalent.
     575    $url = preg_replace('/&(?![\w\d#]{1,10};)/', '&amp;', $url);
     576    return $url;
    560577}
    561578
  • tags/1.0.0/lib/Utilities.inc.php

    r29 r30  
    206206
    207207/**
     208 * Encodes an email into a user (at) domain (dot) com format.
     209 *
     210 * @access  public
     211 * @param   string   $email   An email to encode.
     212 * @param   string   $at      Replaces the @.
     213 * @param   string   $dot     Replaces the ..
     214 * @return  string   Encoded email.
     215 */
     216function encodeEmail($email, $at='-at-', $dot='-dot-')
     217{
     218    $search = array('/@/', '/\./');
     219    $replace = array($at, $dot);
     220    return preg_replace($search, $replace, $email);
     221}
     222
     223/**
    208224 * Return a human readable filesize.
    209225 *
Note: See TracChangeset for help on using the changeset viewer.