- Timestamp:
- May 13, 2008 4:14:53 AM (16 years ago)
- Location:
- trunk/lib
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/ACL.inc.php
r280 r334 21 21 var $_params = array( 22 22 23 // If false nothing will be cached or retr eived. Useful for testing realtime data requests.23 // If false nothing will be cached or retrieved. Useful for testing realtime data requests. 24 24 'enable_cache' => true, 25 25 … … 178 178 trigger_error(sprintf('Database table %s has invalid columns. Please update this table manually.', "{$a_o}_tbl"), E_USER_ERROR); 179 179 } else { 180 // Insert root node data if nonexist ant.180 // Insert root node data if nonexistent. 181 181 $qid = $db->query("SELECT 1 FROM {$a_o}_tbl WHERE name = 'root'"); 182 182 if (mysql_num_rows($qid) == 0) { … … 247 247 $qid = $db->query("SELECT rgt FROM $tbl WHERE name = '" . $db->escapeString($parent) . "'"); 248 248 if (!list($parent_rgt) = mysql_fetch_row($qid)) { 249 $app->logMsg(sprintf('Cannot add %s node to nonexist ant 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__); 250 250 return false; 251 251 } … … 325 325 $qid = $db->query("SELECT lft, rgt FROM $tbl WHERE name = '" . $db->escapeString($name) . "'"); 326 326 if (!list($lft, $rgt) = mysql_fetch_row($qid)) { 327 $app->logMsg(sprintf('Cannot delete nonexist ant %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__); 328 328 return false; 329 329 } … … 412 412 $qid = $db->query("SELECT lft, rgt FROM $tbl WHERE name = '" . $db->escapeString($name) . "'"); 413 413 if (!list($lft, $rgt) = mysql_fetch_row($qid)) { 414 $app->logMsg(sprintf('Cannot move nonexist ant %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__); 415 415 return false; 416 416 } … … 422 422 $qid = $db->query("SELECT rgt FROM $tbl WHERE name = '" . $db->escapeString($new_parent) . "'"); 423 423 if (!list($new_parent_rgt) = mysql_fetch_row($qid)) { 424 $app->logMsg(sprintf('Cannot move %s node to nonexist ant 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__); 425 425 return false; 426 426 } … … 661 661 if (!list($access) = mysql_fetch_row($qid)) { 662 662 $this->cache->set($cache_hash, 'deny'); 663 $app->logMsg(sprintf('Access den yed: %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__); 664 664 return false; 665 665 } … … 671 671 return true; 672 672 } else { 673 $app->logMsg(sprintf('Access den yed: %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__); 674 674 return false; 675 675 } -
trunk/lib/App.inc.php
r333 r334 417 417 * 418 418 * @access public 419 * @return array List of messag s in FIFO order.419 * @return array List of messages in FIFO order. 420 420 * @author Quinn Comendant <quinn@strangecode.com> 421 421 * @since 21 Dec 2005 13:09:20 … … 620 620 621 621 /** 622 * Forcefully set a query argument even if one currently exists in the req eust.622 * Forcefully set a query argument even if one currently exists in the request. 623 623 * Values in the _carry_queries array will be copied to URLs (via $app->url()) and 624 624 * to hidden input values (via printHiddenSession()). … … 762 762 // - sessions are enabled 763 763 // - the link stays on our site 764 // - transparent SID prop ogation 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) 765 765 // OR 766 766 // - 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) … … 799 799 * @access public 800 800 * @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;. 802 802 * @author Quinn Comendant <quinn@strangecode.com> 803 803 * @since 09 Dec 2005 17:58:45 … … 1069 1069 } 1070 1070 1071 // Time is the time stamp of a boomerangURL redirection, or setting of a boomerangURL.1071 // Time is the time stamp of a boomerangURL redirection, or setting of a boomerangURL. 1072 1072 // a boomerang redirection will always occur at least several seconds after the last boomerang redirect 1073 1073 // or a boomerang being set. -
trunk/lib/Auth_File.inc.php
r247 r334 308 308 309 309 /** 310 * Wrapper function for compat ability with lib/Lock.inc.php.310 * Wrapper function for compatibility with lib/Lock.inc.php. 311 311 * 312 312 * @param string $username Username to return. -
trunk/lib/Auth_SQL.inc.php
r277 r334 25 25 var $_authentication_tested; 26 26 27 // Param ters to be configured by setParam.27 // Parameters to be configured by setParam. 28 28 var $_params = array(); 29 29 var $_default_params = array( … … 70 70 'login_abuse_max_ips' => 5, 71 71 72 // The IP address subnet size threshold. Uses a CIDR notation network mask (see CIDR cheat sheet at bottom).73 // Any integ ar between 0 and 32 is permitted. Setting this to '24' permits any address in a72 // 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 74 74 // class C network (255.255.255.0) to be considered the same. Setting to '32' compares each IP absolutely. 75 75 // Setting to '0' ignores all IPs, thus disabling login_abuse checking. … … 753 753 * Returns a randomly generated password based on $pattern. The pattern is any 754 754 * sequence of 'x', 'V', 'C', 'v', 'c', or 'd' and if it is something like 'cvccv' this 755 * function will generate a pronounc able password. Recommend using more complex755 * function will generate a pronounceable password. Recommend using more complex 756 756 * patterns, at minimum the US State Department standard: cvcddcvc. 757 757 * 758 758 * - x a random upper or lower alpha character or digit 759 * - C a random upper or lower cons anant759 * - C a random upper or lower consonant 760 760 * - V a random upper or lower vowel 761 * - c a random lowercase cons anant761 * - c a random lowercase consonant 762 762 * - v a random lowercase vowel 763 763 * - d a random digit … … 794 794 795 795 // 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! 797 797 $more_salt = 'B36D18E5-3FE4-4D58-8150-F26642852B81'; 798 798 … … 860 860 "); 861 861 if (!list($old_encrypted_password) = mysql_fetch_row($qid)) { 862 $app->logMsg(sprintf('Cannot set password for nonexist ant 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__); 863 863 return false; 864 864 } … … 937 937 'USERNAME' => $user_data[$this->_params['db_username_column']], 938 938 'PASSWORD' => $password, 939 'REASON' => ('' == trim($reason) ? '' : trim($reason) . ' '), // Add a space after the reason if it exists for better f romatting.939 'REASON' => ('' == trim($reason) ? '' : trim($reason) . ' '), // Add a space after the reason if it exists for better formatting. 940 940 )); 941 941 $email->send(); … … 954 954 * NOTE: "user_type" used to be called "priv" in some older implementations. 955 955 * 956 * @param constant $security_zone string of comma delimited privil iges for the zone956 * @param constant $security_zone string of comma delimited privileges for the zone 957 957 * @param string $user_type a privilege that might be found in a zone 958 958 * @return bool true if user is a member of security zone, false otherwise … … 979 979 * NOTE: "user_type" used to be called "priv" in some older implementations. 980 980 * 981 * @param constant $security_zone string of comma delimited privil iges for the zone981 * @param constant $security_zone string of comma delimited privileges for the zone 982 982 */ 983 983 function requireAccessClearance($security_zone, $message='') -
trunk/lib/AuthorizeNet.inc.php
r327 r334 239 239 240 240 /** 241 * Tests a returned md5 hash value with a locally comput ated one.241 * Tests a returned md5 hash value with a locally computed one. 242 242 * 243 243 * @access public -
trunk/lib/Cache.inc.php
r316 r334 23 23 var $_params = array( 24 24 25 // If false nothing will be cached or retr eived. Useful for testing realtime data requests.25 // If false nothing will be cached or retrieved. Useful for testing realtime data requests. 26 26 'enabled' => true, 27 27 … … 117 117 118 118 /** 119 * Stores a new variable in the session cache. The $key should not be num beric119 * Stores a new variable in the session cache. The $key should not be numeric 120 120 * because the array_shift function will reset the key to the next largest 121 121 * int key. Weird behavior I can't understand. For example $cache["123"] will become $cache[0] … … 169 169 170 170 /** 171 * Retri ves an object from the session cache and returns it unserialized.171 * Retrieves an object from the session cache and returns it unserialized. 172 172 * It also moves it to the top of the stack, which makes it such that the 173 173 * cache flushing mechanism of putCache deletes the oldest referenced items -
trunk/lib/Currency.inc.php
r330 r334 123 123 )); 124 124 if (false === $value || !is_numeric($value)) { 125 // Failed retr eiving SOAP value. Use cached copy for now.125 // Failed retrieving SOAP value. Use cached copy for now. 126 126 $app->logMsg(sprintf('Failed getting SOAP currency exchange rates: %s-to-%s, using cached copy', $base, $target), LOG_NOTICE, __FILE__, __LINE__); 127 127 if (!$value = file_get_contents($cache_file_path)) { -
trunk/lib/DB.inc.php
r247 r334 148 148 $this->_connected = true; 149 149 150 // Tell MySQL what character set we're us eing. 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. 151 151 if ('' != $app->getParam('character_set') && isset($this->mysql_character_sets[mb_strtolower($app->getParam('character_set'))])) { 152 152 $this->query("/*!40101 SET NAMES '" . $this->mysql_character_sets[mb_strtolower($app->getParam('character_set'))] . "' */"); … … 284 284 * Loads a list of tables in the current database into an array, and returns 285 285 * true if the requested table is found. Use this function to enable/disable 286 * fun tionality based upon the current available db tables or to dynamically286 * functionality based upon the current available db tables or to dynamically 287 287 * create tables if missing. 288 288 * -
trunk/lib/Email.inc.php
r311 r334 68 68 function Email($params=null) 69 69 { 70 // The regex used in validEmail(). Set here instead of in the default _params above so we can use the concat ination . dot.70 // The regex used in validEmail(). Set here instead of in the default _params above so we can use the concatenation . dot. 71 71 // This matches an email address as complex as: 72 72 // Bob John-Smith <bob&smith's/dep=sales!@smith-wick.ca.us> (Sales department) … … 347 347 return true; 348 348 } else { 349 // To be valid email address must match regex and fit within the len th constraints.349 // To be valid email address must match regex and fit within the length constraints. 350 350 if (preg_match($this->getParam('regex'), $email, $e_parts) && mb_strlen($e_parts[2]) < 64 && mb_strlen($e_parts[3]) < 255) { 351 351 return true; -
trunk/lib/Google_API.inc.php
r326 r334 147 147 } 148 148 } 149 150 /**151 * getFault152 *153 * returns a simple native php array containing the fault data154 *155 * @return array156 * @access public157 */158 function getFault()159 {160 return $this->_soapClient->__getfault();161 }162 149 } 163 150 ?> -
trunk/lib/Hierarchy.inc.php
r201 r334 11 11 * data. You must provide identification of a piece of data (type and ID) to 12 12 * insert it into the hierarchy. The node hierarchy is completely 13 * separate from data storage and retr eival. You must separatly store the data13 * separate from data storage and retrieval. You must separately store the data 14 14 * using whatever logic is specific to the data then also call these functions. 15 15 * Nodes are not the data. The nodes are mere singularities in virtual space … … 123 123 124 124 /** 125 * Takes a sing lar node identifier and returns it as components of an array.125 * Takes a singular node identifier and returns it as components of an array. 126 126 * @param string $node 127 127 * @return mixed Array of node type and id on success, false on failure. … … 145 145 * @param string $parents A serialized array of serialized parent identifiers 146 146 * @param string $relationship_type 147 * @return bool true on suc ess, false on error.147 * @return bool true on success, false on error. 148 148 */ 149 149 function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='') … … 346 346 /** 347 347 * Returns an array of all the parents of the current node (just the ones 348 * immediat ly above this node). You may need to call array_unique if you348 * immediately above this node). You may need to call array_unique if you 349 349 * don't want duplicate nodes returned. 350 350 * … … 439 439 /** 440 440 * Returns an array of all the children of the current node (just the ones 441 * immediat ly below this node). You may need to call array_unique if you441 * immediately below this node). You may need to call array_unique if you 442 442 * don't want duplicate nodes returned. 443 443 * … … 598 598 * @param bool $go_linear ? 599 599 * @param int $_return_flag An internal value that counts up as 600 * recursion prog esses. When the value600 * recursion progresses. When the value 601 601 * drops back to 0, we return the output. 602 602 * @return array Array of serialized node identifiers. … … 756 756 } 757 757 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 recursiv ly.758 // If this node is not a leaf, we dive into it recursively. 759 759 $this->getNodeList($preselected, $my_children[$i]['child_type'], $my_children[$i]['child_id'], $type_constraint, $include_curr, $order, $_indent+1, false); 760 760 } … … 803 803 /** 804 804 * Used internally by setSubnodeQty to add the quantity of subnodes to 805 * all parents recursiv ly.805 * all parents recursively. 806 806 */ 807 807 function setSubnodeQtyToParents($child_type, $child_id, $num_children) -
trunk/lib/Image.inc.php
r136 r334 56 56 $src = $this->oSrc($id); 57 57 $filepath = preg_match('!://!', $src) ? $src : getenv('DOCUMENT_ROOT') . $src; 58 // Use exif_imagetype to check not only file exist ance but that of a valid image.58 // Use exif_imagetype to check not only file existence but that of a valid image. 59 59 return false != @exif_imagetype($filepath); 60 60 } -
trunk/lib/ImageThumb.inc.php
r331 r334 33 33 'dest_file_perms' => 0600, 34 34 35 // Permissions of auto created directories. Must be at least 0700 with owner=apache.35 // Permissions of auto-created directories. Must be at least 0700 with owner=apache. 36 36 'dest_dir_perms' => 0700, 37 37 … … 63 63 'dest_file_extension' => 'jpg', 64 64 65 // Type of scaling to perform, and sizes used to calculate max dimen tions.65 // Type of scaling to perform, and sizes used to calculate max dimensions. 66 66 'scaling_type' => IMAGETHUMB_FIT_LARGER, 67 67 'width' => null, … … 158 158 * @param array $spec The specifications for a size of output image. 159 159 * @param int $index The position of the specification in the spec array 160 * Use to overwrite existing spe varray values.160 * Use to overwrite existing spec array values. 161 161 */ 162 162 function setSpec($spec, $index=null) … … 229 229 230 230 /* 231 * Retr eive a value of a thumb specification.231 * Retrieve a value of a thumb specification. 232 232 * 233 233 * @access public 234 234 * @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 retr eive. 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. 236 236 * @return mixed Value of requested index. 237 237 * @author Quinn Comendant <quinn@strangecode.com> … … 297 297 $app =& App::getInstance(); 298 298 299 // Source file determin ted by provided file_name.299 // Source file determined by provided file_name. 300 300 $source_file = realpath(sprintf('%s/%s', $this->getParam('source_dir'), $file_name)); 301 301 … … 415 415 } 416 416 417 // If > 0, there was a problem thumb nailing.417 // If > 0, there was a problem thumb-nailing. 418 418 return 0 === $return_val; 419 419 } … … 508 508 list($source_image_width, $source_image_height, $source_image_type) = getimagesize($source_file); 509 509 510 // Define destination image dimen tions.510 // Define destination image dimensions. 511 511 switch ($spec['scaling_type']) { 512 512 case IMAGETHUMB_FIT_WIDTH : -
trunk/lib/Lock.inc.php
r235 r334 327 327 328 328 /** 329 * Delete 's all locks that are older than auto_timeout.329 * Deletes all locks that are older than auto_timeout. 330 330 */ 331 331 function _auto_timeout() -
trunk/lib/Navigation.inc.php
r324 r334 52 52 * @param string $title The title of the page. 53 53 * @param string $url The URL to the page. Set to null to use PHP_SELF. 54 * @param array $vars Addit oinal page variables.54 * @param array $vars Additional page variables. 55 55 */ 56 56 function add($title, $url=null, $vars=array()) … … 178 178 179 179 /** 180 * Returns the text path from root up to the current page, sep erated by the181 * path_delim eter.180 * Returns the text path from root up to the current page, separated by the 181 * path_delimiter. 182 182 * 183 183 * @access public -
trunk/lib/PEdit.inc.php
r332 r334 7 7 * which will be printed to the client browser under normal 8 8 * circumstances, but an authenticated user can 'edit' the document-- 9 * data stored in vars will be shown in html form elements to be edit ied9 * data stored in vars will be shown in html form elements to be edited 10 10 * and saved. Posted data is stored in XML format in a specified data dir. 11 11 * A copy of the previous version is saved with the unix … … 313 313 314 314 /** 315 * Prints the endi g </form> HTML tag, as well as buttons used during315 * Prints the ending </form> HTML tag, as well as buttons used during 316 316 * different operations. 317 317 * … … 409 409 410 410 /* 411 * Returns a secre at hash for the current file.411 * Returns a secret hash for the current file. 412 412 * 413 413 * @access public … … 693 693 // Ensure specified version exists. 694 694 if (!file_exists($version_file)) { 695 $app->logMsg(sprintf('Cannot restore non-exist ant file: %s', $version_file), LOG_NOTICE, __FILE__, __LINE__);695 $app->logMsg(sprintf('Cannot restore non-existent file: %s', $version_file), LOG_NOTICE, __FILE__, __LINE__); 696 696 return false; 697 697 } -
trunk/lib/PageNumbers.inc.php
r154 r334 152 152 } 153 153 154 // If the specified page exceed es 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. 155 155 if ($this->_per_page * $this->current_page >= $this->total_items + $this->_per_page || $this->_per_page * $this->current_page < 1) { 156 156 $this->current_page = 1; -
trunk/lib/PageSequence.inc.php
r141 r334 148 148 * Get the current step id. 149 149 * 150 * @return int $pos Actual step po isition150 * @return int $pos Actual step position 151 151 * @access public 152 152 */ … … 219 219 * uncompleted step. 220 220 * 221 * @return string Step identif yer of the next step.221 * @return string Step identifier of the next step. 222 222 * @access public 223 223 */ … … 240 240 /** 241 241 * To set a set as 'completed'. 242 * @return string Step identif yer of the next step.242 * @return string Step identifier of the next step. 243 243 * @access public 244 244 */ … … 273 273 * @param string $step_id ID of current step. 274 274 * @param mixed $step_data Data to place into session storage. 275 * @return string Step identif yer of the next step.275 * @return string Step identifier of the next step. 276 276 * @access public 277 277 */ … … 320 320 321 321 /** 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. 323 323 */ 324 324 function _auto_timeout() … … 361 361 } 362 362 363 /**364 * Template function to be extended with custom SQL code.365 *366 * @return int Unique DB identifyer for saved record.367 * @access public368 */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 public379 */380 function loadData()381 {382 return false;383 }384 385 386 363 } // END CLASS 387 364 -
trunk/lib/Prefs.inc.php
r331 r334 180 180 } 181 181 182 // Set a persistent p erference if...182 // Set a persistent preference if... 183 183 // - there isn't a default. 184 184 // - the new value is different than the default -
trunk/lib/SortOrder.inc.php
r321 r334 98 98 // (1) By GET or POST specification, if available. 99 99 // (2) By saved preference, if available. 100 // (3) By default (provided at class instan ciation).100 // (3) By default (provided at class instantiation). 101 101 $new_order = getFormData('order'); 102 102 if (!empty($new_order)) { -
trunk/lib/SpellCheck.inc.php
r275 r334 233 233 234 234 /** 235 * Returns an array of suggested words for each mis pelled word in the given text.235 * Returns an array of suggested words for each misspelled word in the given text. 236 236 * The first word of the returned array is the (possibly) misspelled word. 237 237 * … … 326 326 327 327 /** 328 * Prints the HTML for correcting all mis pellings found in the text of one $_FORM element.328 * Prints the HTML for correcting all misspellings found in the text of one $_FORM element. 329 329 * 330 330 * @access public -
trunk/lib/TemplateGlue.inc.php
r324 r334 57 57 /** 58 58 * 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 exist ance59 * Use this to generate a pull-down menu of options or to validate the existence 60 60 * of options. (Quinn 10 Feb 2001) 61 61 * … … 149 149 * @param array $preselected array of preselected values (matching the values in $db_col) 150 150 * @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 multidimen tional array.151 * @param int $flag set to 'allone' for name of input fields to all be the same of a multidimensional array. 152 152 * @param bool $sort Sort the output. 153 153 */ … … 171 171 } 172 172 173 // Retr eive values of a Set or ENUM database column.173 // Retrieve values of a Set or ENUM database column. 174 174 $values = getSetEnumFieldValues($db_table, $db_col, $sort); 175 175 … … 202 202 } 203 203 if ('allone' == $flag) { 204 // Print a cell with multidimen tioal array checkboxes.204 // Print a cell with multidimensional array checkboxes. 205 205 $html_name = 'dbcol[' . $db_col . '][' . $v . ']'; 206 206 } else { … … 249 249 } 250 250 251 // Retr eive values of a Set or ENUM database column.251 // Retrieve values of a Set or ENUM database column. 252 252 $values = getSetEnumFieldValues($db_table, $db_col, $sort); 253 253 … … 300 300 * @param string $preselected the currently selected value of the menu. compared to the $val_column 301 301 * @param bool $blank leave one blank at the top? 302 * @param string $extra_clause SQL exclude cl uase. Something like "WHERE girls != 'buckteeth'"302 * @param string $extra_clause SQL exclude clause. Something like "WHERE girls != 'buckteeth'" 303 303 */ 304 304 function printSelectForm($db_table, $key_column, $val_column, $preselected, $blank=false, $extra_clause='', $sql_format='SELECT %1$s, %2$s FROM %3$s %4$s') … … 463 463 ?><input type="submit" name="<?php echo oTxt($b['name']) ?>" value="<?php echo oTxt($b['value']); ?>" accesskey="<?php echo oTxt($b['accesskey']); ?>" /><?php 464 464 } else { 465 // For backwards compat ability.465 // For backwards compatibility. 466 466 ?><input type="submit" name="<?php echo oTxt($i) ?>" value="<?php echo oTxt($b); ?>" /><?php 467 467 } -
trunk/lib/Upload.inc.php
r303 r334 38 38 'dest_dir_perms' => 0700, 39 39 40 // Require file to have one of the following file name exten tions.40 // Require file to have one of the following file name extensions. 41 41 'valid_file_extensions' => array('jpg', 'jpeg', 'gif', 'png', 'pdf', 'txt', 'text', 'html', 'htm'), 42 42 ); … … 118 118 * @param string $form_name The name of the form to process. 119 119 * @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 occur ed preventing any file uploads.121 * Returns an empty array if any minor errors occur ed or no files were found.122 * Returns a multidimen tional 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. 123 123 * Note: this last option presents a problem in the case of when some files uploaded successfully, and some failed. 124 124 * In this case it is necessary to check the Upload::anyErrors method to discover if any did fail. … … 442 442 443 443 /** 444 * Determin tes if any errors occured while calling the Upload::process method.444 * Determines if any errors occurred while calling the Upload::process method. 445 445 * 446 446 * @access public … … 471 471 472 472 /** 473 * Returns the exten tion 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 exten tion 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. 477 477 * @return string The value found after the dot 478 478 */ -
trunk/lib/Utilities.inc.php
r331 r334 69 69 * 70 70 * @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. 74 73 * @return string Cleaned text. 75 74 */ … … 100 99 } 101 100 102 // & becomes &. Exclude any occur ance where the & is followed by a alphanum or unicode caracter.101 // & becomes &. Exclude any occurrence where the & is followed by a alphanum or unicode character. 103 102 $search['ampersand'] = '/&(?![\w\d#]{1,10};)/'; 104 103 $replace['ampersand'] = '&'; 105 104 106 return preg_replace($search, $replace, html entities($text, ENT_QUOTES, $app->getParam('character_set')));107 } 108 109 /** 110 * Returns text with stylistic modifications. Warning: this will break some HTML att ibutes!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! 111 110 * TODO: Allow a string such as this to be passed: <a href="javascript:openPopup('/foo/bar.php')">Click here</a> 112 111 * … … 143 142 144 143 /** 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. 146 145 * 147 146 * @param string $text Input text to search. … … 169 168 170 169 /** 171 * Generates a hexadeci bal html color based on provided word.170 * Generates a hexadecimal html color based on provided word. 172 171 * 173 172 * @access public … … 190 189 case 1 : 191 190 default : 192 // Reduce all hex values sligh ly to avoid all white.191 // Reduce all hex values slightly to avoid all white. 193 192 array_walk($rgb, create_function('&$v', '$v = dechex(round(hexdec($v) * 0.87));')); 194 193 break; … … 353 352 354 353 /** 355 * Tests the exist ance of a file anywhere in the include path.354 * Tests the existence of a file anywhere in the include path. 356 355 * 357 356 * @param string $file File in include path. … … 440 439 /** 441 440 * 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 av ilable.441 * Returns the final value of $var. Use to find a default value of one is not available. 443 442 * 444 443 * @param mixed $var The variable that is being set. … … 460 459 * 461 460 * @param array $array input array 462 * @param array $delim optional character that will also be e xcaped.461 * @param array $delim optional character that will also be escaped. 463 462 * @return array an array with the same values as $array1 but shuffled 464 463 */ … … 480 479 * Converts a PHP Array into encoded URL arguments and return them as an array. 481 480 * 482 * @param mixed $data An array to transverse recursiv ly, or a string481 * @param mixed $data An array to transverse recursively, or a string 483 482 * to use directly to create url arguments. 484 483 * @param string $prefix The name of the first dimension of the array. … … 494 493 if (is_array($data)) { 495 494 foreach ($data as $key => $val) { 496 // If the prefix is empty, use the $key as the name of the first dimen tion of the "array".497 // ...otherwise, append the key as a new dimen tion 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". 498 497 $new_prefix = ('' == $prefix) ? urlencode($key) : $prefix . '[' . urlencode($key) . ']'; 499 498 // Enter recursion. … … 501 500 } 502 501 } else { 503 // We've come to the last dimen tion 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. 504 503 $args[$prefix] = urlencode($data); 505 504 } … … 517 516 * Converts a PHP Array into encoded URL arguments and return them in a string. 518 517 * 519 * @param mixed $data An array to transverse recursiv ly, or a string518 * @param mixed $data An array to transverse recursively, or a string 520 519 * to use directly to create url arguments. 521 * @param string $prefix The name of the first dimen tion of the array.520 * @param string $prefix The name of the first dimension of the array. 522 521 * If not specified, the first keys of the array will be used. 523 522 * @return string url A string ready to append to a url. … … 537 536 538 537 /** 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 542 540 * 543 541 * @param mixed $pattern regular expression needle … … 661 659 /** 662 660 * If magic_quotes_gpc is in use, run stripslashes() on $var. If $var is an 663 * array, stripslashes is run on each value, recursiv ly, and the stripped661 * array, stripslashes is run on each value, recursively, and the stripped 664 662 * array is returned. 665 663 * … … 991 989 * 992 990 * @param bool $exclude_query Remove the query string first before comparing. 993 * @return bool True if the current URL is the same as the refer ing URL, false otherwise.991 * @return bool True if the current URL is the same as the referring URL, false otherwise. 994 992 */ 995 993 function refererIsMe($exclude_query=false)
Note: See TracChangeset
for help on using the changeset viewer.