Changeset 5928 for trunk/phpgwapi
- Timestamp:
- 04/12/12 11:15:33 (12 years ago)
- Location:
- trunk/phpgwapi/inc
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpgwapi/inc/class.clientsniffer.inc.php
r5912 r5928 76 76 77 77 // Determine NAME Name and Version 78 if ( eregi( 'MSIE ([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) ||79 eregi( 'Microsoft Internet Explorer ([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) )78 if ( preg_match( '/MSIE ([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) || 79 preg_match( '/Microsoft Internet Explorer ([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) ) 80 80 { 81 81 $this->VERSION = $info[1]; 82 82 $this->NAME = 'IE'; 83 83 } 84 elseif ( eregi( 'Opera ([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) ||85 eregi( 'Opera/([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) )84 elseif ( preg_match( '/Opera ([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) || 85 preg_match( '/Opera\/([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) ) 86 86 { 87 87 $this->VERSION = $info[1]; 88 88 $this->NAME = 'Opera'; 89 89 } 90 elseif ( eregi( 'iCab ([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) ||91 eregi( 'iCab/([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) )90 elseif ( preg_match( '/iCab ([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) || 91 preg_match( '/iCab\/([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) ) 92 92 { 93 93 $this->VERSION = $info[1]; 94 94 $this->NAME = 'iCab'; 95 95 } 96 elseif ( eregi( 'Netscape6/([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) )96 elseif ( preg_match( '/Netscape6\/([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) ) 97 97 { 98 98 $this->VERSION = $info[1]; 99 99 $this->NAME = 'Netscape'; 100 100 } 101 elseif ( eregi( 'Mozilla/([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) )101 elseif ( preg_match( '/Mozilla\/([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) ) 102 102 { 103 103 $this->VERSION = $info[1]; … … 111 111 112 112 // Determine if AOL or WEBTV 113 if( eregi( 'aol',$this->UA,$info))113 if( preg_match( '/aol/i',$this->UA,$info)) 114 114 { 115 115 $this->AOL = true; 116 116 } 117 elseif( eregi( 'webtv',$this->UA,$info))117 elseif( preg_match( '/webtv/i',$this->UA,$info)) 118 118 { 119 119 $this->WEBTV = true; … … 138 138 139 139 // Check for Windows 16-bit 140 if( eregi('Win16',$this->UA) ||141 eregi('windows 3.1',$this->UA) ||142 eregi('windows 16-bit',$this->UA) ||143 eregi('16bit',$this->UA))140 if( preg_match('/Win16/i',$this->UA) || 141 preg_match('/windows 3.1/i',$this->UA) || 142 preg_match('/windows 16-bit/i',$this->UA) || 143 preg_match('/16bit/i',$this->UA)) 144 144 { 145 145 $this->PLATFORM = 'Win16'; … … 148 148 149 149 // Check for Windows 32-bit 150 if( eregi('Win95',$this->UA) || eregi('windows 95',$this->UA))150 if(preg_match('/Win95/i',$this->UA) || preg_match('/windows 95/i',$this->UA)) 151 151 { 152 152 $this->PLATFORM = 'Win32'; 153 153 $this->OS = 'Win95'; 154 154 } 155 elseif( eregi('Win98',$this->UA) || eregi('windows 98',$this->UA))155 elseif(preg_match('/Win98/i',$this->UA) || preg_match('/windows 98/i',$this->UA)) 156 156 { 157 157 $this->PLATFORM = 'Win32'; 158 158 $this->OS = 'Win98'; 159 159 } 160 elseif( eregi('WinNT',$this->UA) || eregi('windows NT',$this->UA))160 elseif(preg_match('/WinNT/i',$this->UA) || preg_match('/windows NT/i',$this->UA)) 161 161 { 162 162 $this->PLATFORM = 'Win32'; … … 170 170 171 171 // Check for OS/2 172 if( eregi('os/2',$this->UA) || eregi('ibm-webexplorer',$this->UA))172 if( preg_match('/os\/2/i',$this->UA) || preg_match('/ibm-webexplorer/i',$this->UA)) 173 173 { 174 174 $this->PLATFORM = 'OS2'; … … 177 177 178 178 // Check for Mac 68000 179 if( eregi('68k',$this->UA) || eregi('68000',$this->UA))179 if( preg_match('/68k/i',$this->UA) || preg_match('/68000/i',$this->UA)) 180 180 { 181 181 $this->PLATFORM = 'Mac'; … … 184 184 185 185 //Check for Mac PowerPC 186 if( eregi('ppc',$this->UA) || eregi('powerpc',$this->UA))186 if( preg_match('/ppc/i',$this->UA) || preg_match('/powerpc/i',$this->UA)) 187 187 { 188 188 $this->PLATFORM = 'Mac'; … … 193 193 194 194 //SunOS 195 if( eregi('sunos',$this->UA))195 if(preg_match('/sunos/i',$this->UA)) 196 196 { 197 197 $this->PLATFORM = 'Unix'; 198 198 $this->OS = 'sun'; 199 199 } 200 if( eregi('sunos 4',$this->UA))200 if(preg_match('/sunos 4/i',$this->UA)) 201 201 { 202 202 $this->PLATFORM = 'Unix'; 203 203 $this->OS = 'sun4'; 204 204 } 205 elseif( eregi('sunos 5',$this->UA))205 elseif(preg_match('/sunos 5/i',$this->UA)) 206 206 { 207 207 $this->PLATFORM = 'Unix'; 208 208 $this->OS = 'sun5'; 209 209 } 210 elseif( eregi('i86',$this->UA))210 elseif(preg_match('/i86/i',$this->UA)) 211 211 { 212 212 $this->PLATFORM = 'Unix'; … … 215 215 216 216 // Irix 217 if( eregi('irix',$this->UA))217 if(preg_match('/irix/',$this->UA)) 218 218 { 219 219 $this->PLATFORM = 'Unix'; 220 220 $this->OS = 'irix'; 221 221 } 222 if( eregi('irix 6',$this->UA))222 if(preg_match('/irix 6/i',$this->UA)) 223 223 { 224 224 $this->PLATFORM = 'Unix'; 225 225 $this->OS = 'irix6'; 226 226 } 227 elseif( eregi('irix 5',$this->UA))227 elseif(preg_match('/irix 5/i',$this->UA)) 228 228 { 229 229 $this->PLATFORM = 'Unix'; … … 232 232 233 233 //HP-UX 234 if( eregi('hp-ux',$this->UA))234 if(preg_match('/hp-ux/i',$this->UA)) 235 235 { 236 236 $this->PLATFORM = 'Unix'; 237 237 $this->OS = 'hpux'; 238 238 } 239 if( eregi('hp-ux',$this->UA) && preg_match('/10./',$this-UA))239 if(preg_match('/hp-ux/i',$this->UA) && preg_match('/10./',$this-UA)) 240 240 { 241 241 $this->PLATFORM = 'Unix'; 242 242 $this->OS = 'hpux10'; 243 243 } 244 elseif( eregi('hp-ux',$this->UA) && preg_match('/09./',$this-UA))244 elseif(preg_match('/hp-ux/i',$this->UA) && preg_match('/09./',$this-UA)) 245 245 { 246 246 $this->PLATFORM = 'Unix'; … … 249 249 250 250 //AIX 251 if( eregi('aix',$this->UA))251 if(preg_match('/aix/i',$this->UA)) 252 252 { 253 253 $this->PLATFORM = 'Unix'; 254 254 $this->OS = 'aix'; 255 255 } 256 if( eregi('aix1',$this->UA))256 if(preg_match('/aix1/i',$this->UA)) 257 257 { 258 258 $this->PLATFORM = 'Unix'; 259 259 $this->OS = 'aix1'; 260 260 } 261 elseif( eregi('aix2',$this->UA))261 elseif(preg_match('/aix2/i',$this->UA)) 262 262 { 263 263 $this->PLATFORM = 'Unix'; 264 264 $this->OS = 'aix2'; 265 265 } 266 elseif( eregi('aix3',$this->UA))266 elseif(preg_match('/aix3/i',$this->UA)) 267 267 { 268 268 $this->PLATFORM = 'Unix'; 269 269 $this->OS = 'aix3'; 270 270 } 271 elseif( eregi('aix4',$this->UA))271 elseif(preg_match('/aix4/i',$this->UA)) 272 272 { 273 273 $this->PLATFORM = 'Unix'; … … 276 276 277 277 // Linux 278 if( eregi('inux',$this->UA))278 if(preg_match('/inux/i',$this->UA)) 279 279 { 280 280 $this->PLATFORM = 'Unix'; … … 283 283 284 284 //Unixware 285 if( eregi('unix_system_v',$this->UA))285 if(preg_match('/unix_system_v/i',$this->UA)) 286 286 { 287 287 $this->PLATFORM = 'Unix'; … … 290 290 291 291 //mpras 292 if( eregi('ncr',$this->UA))292 if(preg_match('/ncr/i',$this->UA)) 293 293 { 294 294 $this->PLATFORM = 'Unix'; … … 297 297 298 298 //Reliant 299 if( eregi('reliantunix',$this->UA))299 if(preg_match('/reliantunix/i',$this->UA)) 300 300 { 301 301 $this->PLATFORM = 'Unix'; … … 304 304 305 305 // DEC 306 if( eregi('dec',$this->UA) ||307 eregi('osfl',$this->UA) ||308 eregi('alphaserver',$this->UA) ||309 eregi('ultrix',$this->UA) ||310 eregi('alphastation',$this->UA))306 if(preg_match('/dec/i',$this->UA) || 307 preg_match('/osfl/i',$this->UA) || 308 preg_match('/alphaserver/i',$this->UA) || 309 preg_match('/ultrix/i',$this->UA) || 310 preg_match('/alphastation/i',$this->UA)) 311 311 { 312 312 $this->PLATFORM = 'Unix'; … … 315 315 316 316 // Sinix 317 if( eregi('sinix',$this->UA))317 if(preg_match('/sinix/i',$this->UA)) 318 318 { 319 319 $this->PLATFORM = 'Unix'; … … 322 322 323 323 // FreeBSD 324 if( eregi('freebsd',$this->UA))324 if(preg_match('/freebsd/i',$this->UA)) 325 325 { 326 326 $this->PLATFORM = 'Unix'; … … 329 329 330 330 // BSD 331 if( eregi('bsd',$this->UA))331 if(preg_match('/bsd/i',$this->UA)) 332 332 { 333 333 $this->PLATFORM = 'Unix'; … … 336 336 337 337 // VMS 338 if( eregi('vax',$this->UA) || eregi('openvms',$this->UA))338 if(preg_match('/vax/i',$this->UA) || preg_match('/openvms/i',$this->UA)) 339 339 { 340 340 $this->PLATFORM = 'Unix'; … … 343 343 344 344 // SCO 345 if( eregi('sco',$this->UA) || eregi('unix_sv',$this->UA))345 if(preg_match('/sco/i',$this->UA) || preg_match('/unix_sv/i',$this->UA)) 346 346 { 347 347 $this->PLATFORM = 'Unix'; … … 352 352 353 353 // make the code a bit easier to read 354 $ie = eregi('ie',$this->NAME);355 $ie5 = ( eregi('ie',$this->NAME) && ($this->MAJORVER >= 5) );356 $ie4 = ( eregi('ie',$this->NAME) && ($this->MAJORVER >= 4) );357 $ie3 = ( eregi('ie',$this->NAME) && ($this->MAJORVER >= 3) );358 359 $nav = eregi('netscape',$this->NAME);360 $nav5 = ( eregi('netscape',$this->NAME) && ($this->MAJORVER >= 5) );361 $nav4 = ( eregi('netscape',$this->NAME) && ($this->MAJORVER >= 4) );362 $nav3 = ( eregi('netscape',$this->NAME) && ($this->MAJORVER >= 3) );363 $nav2 = ( eregi('netscape',$this->NAME) && ($this->MAJORVER >= 2) );364 365 $opera = eregi('opera',$this->NAME);354 $ie = preg_match('/ie/i',$this->NAME); 355 $ie5 = ( preg_match('/ie/i',$this->NAME) && ($this->MAJORVER >= 5) ); 356 $ie4 = ( preg_match('/ie/i',$this->NAME) && ($this->MAJORVER >= 4) ); 357 $ie3 = ( preg_match('/ie/i',$this->NAME) && ($this->MAJORVER >= 3) ); 358 359 $nav = preg_match('/netscape/i',$this->NAME); 360 $nav5 = ( preg_match('/netscape/i',$this->NAME) && ($this->MAJORVER >= 5) ); 361 $nav4 = ( preg_match('/netscape/i',$this->NAME) && ($this->MAJORVER >= 4) ); 362 $nav3 = ( preg_match('/netscape/i',$this->NAME) && ($this->MAJORVER >= 3) ); 363 $nav2 = ( preg_match('/netscape/i',$this->NAME) && ($this->MAJORVER >= 2) ); 364 365 $opera = preg_match('/opera/i',$this->NAME); 366 366 367 367 // do the assumption -
trunk/phpgwapi/inc/class.common.inc.php
r5912 r5928 713 713 while ($file = readdir($dh)) 714 714 { 715 if ( eregi("\.css$", $file) && $file != 'phpgw.css')715 if (preg_match('/\.css$/i', $file) && $file != 'phpgw.css') 716 716 { 717 717 $list[] = substr($file,0,strpos($file,'.')); … … 724 724 while ($file = readdir($dh)) 725 725 { 726 if ( eregi("\.theme$", $file))726 if (preg_match('/\.theme$/i', $file)) 727 727 { 728 728 $list[] = substr($file,0,strpos($file,'.')); -
trunk/phpgwapi/inc/class.setup_html.inc.php
r3540 r5928 316 316 while ($file = $dh->read()) 317 317 { 318 if ( eregi("\.theme$", $file))318 if (preg_match('/\.theme$/i', $file)) 319 319 { 320 320 $list[] = substr($file,0,strpos($file,'.')); -
trunk/phpgwapi/inc/class.soapclient.inc.php
r5509 r5928 144 144 { 145 145 // fault? 146 if( eregi('fault',$return->name))146 if(preg_match('/fault/i',$return->name)) 147 147 { 148 148 $this->debug('got fault'); -
trunk/phpgwapi/inc/class.validator.inc.php
r5913 r5928 144 144 { 145 145 //echo ' is valid<br>host ' . $url_elements['host']; 146 if( eregi("[a-z]", $url_elements['host']) )146 if( preg_match('/[a-z]/i', $url_elements['host']) ) 147 147 { 148 148 //echo ' is name<br>'; … … 197 197 { 198 198 //echo "Checking $seg<br>"; 199 if( eregi("[a-z0-9\-]{0,62}",$seg))199 if(preg_match('/[a-z0-9\-]{0,62}/i',$seg)) 200 200 { 201 201 $return = True; -
trunk/phpgwapi/inc/class.xml.inc.php
r5915 r5928 1140 1140 } 1141 1141 } 1142 elseif ( eregi("^@", $step) )1142 elseif ( preg_match('/^@/i', $step) ) 1143 1143 { 1144 1144 // Use the attribute axis and select the attribute. … … 1146 1146 $axis["node-test"] = substr($step, 1); 1147 1147 } 1148 elseif ( eregi("\]$", $step) )1148 elseif ( preg_match('/\]$/i', $step) ) 1149 1149 { 1150 1150 // Use the child axis and select a position. … … 3086 3086 { 3087 3087 // Check whether it's the language, the user asks for. 3088 if ( eregi("^".$arguments, $this->nodes[$node]3088 if ( preg_match("/^$arguments/i", $this->nodes[$node] 3089 3089 ["attributes"]["xml:lang"]) ) 3090 3090 { … … 3106 3106 { 3107 3107 // Check whether it's the language, the user asks for. 3108 if ( eregi("^".$arguments, $this->nodes[$node]["attributes"]3108 if ( preg_match("/^$arguments/i", $this->nodes[$node]["attributes"] 3109 3109 ["xml:lang"]) ) 3110 3110 { -
trunk/phpgwapi/inc/common_functions.inc.php
r3486 r5928 339 339 break; 340 340 case 'ip': 341 if ( eregi("^[0-9]{1,3}(\.[0-9]{1,3}){3}$",$string))341 if (preg_match('/^[0-9]{1,3}(\.[0-9]{1,3}){3}$/i',$string)) 342 342 { 343 343 $octets = split('\.',$string); … … 360 360 break; 361 361 case 'email': 362 if ( eregi("^([[:alnum:]_%+=.-]+)@([[:alnum:]_.-]+)\.([a-z]{2,3}|[0-9]{1,3})$",$string))362 if (preg_match('/^([[:alnum:]_%+=.-]+)@([[:alnum:]_.-]+)\.([a-z]{2,3}|[0-9]{1,3})$/i',$string)) 363 363 { 364 364 return True; -
trunk/phpgwapi/inc/fpdf/font/makefont/makefont.php
r2 r5928 168 168 if(isset($fm['StdVW'])) 169 169 $stemv=$fm['StdVW']; 170 elseif(isset($fm['Weight']) and eregi('(bold|black)',$fm['Weight']))170 elseif(isset($fm['Weight']) and preg_match('/(bold|black)/i',$fm['Weight'])) 171 171 $stemv=120; 172 172 else
Note: See TracChangeset
for help on using the changeset viewer.