Changeset 334 for trunk/lib


Ignore:
Timestamp:
May 13, 2008 4:14:53 AM (16 years ago)
Author:
quinn
Message:

Fixed lots of misplings. I'm so embarrassed! ;P

Location:
trunk/lib
Files:
24 edited

Legend:

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

    r280 r334  
    2121    var $_params = array(
    2222       
    23         // If false nothing will be cached or retreived. Useful for testing realtime data requests.
     23        // If false nothing will be cached or retrieved. Useful for testing realtime data requests.
    2424        'enable_cache' => true,
    2525
     
    178178                    trigger_error(sprintf('Database table %s has invalid columns. Please update this table manually.', "{$a_o}_tbl"), E_USER_ERROR);
    179179                } else {
    180                     // Insert root node data if nonexistant.
     180                    // Insert root node data if nonexistent.
    181181                    $qid = $db->query("SELECT 1 FROM {$a_o}_tbl WHERE name = 'root'");
    182182                    if (mysql_num_rows($qid) == 0) {
     
    247247        $qid = $db->query("SELECT rgt FROM $tbl WHERE name = '" . $db->escapeString($parent) . "'");
    248248        if (!list($parent_rgt) = mysql_fetch_row($qid)) {
    249             $app->logMsg(sprintf('Cannot add %s node to nonexistant parent: %s', $type, $parent), LOG_WARNING, __FILE__, __LINE__);
     249            $app->logMsg(sprintf('Cannot add %s node to nonexistent parent: %s', $type, $parent), LOG_WARNING, __FILE__, __LINE__);
    250250            return false;
    251251        }
     
    325325        $qid = $db->query("SELECT lft, rgt FROM $tbl WHERE name = '" . $db->escapeString($name) . "'");
    326326        if (!list($lft, $rgt) = mysql_fetch_row($qid)) {
    327             $app->logMsg(sprintf('Cannot delete nonexistant %s name: %s', $type, $name), LOG_NOTICE, __FILE__, __LINE__);
     327            $app->logMsg(sprintf('Cannot delete nonexistent %s name: %s', $type, $name), LOG_NOTICE, __FILE__, __LINE__);
    328328            return false;
    329329        }
     
    412412        $qid = $db->query("SELECT lft, rgt FROM $tbl WHERE name = '" . $db->escapeString($name) . "'");
    413413        if (!list($lft, $rgt) = mysql_fetch_row($qid)) {
    414             $app->logMsg(sprintf('Cannot move nonexistant %s name: %s', $type, $name), LOG_NOTICE, __FILE__, __LINE__);
     414            $app->logMsg(sprintf('Cannot move nonexistent %s name: %s', $type, $name), LOG_NOTICE, __FILE__, __LINE__);
    415415            return false;
    416416        }
     
    422422        $qid = $db->query("SELECT rgt FROM $tbl WHERE name = '" . $db->escapeString($new_parent) . "'");
    423423        if (!list($new_parent_rgt) = mysql_fetch_row($qid)) {
    424             $app->logMsg(sprintf('Cannot move %s node to nonexistant parent: %s', $type, $new_parent), LOG_WARNING, __FILE__, __LINE__);
     424            $app->logMsg(sprintf('Cannot move %s node to nonexistent parent: %s', $type, $new_parent), LOG_WARNING, __FILE__, __LINE__);
    425425            return false;
    426426        }
     
    661661            if (!list($access) = mysql_fetch_row($qid)) {
    662662                $this->cache->set($cache_hash, 'deny');
    663                 $app->logMsg(sprintf('Access denyed: %s -> %s -> %s. No records found.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
     663                $app->logMsg(sprintf('Access denied: %s -> %s -> %s. No records found.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
    664664                return false;
    665665            }
     
    671671            return true;
    672672        } else {
    673             $app->logMsg(sprintf('Access denyed: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
     673            $app->logMsg(sprintf('Access denied: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
    674674            return false;
    675675        }
  • trunk/lib/App.inc.php

    r333 r334  
    417417     *
    418418     * @access  public
    419      * @return  array   List of messags in FIFO order.
     419     * @return  array   List of messages in FIFO order.
    420420     * @author  Quinn Comendant <quinn@strangecode.com>
    421421     * @since   21 Dec 2005 13:09:20
     
    620620
    621621    /**
    622      * Forcefully set a query argument even if one currently exists in the reqeust.
     622     * Forcefully set a query argument even if one currently exists in the request.
    623623     * Values in the _carry_queries array will be copied to URLs (via $app->url()) and
    624624     * to hidden input values (via printHiddenSession()).
     
    762762        // - sessions are enabled
    763763        // - the link stays on our site
    764         // - transparent SID propogation with session.use_trans_sid is not being used OR url begins with protocol (using_trans_sid has no effect here)
     764        // - transparent SID propagation with session.use_trans_sid is not being used OR url begins with protocol (using_trans_sid has no effect here)
    765765        // OR
    766766        // - we must include the SID because we say so (it's used in a context where cookies will not be effective, ie. moving from http to https)
     
    799799     * @access  public
    800800     * @param   string  $url    Input URL to parse.
    801      * @return  string          URL with $app->url() and htmlentities() applied.
     801     * @return  string          URL passed through $app->url() and then & turned to $amp;.
    802802     * @author  Quinn Comendant <quinn@strangecode.com>
    803803     * @since   09 Dec 2005 17:58:45
     
    10691069        }
    10701070
    1071         // Time is the timestamp of a boomerangURL redirection, or setting of a boomerangURL.
     1071        // Time is the time stamp of a boomerangURL redirection, or setting of a boomerangURL.
    10721072        // a boomerang redirection will always occur at least several seconds after the last boomerang redirect
    10731073        // or a boomerang being set.
  • trunk/lib/Auth_File.inc.php

    r247 r334  
    308308   
    309309    /**
    310      * Wrapper function for compatability with lib/Lock.inc.php.
     310     * Wrapper function for compatibility with lib/Lock.inc.php.
    311311     *
    312312     * @param  string  $username    Username to return.
  • trunk/lib/Auth_SQL.inc.php

    r277 r334  
    2525    var $_authentication_tested;
    2626
    27     // Paramters to be configured by setParam.
     27    // Parameters to be configured by setParam.
    2828    var $_params = array();
    2929    var $_default_params = array(
     
    7070        'login_abuse_max_ips' => 5,
    7171
    72         // The IP address subnet size threshold. Uses a CIDR notation network mask (see CIDR cheatsheet at bottom).
    73         // Any integar between 0 and 32 is permitted. Setting this to '24' permits any address in a
     72        // The IP address subnet size threshold. Uses a CIDR notation network mask (see CIDR cheat-sheet at bottom).
     73        // Any integer between 0 and 32 is permitted. Setting this to '24' permits any address in a
    7474        // class C network (255.255.255.0) to be considered the same. Setting to '32' compares each IP absolutely.
    7575        // Setting to '0' ignores all IPs, thus disabling login_abuse checking.
     
    753753     * Returns a randomly generated password based on $pattern. The pattern is any
    754754     * sequence of 'x', 'V', 'C', 'v', 'c', or 'd' and if it is something like 'cvccv' this
    755      * function will generate a pronouncable password. Recommend using more complex
     755     * function will generate a pronounceable password. Recommend using more complex
    756756     * patterns, at minimum the US State Department standard: cvcddcvc.
    757757     *
    758758     * - x    a random upper or lower alpha character or digit
    759      * - C    a random upper or lower consanant
     759     * - C    a random upper or lower consonant
    760760     * - V    a random upper or lower vowel
    761      * - c    a random lowercase consanant
     761     * - c    a random lowercase consonant
    762762     * - v    a random lowercase vowel
    763763     * - d    a random digit
     
    794794       
    795795        // Existing password hashes rely on the same key/salt being used to compare encryptions.
    796         // Don't change this unless you know existing hashes or signatures will not be affected!
     796        // Don't change this (or the value applied to signing_key) unless you know existing hashes or signatures will not be affected!
    797797        $more_salt = 'B36D18E5-3FE4-4D58-8150-F26642852B81';
    798798       
     
    860860        ");
    861861        if (!list($old_encrypted_password) = mysql_fetch_row($qid)) {
    862             $app->logMsg(sprintf('Cannot set password for nonexistant user_id %s', $user_id), LOG_NOTICE, __FILE__, __LINE__);
     862            $app->logMsg(sprintf('Cannot set password for nonexistent user_id %s', $user_id), LOG_NOTICE, __FILE__, __LINE__);
    863863            return false;
    864864        }
     
    937937                'USERNAME' => $user_data[$this->_params['db_username_column']],
    938938                'PASSWORD' => $password,
    939                 'REASON' => ('' == trim($reason) ? '' : trim($reason) . ' '), // Add a space after the reason if it exists for better fromatting.
     939                'REASON' => ('' == trim($reason) ? '' : trim($reason) . ' '), // Add a space after the reason if it exists for better formatting.
    940940            ));
    941941            $email->send();
     
    954954     * NOTE: "user_type" used to be called "priv" in some older implementations.
    955955     *
    956      * @param  constant $security_zone   string of comma delimited priviliges for the zone
     956     * @param  constant $security_zone   string of comma delimited privileges for the zone
    957957     * @param  string   $user_type       a privilege that might be found in a zone
    958958     * @return bool     true if user is a member of security zone, false otherwise
     
    979979     * NOTE: "user_type" used to be called "priv" in some older implementations.
    980980     *
    981      * @param  constant $security_zone   string of comma delimited priviliges for the zone
     981     * @param  constant $security_zone   string of comma delimited privileges for the zone
    982982     */
    983983    function requireAccessClearance($security_zone, $message='')
  • trunk/lib/AuthorizeNet.inc.php

    r327 r334  
    239239
    240240    /**
    241      * Tests a returned md5 hash value with a locally computated one.
     241     * Tests a returned md5 hash value with a locally computed one.
    242242     *
    243243     * @access public
  • trunk/lib/Cache.inc.php

    r316 r334  
    2323    var $_params = array(
    2424       
    25         // If false nothing will be cached or retreived. Useful for testing realtime data requests.
     25        // If false nothing will be cached or retrieved. Useful for testing realtime data requests.
    2626        'enabled' => true,
    2727
     
    117117
    118118    /**
    119      * Stores a new variable in the session cache. The $key should not be numberic
     119     * Stores a new variable in the session cache. The $key should not be numeric
    120120     * because the array_shift function will reset the key to the next largest
    121121     * int key. Weird behavior I can't understand. For example $cache["123"] will become $cache[0]
     
    169169
    170170    /**
    171      * Retrives an object from the session cache and returns it unserialized.
     171     * Retrieves an object from the session cache and returns it unserialized.
    172172     * It also moves it to the top of the stack, which makes it such that the
    173173     * cache flushing mechanism of putCache deletes the oldest referenced items
  • trunk/lib/Currency.inc.php

    r330 r334  
    123123            ));
    124124            if (false === $value || !is_numeric($value)) {
    125                 // Failed retreiving SOAP value. Use cached copy for now.
     125                // Failed retrieving SOAP value. Use cached copy for now.
    126126                $app->logMsg(sprintf('Failed getting SOAP currency exchange rates: %s-to-%s, using cached copy', $base, $target), LOG_NOTICE, __FILE__, __LINE__);
    127127                if (!$value = file_get_contents($cache_file_path)) {
  • trunk/lib/DB.inc.php

    r247 r334  
    148148        $this->_connected = true;
    149149
    150         // Tell MySQL what character set we're useing. Available only on MySQL verions > 4.01.01.
     150        // Tell MySQL what character set we're using. Available only on MySQL versions > 4.01.01.
    151151        if ('' != $app->getParam('character_set') && isset($this->mysql_character_sets[mb_strtolower($app->getParam('character_set'))])) {
    152152            $this->query("/*!40101 SET NAMES '" . $this->mysql_character_sets[mb_strtolower($app->getParam('character_set'))] . "' */");
     
    284284     * Loads a list of tables in the current database into an array, and returns
    285285     * true if the requested table is found. Use this function to enable/disable
    286      * funtionality based upon the current available db tables or to dynamically
     286     * functionality based upon the current available db tables or to dynamically
    287287     * create tables if missing.
    288288     *
  • trunk/lib/Email.inc.php

    r311 r334  
    6868    function Email($params=null)
    6969    {
    70         // The regex used in validEmail(). Set here instead of in the default _params above so we can use the concatination . dot.
     70        // The regex used in validEmail(). Set here instead of in the default _params above so we can use the concatenation . dot.
    7171        // This matches an email address as complex as:
    7272        //      Bob John-Smith <bob&smith's/dep=sales!@smith-wick.ca.us> (Sales department)
     
    347347            return true;
    348348        } else {
    349             // To be valid email address must match regex and fit within the lenth constraints.
     349            // To be valid email address must match regex and fit within the length constraints.
    350350            if (preg_match($this->getParam('regex'), $email, $e_parts) && mb_strlen($e_parts[2]) < 64 && mb_strlen($e_parts[3]) < 255) {
    351351                return true;
  • trunk/lib/Google_API.inc.php

    r326 r334  
    147147        }
    148148    }
    149 
    150     /**
    151      * getFault
    152      *
    153      * returns a simple native php array containing the fault data
    154      *
    155      * @return array
    156      * @access public
    157      */
    158     function getFault()
    159     {
    160         return $this->_soapClient->__getfault();
    161     }
    162149}
    163150?>
  • trunk/lib/Hierarchy.inc.php

    r201 r334  
    1111 * data. You must provide identification of a piece of data (type and ID) to
    1212 * insert it into the hierarchy. The node hierarchy is completely
    13  * separate from data storage and retreival. You must separatly store the data
     13 * separate from data storage and retrieval. You must separately store the data
    1414 * using whatever logic is specific to the data then also call these functions.
    1515 * Nodes are not the data. The nodes are mere singularities in virtual space
     
    123123
    124124    /**
    125      * Takes a singlar node identifier and returns it as components of an array.
     125     * Takes a singular node identifier and returns it as components of an array.
    126126     * @param string    $node
    127127     * @return mixed    Array of node type and id on success, false on failure.
     
    145145     * @param string    $parents    A serialized array of serialized parent identifiers
    146146     * @param string    $relationship_type
    147      * @return bool     true on sucess, false on error.
     147     * @return bool     true on success, false on error.
    148148     */
    149149    function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='')
     
    346346    /**
    347347     * Returns an array of all the parents of the current node (just the ones
    348      * immediatly above this node). You may need to call array_unique if you
     348     * immediately above this node). You may need to call array_unique if you
    349349     * don't want duplicate nodes returned.
    350350     *
     
    439439    /**
    440440     * Returns an array of all the children of the current node (just the ones
    441      * immediatly below this node). You may need to call array_unique if you
     441     * immediately below this node). You may need to call array_unique if you
    442442     * don't want duplicate nodes returned.
    443443     *
     
    598598     * @param  bool      $go_linear  ?
    599599     * @param  int       $_return_flag  An internal value that counts up as
    600      *                                  recursion progesses. When the value
     600     *                                  recursion progresses. When the value
    601601     *                                  drops back to 0, we return the output.
    602602     * @return array     Array of serialized node identifiers.
     
    756756                }
    757757                if (!$is_a_leaf[$this->toStringID($my_children[$i]['child_type'], $my_children[$i]['child_id'])]) {
    758                     // If this node is not a leaf, we dive into it recursivly.
     758                    // If this node is not a leaf, we dive into it recursively.
    759759                    $this->getNodeList($preselected, $my_children[$i]['child_type'], $my_children[$i]['child_id'], $type_constraint, $include_curr, $order, $_indent+1, false);
    760760                }
     
    803803    /**
    804804     * Used internally by setSubnodeQty to add the quantity of subnodes to
    805      * all parents recursivly.
     805     * all parents recursively.
    806806     */
    807807    function setSubnodeQtyToParents($child_type, $child_id, $num_children)
  • trunk/lib/Image.inc.php

    r136 r334  
    5656        $src = $this->oSrc($id);
    5757        $filepath = preg_match('!://!', $src) ? $src : getenv('DOCUMENT_ROOT') . $src;
    58         // Use exif_imagetype to check not only file existance but that of a valid image.
     58        // Use exif_imagetype to check not only file existence but that of a valid image.
    5959        return false != @exif_imagetype($filepath);
    6060    }
  • trunk/lib/ImageThumb.inc.php

    r331 r334  
    3333        'dest_file_perms' => 0600,
    3434
    35         // Permissions of autocreated directories. Must be at least 0700 with owner=apache.
     35        // Permissions of auto-created directories. Must be at least 0700 with owner=apache.
    3636        'dest_dir_perms' => 0700,
    3737
     
    6363        'dest_file_extension' => 'jpg',
    6464       
    65         // Type of scaling to perform, and sizes used to calculate max dimentions.
     65        // Type of scaling to perform, and sizes used to calculate max dimensions.
    6666        'scaling_type' => IMAGETHUMB_FIT_LARGER,
    6767        'width' => null,
     
    158158     * @param   array   $spec   The specifications for a size of output image.
    159159     * @param   int     $index  The position of the specification in the spec array
    160      *                          Use to overwrite existing spev array values.
     160     *                          Use to overwrite existing spec array values.
    161161     */
    162162    function setSpec($spec, $index=null)
     
    229229   
    230230    /*
    231     * Retreive a value of a thumb specification.
     231    * Retrieve a value of a thumb specification.
    232232    *
    233233    * @access   public
    234234    * @param    string  $key    Key to return. See _default_image_specs above for a list.
    235     * @param    int     $index  The index in the spec array of the value to retreive. The first if not specified.
     235    * @param    int     $index  The index in the spec array of the value to retrieve. The first if not specified.
    236236    * @return   mixed           Value of requested index.
    237237    * @author   Quinn Comendant <quinn@strangecode.com>
     
    297297        $app =& App::getInstance();
    298298
    299         // Source file determinted by provided file_name.
     299        // Source file determined by provided file_name.
    300300        $source_file = realpath(sprintf('%s/%s', $this->getParam('source_dir'), $file_name));
    301301       
     
    415415        }
    416416
    417         // If > 0, there was a problem thumbnailing.
     417        // If > 0, there was a problem thumb-nailing.
    418418        return 0 === $return_val;
    419419    }
     
    508508        list($source_image_width, $source_image_height, $source_image_type) = getimagesize($source_file);
    509509
    510         // Define destination image dimentions.
     510        // Define destination image dimensions.
    511511        switch ($spec['scaling_type']) {
    512512        case IMAGETHUMB_FIT_WIDTH :
  • trunk/lib/Lock.inc.php

    r235 r334  
    327327
    328328    /**
    329      * Delete's all locks that are older than auto_timeout.
     329     * Deletes all locks that are older than auto_timeout.
    330330     */
    331331    function _auto_timeout()
  • trunk/lib/Navigation.inc.php

    r324 r334  
    5252     * @param   string  $title      The title of the page.
    5353     * @param   string  $url        The URL to the page. Set to null to use PHP_SELF.
    54      * @param   array   $vars       Additoinal page variables.
     54     * @param   array   $vars       Additional page variables.
    5555     */
    5656    function add($title, $url=null, $vars=array())
     
    178178
    179179    /**
    180      * Returns the text path from root up to the current page, seperated by the
    181      * path_delimeter.
     180     * Returns the text path from root up to the current page, separated by the
     181     * path_delimiter.
    182182     *
    183183     * @access  public
  • trunk/lib/PEdit.inc.php

    r332 r334  
    77 * which will be printed to the client browser under normal
    88 * circumstances, but an authenticated user can 'edit' the document--
    9  * data stored in vars will be shown in html form elements to be editied
     9 * data stored in vars will be shown in html form elements to be edited
    1010 * and saved. Posted data is stored in XML format in a specified data dir.
    1111 * A copy of the previous version is saved with the unix
     
    313313
    314314    /**
    315      * Prints the endig </form> HTML tag, as well as buttons used during
     315     * Prints the ending </form> HTML tag, as well as buttons used during
    316316     * different operations.
    317317     *
     
    409409
    410410    /*
    411     * Returns a secreat hash for the current file.
     411    * Returns a secret hash for the current file.
    412412    *
    413413    * @access   public
     
    693693        // Ensure specified version exists.
    694694        if (!file_exists($version_file)) {
    695             $app->logMsg(sprintf('Cannot restore non-existant file: %s', $version_file), LOG_NOTICE, __FILE__, __LINE__);
     695            $app->logMsg(sprintf('Cannot restore non-existent file: %s', $version_file), LOG_NOTICE, __FILE__, __LINE__);
    696696            return false;
    697697        }
  • trunk/lib/PageNumbers.inc.php

    r154 r334  
    152152        }
    153153
    154         // If the specified page exceedes total pages or is less than 1, set the page to 1.
     154        // If the specified page exceeds total pages or is less than 1, set the page to 1.
    155155        if ($this->_per_page * $this->current_page >= $this->total_items + $this->_per_page || $this->_per_page * $this->current_page < 1) {
    156156            $this->current_page = 1;
  • trunk/lib/PageSequence.inc.php

    r141 r334  
    148148     * Get the current step id.
    149149     *
    150      * @return int $pos    Actual step poisition
     150     * @return int $pos    Actual step position
    151151     * @access public
    152152     */
     
    219219     * uncompleted step.
    220220     *
    221      * @return string  Step identifyer of the next step.
     221     * @return string  Step identifier of the next step.
    222222     * @access public
    223223     */
     
    240240    /**
    241241     * To set a set as 'completed'.
    242      * @return string  Step identifyer of the next step.
     242     * @return string  Step identifier of the next step.
    243243     * @access public
    244244     */
     
    273273     * @param  string $step_id   ID of current step.
    274274     * @param  mixed  $step_data Data to place into session storage.
    275      * @return string  Step identifyer of the next step.
     275     * @return string  Step identifier of the next step.
    276276     * @access public
    277277     */
     
    320320
    321321    /**
    322      * Delete's all data that are older than auto_timeout. Set current time if not not expired or not set.
     322     * Deletes all data that are older than auto_timeout. Set current time if not not expired or not set.
    323323     */
    324324    function _auto_timeout()
     
    361361    }
    362362
    363     /**
    364      * Template function to be extended with custom SQL code.
    365      *
    366      * @return int  Unique DB identifyer for saved record.
    367      * @access public
    368      */
    369     function saveData()
    370     {
    371         return false;
    372     }
    373 
    374     /**
    375      * Template function to be extended with custom SQL code.
    376      *
    377      * @return mixed  Data stored in DB.
    378      * @access public
    379      */
    380     function loadData()
    381     {
    382         return false;
    383     }
    384 
    385 
    386363} // END CLASS
    387364
  • trunk/lib/Prefs.inc.php

    r331 r334  
    180180        }
    181181       
    182         // Set a persistent perference if...
     182        // Set a persistent preference if...
    183183        // - there isn't a default.
    184184        // - the new value is different than the default
  • trunk/lib/SortOrder.inc.php

    r321 r334  
    9898        // (1) By GET or POST specification, if available.
    9999        // (2) By saved preference, if available.
    100         // (3) By default (provided at class instanciation).
     100        // (3) By default (provided at class instantiation).
    101101        $new_order = getFormData('order');
    102102        if (!empty($new_order)) {
  • trunk/lib/SpellCheck.inc.php

    r275 r334  
    233233
    234234    /**
    235      * Returns an array of suggested words for each mispelled word in the given text.
     235     * Returns an array of suggested words for each misspelled word in the given text.
    236236     * The first word of the returned array is the (possibly) misspelled word.
    237237     *
     
    326326
    327327    /**
    328      * Prints the HTML for correcting all mispellings found in the text of one $_FORM element.
     328     * Prints the HTML for correcting all misspellings found in the text of one $_FORM element.
    329329     *
    330330     * @access  public
  • trunk/lib/TemplateGlue.inc.php

    r324 r334  
    5757/**
    5858 * Finds the values of an enumeration or set column of a MySQL database, returning them in an array.
    59  * Use this to generate a pull-down menu of options or to validate the existance
     59 * Use this to generate a pull-down menu of options or to validate the existence
    6060 * of options. (Quinn 10 Feb 2001)
    6161 *
     
    149149 * @param  array  $preselected   array of preselected values (matching the values in $db_col)
    150150 * @param  int    $columns       number of table columns to print
    151  * @param  int    $flag          set to 'allone' for name of input fields to all be the same of a multidimentional array.
     151 * @param  int    $flag          set to 'allone' for name of input fields to all be the same of a multidimensional array.
    152152 * @param  bool   $sort          Sort the output.
    153153 */
     
    171171    }
    172172
    173     // Retreive values of a Set or ENUM database column.
     173    // Retrieve values of a Set or ENUM database column.
    174174    $values = getSetEnumFieldValues($db_table, $db_col, $sort);
    175175
     
    202202        }
    203203        if ('allone' == $flag) {
    204             // Print a cell with multidimentioal array checkboxes.
     204            // Print a cell with multidimensional array checkboxes.
    205205            $html_name = 'dbcol[' . $db_col . '][' . $v . ']';
    206206        } else {
     
    249249    }
    250250
    251     // Retreive values of a Set or ENUM database column.
     251    // Retrieve values of a Set or ENUM database column.
    252252    $values = getSetEnumFieldValues($db_table, $db_col, $sort);
    253253
     
    300300 * @param  string $preselected      the currently selected value of the menu. compared to the $val_column
    301301 * @param  bool   $blank            leave one blank at the top?
    302  * @param  string $extra_clause     SQL exclude cluase. Something like "WHERE girls != 'buckteeth'"
     302 * @param  string $extra_clause     SQL exclude clause. Something like "WHERE girls != 'buckteeth'"
    303303 */
    304304function printSelectForm($db_table, $key_column, $val_column, $preselected, $blank=false, $extra_clause='', $sql_format='SELECT %1$s, %2$s FROM %3$s %4$s')
     
    463463                ?><input type="submit" name="<?php echo oTxt($b['name']) ?>" value="<?php echo oTxt($b['value']); ?>" accesskey="<?php echo oTxt($b['accesskey']); ?>" /><?php
    464464            } else {
    465                 // For backwards compatability.
     465                // For backwards compatibility.
    466466                ?><input type="submit" name="<?php echo oTxt($i) ?>" value="<?php echo oTxt($b); ?>" /><?php
    467467            }
  • trunk/lib/Upload.inc.php

    r303 r334  
    3838        'dest_dir_perms' => 0700,
    3939
    40         // Require file to have one of the following file name extentions.
     40        // Require file to have one of the following file name extensions.
    4141        'valid_file_extensions' => array('jpg', 'jpeg', 'gif', 'png', 'pdf', 'txt', 'text', 'html', 'htm'),
    4242    );
     
    118118     * @param   string  $form_name          The name of the form to process.
    119119     * @param   string  $custom_file_name   The new name of the file. An array of filenames in the case of multiple files.
    120      * @return  mixed   Returns FALSE if a major error occured preventing any file uploads.
    121      *                  Returns an empty array if any minor errors occured or no files were found.
    122      *                  Returns a multidimentional array of filenames, sizes and extentions, if one-or-more files succeeded uploading.
     120     * @return  mixed   Returns FALSE if a major error occurred preventing any file uploads.
     121     *                  Returns an empty array if any minor errors occurred or no files were found.
     122     *                  Returns a multidimensional array of filenames, sizes and extensions, if one-or-more files succeeded uploading.
    123123     *                  Note: this last option presents a problem in the case of when some files uploaded successfully, and some failed.
    124124     *                        In this case it is necessary to check the Upload::anyErrors method to discover if any did fail.
     
    442442
    443443    /**
    444      * Determintes if any errors occured while calling the Upload::process method.
     444     * Determines if any errors occurred while calling the Upload::process method.
    445445     *
    446446     * @access  public
     
    471471
    472472    /**
    473      * Returns the extention of a file name, or an empty string if non exists.
    474      *
    475      * @access  public
    476      * @param   string  $file_name  A name of a file, with extention after a dot.
     473     * Returns the extension of a file name, or an empty string if non exists.
     474     *
     475     * @access  public
     476     * @param   string  $file_name  A name of a file, with extension after a dot.
    477477     * @return  string              The value found after the dot
    478478     */
  • trunk/lib/Utilities.inc.php

    r331 r334  
    6969 *
    7070 * @param  string $text             Text to clean.
    71  * @param  bool   $preserve_html    If set to true, oTxt will not translage <, >, ", or '
    72  *                                  characters into HTML entities. This allows HTML to pass
    73  *                                  through unmunged.
     71 * @param  bool   $preserve_html    If set to true, oTxt will not translate <, >, ", or '
     72 *                                  characters into HTML entities. This allows HTML to pass through unmunged.
    7473 * @return string                   Cleaned text.
    7574 */
     
    10099    }
    101100
    102     // & becomes &amp;. Exclude any occurance where the & is followed by a alphanum or unicode caracter.
     101    // & becomes &amp;. Exclude any occurrence where the & is followed by a alphanum or unicode character.
    103102    $search['ampersand']        = '/&(?![\w\d#]{1,10};)/';
    104103    $replace['ampersand']       = '&amp;';
    105104
    106     return preg_replace($search, $replace, htmlentities($text, ENT_QUOTES, $app->getParam('character_set')));
    107 }
    108 
    109 /**
    110  * Returns text with stylistic modifications. Warning: this will break some HTML attibutes!
     105    return preg_replace($search, $replace, htmlspecialchars($text, ENT_QUOTES, $app->getParam('character_set')));
     106}
     107
     108/**
     109 * Returns text with stylistic modifications. Warning: this will break some HTML attributes!
    111110 * TODO: Allow a string such as this to be passed: <a href="javascript:openPopup('/foo/bar.php')">Click here</a>
    112111 *
     
    143142
    144143/**
    145  * Applies a class to search terms to highlight them ala-google results.
     144 * Applies a class to search terms to highlight them ala google results.
    146145 *
    147146 * @param  string   $text   Input text to search.
     
    169168
    170169/**
    171  * Generates a hexadecibal html color based on provided word.
     170 * Generates a hexadecimal html color based on provided word.
    172171 *
    173172 * @access public
     
    190189    case 1 :
    191190    default :
    192         // Reduce all hex values slighly to avoid all white.
     191        // Reduce all hex values slightly to avoid all white.
    193192        array_walk($rgb, create_function('&$v', '$v = dechex(round(hexdec($v) * 0.87));'));
    194193        break;
     
    353352
    354353/**
    355  * Tests the existance of a file anywhere in the include path.
     354 * Tests the existence of a file anywhere in the include path.
    356355 *
    357356 * @param   string  $file   File in include path.
     
    440439/**
    441440 * If $var is net set or null, set it to $default. Otherwise leave it alone.
    442  * Returns the final value of $var. Use to find a default value of one is not avilable.
     441 * Returns the final value of $var. Use to find a default value of one is not available.
    443442 *
    444443 * @param  mixed $var       The variable that is being set.
     
    460459 *
    461460 * @param  array $array    input array
    462  * @param  array $delim    optional character that will also be excaped.
     461 * @param  array $delim    optional character that will also be escaped.
    463462 * @return array    an array with the same values as $array1 but shuffled
    464463 */
     
    480479 * Converts a PHP Array into encoded URL arguments and return them as an array.
    481480 *
    482  * @param  mixed $data        An array to transverse recursivly, or a string
     481 * @param  mixed $data        An array to transverse recursively, or a string
    483482 *                            to use directly to create url arguments.
    484483 * @param  string $prefix     The name of the first dimension of the array.
     
    494493    if (is_array($data)) {
    495494        foreach ($data as $key => $val) {
    496             // If the prefix is empty, use the $key as the name of the first dimention of the "array".
    497             // ...otherwise, append the key as a new dimention of the "array".
     495            // If the prefix is empty, use the $key as the name of the first dimension of the "array".
     496            // ...otherwise, append the key as a new dimension of the "array".
    498497            $new_prefix = ('' == $prefix) ? urlencode($key) : $prefix . '[' . urlencode($key) . ']';
    499498            // Enter recursion.
     
    501500        }
    502501    } else {
    503         // We've come to the last dimention of the array, save the "array" and its value.
     502        // We've come to the last dimension of the array, save the "array" and its value.
    504503        $args[$prefix] = urlencode($data);
    505504    }
     
    517516 * Converts a PHP Array into encoded URL arguments and return them in a string.
    518517 *
    519  * @param  mixed $data        An array to transverse recursivly, or a string
     518 * @param  mixed $data        An array to transverse recursively, or a string
    520519 *                            to use directly to create url arguments.
    521  * @param  string $prefix     The name of the first dimention of the array.
     520 * @param  string $prefix     The name of the first dimension of the array.
    522521 *                            If not specified, the first keys of the array will be used.
    523522 * @return string url         A string ready to append to a url.
     
    537536
    538537/**
    539  * Fills an arrray with the result from a multiple ereg search.
    540  * Curtesy of Bruno - rbronosky@mac.com - 10-May-2001
    541  * Blame him for the funky do...while loop.
     538 * Fills an array with the result from a multiple ereg search.
     539 * Courtesy of Bruno - rbronosky@mac.com - 10-May-2001
    542540 *
    543541 * @param  mixed $pattern   regular expression needle
     
    661659/**
    662660 * If magic_quotes_gpc is in use, run stripslashes() on $var. If $var is an
    663  * array, stripslashes is run on each value, recursivly, and the stripped
     661 * array, stripslashes is run on each value, recursively, and the stripped
    664662 * array is returned.
    665663 *
     
    991989 *
    992990 * @param  bool $exclude_query  Remove the query string first before comparing.
    993  * @return bool                 True if the current URL is the same as the refering URL, false otherwise.
     991 * @return bool                 True if the current URL is the same as the referring URL, false otherwise.
    994992 */
    995993function refererIsMe($exclude_query=false)
Note: See TracChangeset for help on using the changeset viewer.