Changeset c02bb9c in github
- Timestamp:
- Oct 7, 2008 3:27:29 AM (5 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 27a12ed
- Parents:
- 2727053
- File:
-
- 1 edited
-
program/include/rcube_shared.inc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_shared.inc
rf613a1e rc02bb9c 110 110 111 111 /** 112 * Returns whether an $str is a reserved word for any of the version of Javascript or ECMAScript 113 * @param str String to check 114 * @return boolean True if $str is a reserver word, False if not 115 */ 116 function is_js_reserved_word($str) 117 { 118 return in_array($str, array( 119 // ECMASript ver 4 reserved words 120 'as','break','case','catch','class','const','continue', 121 'default','delete','do','else','export','extends','false','finally','for','function', 122 'if','import','in','instanceof','is','namespace','new','null','package','private', 123 'public','return','super','switch','this','throw','true','try','typeof','use','var', 124 'void','while','with', 125 // ECMAScript ver 4 future reserved words 126 'abstract','debugger','enum','goto','implements','interface','native','protected', 127 'synchronized','throws','transient','volatile', 128 // special meaning in some contexts 129 'get','set', 130 // were reserved in ECMAScript ver 3 131 'boolean','byte','char','double','final','float','int','long','short','static' 132 )); 133 } 134 135 136 /** 112 137 * Convert a variable into a javascript object notation 113 138 * … … 146 171 { 147 172 // enclose key with quotes if it is not variable-name conform 148 if (!ereg("^[_a-zA-Z]{1}[_a-zA-Z0-9]*$", $key) /* || is_js_reserved_word($key) */)173 if (!ereg("^[_a-zA-Z]{1}[_a-zA-Z0-9]*$", $key) || is_js_reserved_word($key)) 149 174 $key = "'$key'"; 150 175 … … 163 188 164 189 } 190 165 191 166 192 /**
Note: See TracChangeset
for help on using the changeset viewer.
