@@ -271,13 +271,13 @@ discard block |
||
| 271 | 271 | $this->setQuirk('no_filename_spaces'); |
| 272 | 272 | |
| 273 | 273 | switch ($this->_majorVersion) { |
| 274 | - case 7: |
|
| 275 | - $this->setFeature('dom'); |
|
| 276 | - $this->setFeature('iframes'); |
|
| 277 | - $this->setFeature('accesskey'); |
|
| 278 | - $this->setFeature('optgroup'); |
|
| 279 | - $this->setQuirk('double_linebreak_textarea'); |
|
| 280 | - break; |
|
| 274 | + case 7: |
|
| 275 | + $this->setFeature('dom'); |
|
| 276 | + $this->setFeature('iframes'); |
|
| 277 | + $this->setFeature('accesskey'); |
|
| 278 | + $this->setFeature('optgroup'); |
|
| 279 | + $this->setQuirk('double_linebreak_textarea'); |
|
| 280 | + break; |
|
| 281 | 281 | } |
| 282 | 282 | } elseif (strpos($this->_lowerAgent, 'elaine/') !== false || |
| 283 | 283 | strpos($this->_lowerAgent, 'palmsource') !== false || |
@@ -345,55 +345,55 @@ discard block |
||
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | switch ($this->_majorVersion) { |
| 348 | - case 6: |
|
| 349 | - $this->setFeature('javascript', 1.4); |
|
| 350 | - $this->setFeature('dom'); |
|
| 351 | - $this->setFeature('iframes'); |
|
| 352 | - $this->setFeature('utf'); |
|
| 353 | - $this->setFeature('rte'); |
|
| 354 | - $this->setFeature('homepage'); |
|
| 355 | - $this->setFeature('accesskey'); |
|
| 356 | - $this->setFeature('optgroup'); |
|
| 357 | - $this->setFeature('xmlhttpreq'); |
|
| 358 | - $this->setQuirk('scrollbar_in_way'); |
|
| 359 | - $this->setQuirk('broken_multipart_form'); |
|
| 360 | - break; |
|
| 361 | - |
|
| 362 | - case 5: |
|
| 363 | - if ($this->getPlatform() == 'mac') { |
|
| 364 | - $this->setFeature('javascript', 1.2); |
|
| 365 | - $this->setFeature('optgroup'); |
|
| 366 | - } else { |
|
| 367 | - // MSIE 5 for Windows. |
|
| 368 | - $this->setFeature('javascript', 1.4); |
|
| 369 | - $this->setFeature('dom'); |
|
| 370 | - $this->setFeature('xmlhttpreq'); |
|
| 371 | - if ($this->_minorVersion >= 5) { |
|
| 372 | - $this->setFeature('rte'); |
|
| 373 | - } |
|
| 374 | - } |
|
| 375 | - $this->setFeature('iframes'); |
|
| 376 | - $this->setFeature('utf'); |
|
| 377 | - $this->setFeature('homepage'); |
|
| 378 | - $this->setFeature('accesskey'); |
|
| 379 | - if ($this->_minorVersion == 5) { |
|
| 380 | - $this->setQuirk('break_disposition_header'); |
|
| 381 | - $this->setQuirk('broken_multipart_form'); |
|
| 382 | - } |
|
| 383 | - break; |
|
| 384 | - |
|
| 385 | - case 4: |
|
| 386 | - $this->setFeature('javascript', 1.2); |
|
| 387 | - $this->setFeature('accesskey'); |
|
| 388 | - if ($this->_minorVersion > 0) { |
|
| 389 | - $this->setFeature('utf'); |
|
| 390 | - } |
|
| 391 | - break; |
|
| 392 | - |
|
| 393 | - case 3: |
|
| 394 | - $this->setFeature('javascript', 1.1); |
|
| 395 | - $this->setQuirk('avoid_popup_windows'); |
|
| 396 | - break; |
|
| 348 | + case 6: |
|
| 349 | + $this->setFeature('javascript', 1.4); |
|
| 350 | + $this->setFeature('dom'); |
|
| 351 | + $this->setFeature('iframes'); |
|
| 352 | + $this->setFeature('utf'); |
|
| 353 | + $this->setFeature('rte'); |
|
| 354 | + $this->setFeature('homepage'); |
|
| 355 | + $this->setFeature('accesskey'); |
|
| 356 | + $this->setFeature('optgroup'); |
|
| 357 | + $this->setFeature('xmlhttpreq'); |
|
| 358 | + $this->setQuirk('scrollbar_in_way'); |
|
| 359 | + $this->setQuirk('broken_multipart_form'); |
|
| 360 | + break; |
|
| 361 | + |
|
| 362 | + case 5: |
|
| 363 | + if ($this->getPlatform() == 'mac') { |
|
| 364 | + $this->setFeature('javascript', 1.2); |
|
| 365 | + $this->setFeature('optgroup'); |
|
| 366 | + } else { |
|
| 367 | + // MSIE 5 for Windows. |
|
| 368 | + $this->setFeature('javascript', 1.4); |
|
| 369 | + $this->setFeature('dom'); |
|
| 370 | + $this->setFeature('xmlhttpreq'); |
|
| 371 | + if ($this->_minorVersion >= 5) { |
|
| 372 | + $this->setFeature('rte'); |
|
| 373 | + } |
|
| 374 | + } |
|
| 375 | + $this->setFeature('iframes'); |
|
| 376 | + $this->setFeature('utf'); |
|
| 377 | + $this->setFeature('homepage'); |
|
| 378 | + $this->setFeature('accesskey'); |
|
| 379 | + if ($this->_minorVersion == 5) { |
|
| 380 | + $this->setQuirk('break_disposition_header'); |
|
| 381 | + $this->setQuirk('broken_multipart_form'); |
|
| 382 | + } |
|
| 383 | + break; |
|
| 384 | + |
|
| 385 | + case 4: |
|
| 386 | + $this->setFeature('javascript', 1.2); |
|
| 387 | + $this->setFeature('accesskey'); |
|
| 388 | + if ($this->_minorVersion > 0) { |
|
| 389 | + $this->setFeature('utf'); |
|
| 390 | + } |
|
| 391 | + break; |
|
| 392 | + |
|
| 393 | + case 3: |
|
| 394 | + $this->setFeature('javascript', 1.1); |
|
| 395 | + $this->setQuirk('avoid_popup_windows'); |
|
| 396 | + break; |
|
| 397 | 397 | } |
| 398 | 398 | } elseif (preg_match('|ANTFresco/([0-9]+)|', $this->_agent, $version)) { |
| 399 | 399 | $this->setBrowser('fresco'); |
@@ -432,10 +432,10 @@ discard block |
||
| 432 | 432 | // Konqueror. |
| 433 | 433 | $this->setFeature('javascript', 1.1); |
| 434 | 434 | switch ($this->_majorVersion) { |
| 435 | - case 3: |
|
| 436 | - $this->setFeature('dom'); |
|
| 437 | - $this->setFeature('iframes'); |
|
| 438 | - break; |
|
| 435 | + case 3: |
|
| 436 | + $this->setFeature('dom'); |
|
| 437 | + $this->setFeature('iframes'); |
|
| 438 | + break; |
|
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | } elseif (preg_match('|Mozilla/([0-9.]+)|', $this->_agent, $version)) { |
@@ -444,36 +444,36 @@ discard block |
||
| 444 | 444 | |
| 445 | 445 | list($this->_majorVersion, $this->_minorVersion) = explode('.', $version[1]); |
| 446 | 446 | switch ($this->_majorVersion) { |
| 447 | - case 5: |
|
| 448 | - if ($this->getPlatform() == 'win') { |
|
| 449 | - $this->setQuirk('break_disposition_filename'); |
|
| 450 | - } |
|
| 451 | - $this->setFeature('javascript', 1.4); |
|
| 452 | - $this->setFeature('dom'); |
|
| 453 | - $this->setFeature('accesskey'); |
|
| 454 | - $this->setFeature('optgroup'); |
|
| 455 | - $this->setFeature('xmlhttpreq'); |
|
| 456 | - $this->setFeature('cite'); |
|
| 457 | - if (preg_match('|rv:(.*)\)|', $this->_agent, $revision)) { |
|
| 458 | - if ($revision[1] >= 1) { |
|
| 459 | - $this->setFeature('iframes'); |
|
| 460 | - } |
|
| 461 | - if ($revision[1] >= 1.3) { |
|
| 462 | - $this->setFeature('rte'); |
|
| 463 | - } |
|
| 464 | - } |
|
| 465 | - break; |
|
| 466 | - |
|
| 467 | - case 4: |
|
| 468 | - $this->setFeature('javascript', 1.3); |
|
| 469 | - $this->setQuirk('buggy_compression'); |
|
| 470 | - break; |
|
| 471 | - |
|
| 472 | - case 3: |
|
| 473 | - default: |
|
| 474 | - $this->setFeature('javascript', 1); |
|
| 475 | - $this->setQuirk('buggy_compression'); |
|
| 476 | - break; |
|
| 447 | + case 5: |
|
| 448 | + if ($this->getPlatform() == 'win') { |
|
| 449 | + $this->setQuirk('break_disposition_filename'); |
|
| 450 | + } |
|
| 451 | + $this->setFeature('javascript', 1.4); |
|
| 452 | + $this->setFeature('dom'); |
|
| 453 | + $this->setFeature('accesskey'); |
|
| 454 | + $this->setFeature('optgroup'); |
|
| 455 | + $this->setFeature('xmlhttpreq'); |
|
| 456 | + $this->setFeature('cite'); |
|
| 457 | + if (preg_match('|rv:(.*)\)|', $this->_agent, $revision)) { |
|
| 458 | + if ($revision[1] >= 1) { |
|
| 459 | + $this->setFeature('iframes'); |
|
| 460 | + } |
|
| 461 | + if ($revision[1] >= 1.3) { |
|
| 462 | + $this->setFeature('rte'); |
|
| 463 | + } |
|
| 464 | + } |
|
| 465 | + break; |
|
| 466 | + |
|
| 467 | + case 4: |
|
| 468 | + $this->setFeature('javascript', 1.3); |
|
| 469 | + $this->setQuirk('buggy_compression'); |
|
| 470 | + break; |
|
| 471 | + |
|
| 472 | + case 3: |
|
| 473 | + default: |
|
| 474 | + $this->setFeature('javascript', 1); |
|
| 475 | + $this->setQuirk('buggy_compression'); |
|
| 476 | + break; |
|
| 477 | 477 | } |
| 478 | 478 | } elseif (preg_match('|Lynx/([0-9]+)|', $this->_agent, $version)) { |
| 479 | 479 | $this->setBrowser('lynx'); |
@@ -831,17 +831,17 @@ discard block |
||
| 831 | 831 | } |
| 832 | 832 | $size = ini_get('upload_max_filesize'); |
| 833 | 833 | switch (strtolower(substr($size, -1, 1))) { |
| 834 | - case 'k': |
|
| 835 | - $size = intval(floatval($size) * 1024); |
|
| 836 | - break; |
|
| 834 | + case 'k': |
|
| 835 | + $size = intval(floatval($size) * 1024); |
|
| 836 | + break; |
|
| 837 | 837 | |
| 838 | - case 'm': |
|
| 839 | - $size = intval(floatval($size) * 1024 * 1024); |
|
| 840 | - break; |
|
| 838 | + case 'm': |
|
| 839 | + $size = intval(floatval($size) * 1024 * 1024); |
|
| 840 | + break; |
|
| 841 | 841 | |
| 842 | - default: |
|
| 843 | - $size = intval($size); |
|
| 844 | - break; |
|
| 842 | + default: |
|
| 843 | + $size = intval($size); |
|
| 844 | + break; |
|
| 845 | 845 | } |
| 846 | 846 | return $size; |
| 847 | 847 | } else { |
@@ -169,23 +169,23 @@ discard block |
||
| 169 | 169 | array($error->getUserInfo())); |
| 170 | 170 | |
| 171 | 171 | switch ($error->getCode()) { |
| 172 | - case HORDE_ERROR_DRIVER_CONFIG_MISSING: |
|
| 173 | - $message = sprintf(_("No configuration information specified for %s."), $info['name']) . '<br />' . |
|
| 174 | - sprintf(_("The file %s should contain some %s settings."), |
|
| 175 | - $GLOBALS['registry']->get('fileroot') . '/config/' . $info['file'], |
|
| 176 | - sprintf("%s['%s']['params']", $info['variable'], $info['driver'])); |
|
| 177 | - break; |
|
| 178 | - |
|
| 179 | - case HORDE_ERROR_DRIVER_CONFIG: |
|
| 180 | - $message = sprintf(_("Required '%s' not specified in %s configuration."), $info['field'], $info['name']) . '<br />' . |
|
| 181 | - sprintf(_("The file %s should contain a %s setting."), |
|
| 182 | - $GLOBALS['registry']->get('fileroot') . '/config/' . $info['file'], |
|
| 183 | - sprintf("%s['%s']['params']['%s']", $info['variable'], $info['driver'], $info['field'])); |
|
| 184 | - break; |
|
| 185 | - |
|
| 186 | - default: |
|
| 187 | - $message = $error->getMessage(); |
|
| 188 | - break; |
|
| 172 | + case HORDE_ERROR_DRIVER_CONFIG_MISSING: |
|
| 173 | + $message = sprintf(_("No configuration information specified for %s."), $info['name']) . '<br />' . |
|
| 174 | + sprintf(_("The file %s should contain some %s settings."), |
|
| 175 | + $GLOBALS['registry']->get('fileroot') . '/config/' . $info['file'], |
|
| 176 | + sprintf("%s['%s']['params']", $info['variable'], $info['driver'])); |
|
| 177 | + break; |
|
| 178 | + |
|
| 179 | + case HORDE_ERROR_DRIVER_CONFIG: |
|
| 180 | + $message = sprintf(_("Required '%s' not specified in %s configuration."), $info['field'], $info['name']) . '<br />' . |
|
| 181 | + sprintf(_("The file %s should contain a %s setting."), |
|
| 182 | + $GLOBALS['registry']->get('fileroot') . '/config/' . $info['file'], |
|
| 183 | + sprintf("%s['%s']['params']['%s']", $info['variable'], $info['driver'], $info['field'])); |
|
| 184 | + break; |
|
| 185 | + |
|
| 186 | + default: |
|
| 187 | + $message = $error->getMessage(); |
|
| 188 | + break; |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | $errortext .= '<h3>' . htmlspecialchars($message) . '</h3>'; |
@@ -334,32 +334,32 @@ discard block |
||
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | switch ($type) { |
| 337 | - case 'help': |
|
| 338 | - if ($GLOBALS['browser']->hasFeature('javascript')) { |
|
| 339 | - Horde::addScriptFile('open_help_win.js', 'horde'); |
|
| 340 | - return "javascript:open_help_win('$app');"; |
|
| 341 | - } else { |
|
| 342 | - $url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/help/', true); |
|
| 343 | - return Util::addParameter($url, array('module' => $app, |
|
| 344 | - 'show' => 'topics')); |
|
| 345 | - } |
|
| 346 | - break; |
|
| 347 | - |
|
| 348 | - case 'problem': |
|
| 349 | - return Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/problem.php?return_url=' . urlencode(Horde::selfUrl(true))); |
|
| 350 | - |
|
| 351 | - case 'logout': |
|
| 352 | - return Auth::addLogoutParameters(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/login.php'), AUTH_REASON_LOGOUT); |
|
| 353 | - |
|
| 354 | - case 'login': |
|
| 355 | - return Auth::getLoginScreen('', $referrer ? Horde::selfUrl(true) : null); |
|
| 356 | - |
|
| 357 | - case 'options': |
|
| 358 | - global $conf; |
|
| 359 | - if (($conf['prefs']['driver'] != '') && ($conf['prefs']['driver'] != 'none')) { |
|
| 360 | - return Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php?app=' . $app); |
|
| 361 | - } |
|
| 362 | - break; |
|
| 337 | + case 'help': |
|
| 338 | + if ($GLOBALS['browser']->hasFeature('javascript')) { |
|
| 339 | + Horde::addScriptFile('open_help_win.js', 'horde'); |
|
| 340 | + return "javascript:open_help_win('$app');"; |
|
| 341 | + } else { |
|
| 342 | + $url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/help/', true); |
|
| 343 | + return Util::addParameter($url, array('module' => $app, |
|
| 344 | + 'show' => 'topics')); |
|
| 345 | + } |
|
| 346 | + break; |
|
| 347 | + |
|
| 348 | + case 'problem': |
|
| 349 | + return Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/problem.php?return_url=' . urlencode(Horde::selfUrl(true))); |
|
| 350 | + |
|
| 351 | + case 'logout': |
|
| 352 | + return Auth::addLogoutParameters(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/login.php'), AUTH_REASON_LOGOUT); |
|
| 353 | + |
|
| 354 | + case 'login': |
|
| 355 | + return Auth::getLoginScreen('', $referrer ? Horde::selfUrl(true) : null); |
|
| 356 | + |
|
| 357 | + case 'options': |
|
| 358 | + global $conf; |
|
| 359 | + if (($conf['prefs']['driver'] != '') && ($conf['prefs']['driver'] != 'none')) { |
|
| 360 | + return Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php?app=' . $app); |
|
| 361 | + } |
|
| 362 | + break; |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | return false; |
@@ -381,17 +381,17 @@ discard block |
||
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | switch ($conf['menu']['links'][$type]) { |
| 384 | - case 'all': |
|
| 385 | - return true; |
|
| 384 | + case 'all': |
|
| 385 | + return true; |
|
| 386 | 386 | |
| 387 | - case 'never': |
|
| 388 | - return false; |
|
| 387 | + case 'never': |
|
| 388 | + return false; |
|
| 389 | 389 | |
| 390 | - case 'authenticated': |
|
| 391 | - return (bool)Auth::getAuth(); |
|
| 390 | + case 'authenticated': |
|
| 391 | + return (bool)Auth::getAuth(); |
|
| 392 | 392 | |
| 393 | - default: |
|
| 394 | - return false; |
|
| 393 | + default: |
|
| 394 | + return false; |
|
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
@@ -142,20 +142,20 @@ |
||
| 142 | 142 | function getBits($num, $l) |
| 143 | 143 | { |
| 144 | 144 | switch ($num) { |
| 145 | - case 0: |
|
| 146 | - return $l & 127; // 0x7F |
|
| 145 | + case 0: |
|
| 146 | + return $l & 127; // 0x7F |
|
| 147 | 147 | |
| 148 | - case 1: |
|
| 149 | - return ($l >> 7) & 127; // 0x7F |
|
| 148 | + case 1: |
|
| 149 | + return ($l >> 7) & 127; // 0x7F |
|
| 150 | 150 | |
| 151 | - case 2: |
|
| 152 | - return ($l >> 14) & 127; // 0x7F |
|
| 151 | + case 2: |
|
| 152 | + return ($l >> 14) & 127; // 0x7F |
|
| 153 | 153 | |
| 154 | - case 3: |
|
| 155 | - return ($l >> 21) & 127; // 0x7F |
|
| 154 | + case 3: |
|
| 155 | + return ($l >> 21) & 127; // 0x7F |
|
| 156 | 156 | |
| 157 | - case 4: |
|
| 158 | - return ($l >> 28) & 127; // 0x7F |
|
| 157 | + case 4: |
|
| 158 | + return ($l >> 28) & 127; // 0x7F |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | return 0; |
@@ -294,160 +294,160 @@ discard block |
||
| 294 | 294 | // print "position: " . $this->_strpos . " token: " . $token . " str10: " . substr($input, $this->_strpos, 10) . "\n"; // @todo: remove debug output |
| 295 | 295 | |
| 296 | 296 | switch ($token) { |
| 297 | - case XML_WBXML_GLOBAL_TOKEN_STR_I: |
|
| 298 | - // Section 5.8.4.1 |
|
| 299 | - $str = $this->termstr($input); |
|
| 300 | - $this->_ch->characters($str); |
|
| 301 | - // print "str:$str\n"; // @TODO Remove debug code |
|
| 302 | - break; |
|
| 303 | - |
|
| 304 | - case XML_WBXML_GLOBAL_TOKEN_STR_T: |
|
| 305 | - // Section 5.8.4.1 |
|
| 306 | - $x = XML_WBXML::MBUInt32ToInt($input, $this->_strpos); |
|
| 307 | - $str = $this->getStringTableEntry($x); |
|
| 308 | - $this->_ch->characters($str); |
|
| 309 | - break; |
|
| 310 | - |
|
| 311 | - case XML_WBXML_GLOBAL_TOKEN_EXT_I_0: |
|
| 312 | - case XML_WBXML_GLOBAL_TOKEN_EXT_I_1: |
|
| 313 | - case XML_WBXML_GLOBAL_TOKEN_EXT_I_2: |
|
| 314 | - // Section 5.8.4.2 |
|
| 315 | - $str = $this->termstr($input); |
|
| 316 | - $this->_ch->characters($str); |
|
| 317 | - break; |
|
| 318 | - |
|
| 319 | - case XML_WBXML_GLOBAL_TOKEN_EXT_T_0: |
|
| 320 | - case XML_WBXML_GLOBAL_TOKEN_EXT_T_1: |
|
| 321 | - case XML_WBXML_GLOBAL_TOKEN_EXT_T_2: |
|
| 322 | - // Section 5.8.4.2 |
|
| 323 | - $str = $this->getStringTableEnty(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 324 | - $this->_ch->characters($str); |
|
| 325 | - break; |
|
| 326 | - |
|
| 327 | - case XML_WBXML_GLOBAL_TOKEN_EXT_0: |
|
| 328 | - case XML_WBXML_GLOBAL_TOKEN_EXT_1: |
|
| 329 | - case XML_WBXML_GLOBAL_TOKEN_EXT_2: |
|
| 330 | - // Section 5.8.4.2 |
|
| 331 | - $extension = $this->getByte($input); |
|
| 332 | - $this->_ch->characters($extension); |
|
| 333 | - break; |
|
| 334 | - |
|
| 335 | - case XML_WBXML_GLOBAL_TOKEN_ENTITY: |
|
| 336 | - // Section 5.8.4.3 |
|
| 337 | - // UCS-4 chracter encoding? |
|
| 338 | - $entity = $this->entity(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 339 | - |
|
| 340 | - $this->_ch->characters('&#' . $entity . ';'); |
|
| 341 | - break; |
|
| 342 | - |
|
| 343 | - case XML_WBXML_GLOBAL_TOKEN_PI: |
|
| 344 | - // Section 5.8.4.4 |
|
| 345 | - // throw new IOException |
|
| 346 | - // die("WBXML global token processing instruction(PI, " + token + ") is unsupported!\n"); |
|
| 347 | - break; |
|
| 348 | - |
|
| 349 | - case XML_WBXML_GLOBAL_TOKEN_LITERAL: |
|
| 350 | - // Section 5.8.4.5 |
|
| 351 | - $str = $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 352 | - $this->parseTag($input, $str, false, false); |
|
| 353 | - break; |
|
| 354 | - |
|
| 355 | - case XML_WBXML_GLOBAL_TOKEN_LITERAL_A: |
|
| 356 | - // Section 5.8.4.5 |
|
| 357 | - $str = $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 358 | - $this->parseTag($input, $str, true, false); |
|
| 359 | - break; |
|
| 360 | - |
|
| 361 | - case XML_WBXML_GLOBAL_TOKEN_LITERAL_AC: |
|
| 362 | - // Section 5.8.4.5 |
|
| 363 | - $str = $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 364 | - $this->parseTag($input, $string, true, true); |
|
| 365 | - break; |
|
| 366 | - |
|
| 367 | - case XML_WBXML_GLOBAL_TOKEN_LITERAL_C: |
|
| 368 | - // Section 5.8.4.5 |
|
| 369 | - $str = $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 370 | - $this->parseTag($input, $str, false, true); |
|
| 371 | - break; |
|
| 372 | - |
|
| 373 | - case XML_WBXML_GLOBAL_TOKEN_OPAQUE: |
|
| 374 | - // Section 5.8.4.6 |
|
| 375 | - $size = XML_WBXML::MBUInt32ToInt($input, $this->_strpos); |
|
| 376 | - if ($size > 0) { |
|
| 377 | - #Horde::logMessage("WBXML opaque document size=$size, next=" . ord($input{$this->_strpos}), __FILE__, __LINE__, PEAR_LOG_DEBUG); |
|
| 378 | - $b = $this->_substr($input, $this->_strpos, $size); |
|
| 379 | - // print "opaque of size $size: ($b)\n"; // @todo remove debug |
|
| 380 | - $this->_strpos += $size; |
|
| 381 | - // opaque data inside a <data> element may or may not be |
|
| 382 | - // a nested wbxml document (for example devinf data). |
|
| 383 | - // We find out by checking the first byte of the data: if it's |
|
| 384 | - // 1, 2 or 3 we expect it to be the version number of a wbxml |
|
| 385 | - // document and thus start a new wbxml decoder instance on it. |
|
| 386 | - |
|
| 387 | - if ($this->_isData && ord($b) < 10) { |
|
| 388 | - #Horde::logMessage("WBXML opaque document size=$size, \$b[0]=" . ord($b), __FILE__, __LINE__, PEAR_LOG_DEBUG); |
|
| 389 | - $decoder = new XML_WBXML_Decoder(true); |
|
| 390 | - $decoder->setContentHandler($this->_ch); |
|
| 391 | - $s = $decoder->decode($b); |
|
| 392 | - // /* // @todo: FIXME currently we can't decode Nokia |
|
| 393 | - // DevInf data. So ignore error for the time beeing. |
|
| 394 | - if (is_a($s, 'PEAR_Error')) { |
|
| 395 | - $this->_error = $s; |
|
| 396 | - return; |
|
| 397 | - } |
|
| 398 | - // */ |
|
| 399 | - // $this->_ch->characters($s); |
|
| 400 | - } else { |
|
| 401 | - /* normal opaque behaviour: just copy the raw data: */ |
|
| 402 | - // print "opaque handled as string=$b\n"; // @todo remove debug |
|
| 403 | - $this->_ch->characters($b); |
|
| 404 | - } |
|
| 405 | - } |
|
| 406 | - // old approach to deal with opaque data inside ContentHandler: |
|
| 407 | - // FIXME Opaque is used by SYNCML. Opaque data that depends on the context |
|
| 408 | - // if (contentHandler instanceof OpaqueContentHandler) { |
|
| 409 | - // ((OpaqueContentHandler)contentHandler).opaque(b); |
|
| 410 | - // } else { |
|
| 411 | - // String str = new String(b, 0, size, charset); |
|
| 412 | - // char[] chars = str.toCharArray(); |
|
| 413 | - |
|
| 414 | - // contentHandler.characters(chars, 0, chars.length); |
|
| 415 | - // } |
|
| 416 | - |
|
| 417 | - break; |
|
| 418 | - |
|
| 419 | - case XML_WBXML_GLOBAL_TOKEN_END: |
|
| 420 | - // Section 5.8.4.7.1 |
|
| 421 | - $str = $this->endTag(); |
|
| 422 | - break; |
|
| 423 | - |
|
| 424 | - case XML_WBXML_GLOBAL_TOKEN_SWITCH_PAGE: |
|
| 425 | - // Section 5.8.4.7.2 |
|
| 426 | - $codePage = $this->getByte($input); |
|
| 427 | - // print "switch to codepage $codePage\n"; // @todo: remove debug code |
|
| 428 | - $this->switchElementCodePage($codePage); |
|
| 429 | - break; |
|
| 430 | - |
|
| 431 | - default: |
|
| 432 | - // Section 5.8.2 |
|
| 433 | - // Section 5.8.3 |
|
| 434 | - $hasAttributes = (($token & 0x80) != 0); |
|
| 435 | - $hasContent = (($token & 0x40) != 0); |
|
| 436 | - $realToken = $token & 0x3F; |
|
| 437 | - $str = $this->getTag($realToken); |
|
| 438 | - |
|
| 439 | - // print "element:$str\n"; // @TODO Remove debug code |
|
| 440 | - $this->parseTag($input, $str, $hasAttributes, $hasContent); |
|
| 441 | - |
|
| 442 | - if ($realToken == 0x0f) { |
|
| 443 | - // store if we're inside a Data tag. This may contain |
|
| 444 | - // an additional enclosed wbxml document on which we have |
|
| 445 | - // to run a seperate encoder |
|
| 446 | - $this->_isData = true; |
|
| 447 | - } else { |
|
| 448 | - $this->_isData = false; |
|
| 449 | - } |
|
| 450 | - break; |
|
| 297 | + case XML_WBXML_GLOBAL_TOKEN_STR_I: |
|
| 298 | + // Section 5.8.4.1 |
|
| 299 | + $str = $this->termstr($input); |
|
| 300 | + $this->_ch->characters($str); |
|
| 301 | + // print "str:$str\n"; // @TODO Remove debug code |
|
| 302 | + break; |
|
| 303 | + |
|
| 304 | + case XML_WBXML_GLOBAL_TOKEN_STR_T: |
|
| 305 | + // Section 5.8.4.1 |
|
| 306 | + $x = XML_WBXML::MBUInt32ToInt($input, $this->_strpos); |
|
| 307 | + $str = $this->getStringTableEntry($x); |
|
| 308 | + $this->_ch->characters($str); |
|
| 309 | + break; |
|
| 310 | + |
|
| 311 | + case XML_WBXML_GLOBAL_TOKEN_EXT_I_0: |
|
| 312 | + case XML_WBXML_GLOBAL_TOKEN_EXT_I_1: |
|
| 313 | + case XML_WBXML_GLOBAL_TOKEN_EXT_I_2: |
|
| 314 | + // Section 5.8.4.2 |
|
| 315 | + $str = $this->termstr($input); |
|
| 316 | + $this->_ch->characters($str); |
|
| 317 | + break; |
|
| 318 | + |
|
| 319 | + case XML_WBXML_GLOBAL_TOKEN_EXT_T_0: |
|
| 320 | + case XML_WBXML_GLOBAL_TOKEN_EXT_T_1: |
|
| 321 | + case XML_WBXML_GLOBAL_TOKEN_EXT_T_2: |
|
| 322 | + // Section 5.8.4.2 |
|
| 323 | + $str = $this->getStringTableEnty(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 324 | + $this->_ch->characters($str); |
|
| 325 | + break; |
|
| 326 | + |
|
| 327 | + case XML_WBXML_GLOBAL_TOKEN_EXT_0: |
|
| 328 | + case XML_WBXML_GLOBAL_TOKEN_EXT_1: |
|
| 329 | + case XML_WBXML_GLOBAL_TOKEN_EXT_2: |
|
| 330 | + // Section 5.8.4.2 |
|
| 331 | + $extension = $this->getByte($input); |
|
| 332 | + $this->_ch->characters($extension); |
|
| 333 | + break; |
|
| 334 | + |
|
| 335 | + case XML_WBXML_GLOBAL_TOKEN_ENTITY: |
|
| 336 | + // Section 5.8.4.3 |
|
| 337 | + // UCS-4 chracter encoding? |
|
| 338 | + $entity = $this->entity(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 339 | + |
|
| 340 | + $this->_ch->characters('&#' . $entity . ';'); |
|
| 341 | + break; |
|
| 342 | + |
|
| 343 | + case XML_WBXML_GLOBAL_TOKEN_PI: |
|
| 344 | + // Section 5.8.4.4 |
|
| 345 | + // throw new IOException |
|
| 346 | + // die("WBXML global token processing instruction(PI, " + token + ") is unsupported!\n"); |
|
| 347 | + break; |
|
| 348 | + |
|
| 349 | + case XML_WBXML_GLOBAL_TOKEN_LITERAL: |
|
| 350 | + // Section 5.8.4.5 |
|
| 351 | + $str = $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 352 | + $this->parseTag($input, $str, false, false); |
|
| 353 | + break; |
|
| 354 | + |
|
| 355 | + case XML_WBXML_GLOBAL_TOKEN_LITERAL_A: |
|
| 356 | + // Section 5.8.4.5 |
|
| 357 | + $str = $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 358 | + $this->parseTag($input, $str, true, false); |
|
| 359 | + break; |
|
| 360 | + |
|
| 361 | + case XML_WBXML_GLOBAL_TOKEN_LITERAL_AC: |
|
| 362 | + // Section 5.8.4.5 |
|
| 363 | + $str = $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 364 | + $this->parseTag($input, $string, true, true); |
|
| 365 | + break; |
|
| 366 | + |
|
| 367 | + case XML_WBXML_GLOBAL_TOKEN_LITERAL_C: |
|
| 368 | + // Section 5.8.4.5 |
|
| 369 | + $str = $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 370 | + $this->parseTag($input, $str, false, true); |
|
| 371 | + break; |
|
| 372 | + |
|
| 373 | + case XML_WBXML_GLOBAL_TOKEN_OPAQUE: |
|
| 374 | + // Section 5.8.4.6 |
|
| 375 | + $size = XML_WBXML::MBUInt32ToInt($input, $this->_strpos); |
|
| 376 | + if ($size > 0) { |
|
| 377 | + #Horde::logMessage("WBXML opaque document size=$size, next=" . ord($input{$this->_strpos}), __FILE__, __LINE__, PEAR_LOG_DEBUG); |
|
| 378 | + $b = $this->_substr($input, $this->_strpos, $size); |
|
| 379 | + // print "opaque of size $size: ($b)\n"; // @todo remove debug |
|
| 380 | + $this->_strpos += $size; |
|
| 381 | + // opaque data inside a <data> element may or may not be |
|
| 382 | + // a nested wbxml document (for example devinf data). |
|
| 383 | + // We find out by checking the first byte of the data: if it's |
|
| 384 | + // 1, 2 or 3 we expect it to be the version number of a wbxml |
|
| 385 | + // document and thus start a new wbxml decoder instance on it. |
|
| 386 | + |
|
| 387 | + if ($this->_isData && ord($b) < 10) { |
|
| 388 | + #Horde::logMessage("WBXML opaque document size=$size, \$b[0]=" . ord($b), __FILE__, __LINE__, PEAR_LOG_DEBUG); |
|
| 389 | + $decoder = new XML_WBXML_Decoder(true); |
|
| 390 | + $decoder->setContentHandler($this->_ch); |
|
| 391 | + $s = $decoder->decode($b); |
|
| 392 | + // /* // @todo: FIXME currently we can't decode Nokia |
|
| 393 | + // DevInf data. So ignore error for the time beeing. |
|
| 394 | + if (is_a($s, 'PEAR_Error')) { |
|
| 395 | + $this->_error = $s; |
|
| 396 | + return; |
|
| 397 | + } |
|
| 398 | + // */ |
|
| 399 | + // $this->_ch->characters($s); |
|
| 400 | + } else { |
|
| 401 | + /* normal opaque behaviour: just copy the raw data: */ |
|
| 402 | + // print "opaque handled as string=$b\n"; // @todo remove debug |
|
| 403 | + $this->_ch->characters($b); |
|
| 404 | + } |
|
| 405 | + } |
|
| 406 | + // old approach to deal with opaque data inside ContentHandler: |
|
| 407 | + // FIXME Opaque is used by SYNCML. Opaque data that depends on the context |
|
| 408 | + // if (contentHandler instanceof OpaqueContentHandler) { |
|
| 409 | + // ((OpaqueContentHandler)contentHandler).opaque(b); |
|
| 410 | + // } else { |
|
| 411 | + // String str = new String(b, 0, size, charset); |
|
| 412 | + // char[] chars = str.toCharArray(); |
|
| 413 | + |
|
| 414 | + // contentHandler.characters(chars, 0, chars.length); |
|
| 415 | + // } |
|
| 416 | + |
|
| 417 | + break; |
|
| 418 | + |
|
| 419 | + case XML_WBXML_GLOBAL_TOKEN_END: |
|
| 420 | + // Section 5.8.4.7.1 |
|
| 421 | + $str = $this->endTag(); |
|
| 422 | + break; |
|
| 423 | + |
|
| 424 | + case XML_WBXML_GLOBAL_TOKEN_SWITCH_PAGE: |
|
| 425 | + // Section 5.8.4.7.2 |
|
| 426 | + $codePage = $this->getByte($input); |
|
| 427 | + // print "switch to codepage $codePage\n"; // @todo: remove debug code |
|
| 428 | + $this->switchElementCodePage($codePage); |
|
| 429 | + break; |
|
| 430 | + |
|
| 431 | + default: |
|
| 432 | + // Section 5.8.2 |
|
| 433 | + // Section 5.8.3 |
|
| 434 | + $hasAttributes = (($token & 0x80) != 0); |
|
| 435 | + $hasContent = (($token & 0x40) != 0); |
|
| 436 | + $realToken = $token & 0x3F; |
|
| 437 | + $str = $this->getTag($realToken); |
|
| 438 | + |
|
| 439 | + // print "element:$str\n"; // @TODO Remove debug code |
|
| 440 | + $this->parseTag($input, $str, $hasAttributes, $hasContent); |
|
| 441 | + |
|
| 442 | + if ($realToken == 0x0f) { |
|
| 443 | + // store if we're inside a Data tag. This may contain |
|
| 444 | + // an additional enclosed wbxml document on which we have |
|
| 445 | + // to run a seperate encoder |
|
| 446 | + $this->_isData = true; |
|
| 447 | + } else { |
|
| 448 | + $this->_isData = false; |
|
| 449 | + } |
|
| 450 | + break; |
|
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | 453 | |
@@ -497,93 +497,93 @@ discard block |
||
| 497 | 497 | |
| 498 | 498 | switch ($token) { |
| 499 | 499 | // Attribute specified. |
| 500 | - case XML_WBXML_GLOBAL_TOKEN_LITERAL: |
|
| 501 | - // Section 5.8.4.5 |
|
| 502 | - if (isset($attr)) { |
|
| 503 | - $attrs[] = array('attribute' => $attr, |
|
| 504 | - 'value' => $value); |
|
| 505 | - } |
|
| 506 | - |
|
| 507 | - $attr = $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 508 | - break; |
|
| 509 | - |
|
| 510 | - // Value specified. |
|
| 511 | - case XML_WBXML_GLOBAL_TOKEN_EXT_I_0: |
|
| 512 | - case XML_WBXML_GLOBAL_TOKEN_EXT_I_1: |
|
| 513 | - case XML_WBXML_GLOBAL_TOKEN_EXT_I_2: |
|
| 514 | - // Section 5.8.4.2 |
|
| 515 | - $value .= $this->termstr($input); |
|
| 516 | - break; |
|
| 517 | - |
|
| 518 | - case XML_WBXML_GLOBAL_TOKEN_EXT_T_0: |
|
| 519 | - case XML_WBXML_GLOBAL_TOKEN_EXT_T_1: |
|
| 520 | - case XML_WBXML_GLOBAL_TOKEN_EXT_T_2: |
|
| 521 | - // Section 5.8.4.2 |
|
| 522 | - $value .= $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 523 | - break; |
|
| 524 | - |
|
| 525 | - case XML_WBXML_GLOBAL_TOKEN_EXT_0: |
|
| 526 | - case XML_WBXML_GLOBAL_TOKEN_EXT_1: |
|
| 527 | - case XML_WBXML_GLOBAL_TOKEN_EXT_2: |
|
| 528 | - // Section 5.8.4.2 |
|
| 529 | - $value .= $input[$this->_strpos++]; |
|
| 530 | - break; |
|
| 531 | - |
|
| 532 | - case XML_WBXML_GLOBAL_TOKEN_ENTITY: |
|
| 533 | - // Section 5.8.4.3 |
|
| 534 | - $value .= $this->entity(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 535 | - break; |
|
| 536 | - |
|
| 537 | - case XML_WBXML_GLOBAL_TOKEN_STR_I: |
|
| 538 | - // Section 5.8.4.1 |
|
| 539 | - $value .= $this->termstr($input); |
|
| 540 | - break; |
|
| 541 | - |
|
| 542 | - case XML_WBXML_GLOBAL_TOKEN_STR_T: |
|
| 543 | - // Section 5.8.4.1 |
|
| 544 | - $value .= $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 545 | - break; |
|
| 546 | - |
|
| 547 | - case XML_WBXML_GLOBAL_TOKEN_OPAQUE: |
|
| 548 | - // Section 5.8.4.6 |
|
| 549 | - $size = XML_WBXML::MBUInt32ToInt($input, $this->_strpos); |
|
| 550 | - $b = $this->_substr($input, $this->_strpos, $this->_strpos + $size); |
|
| 551 | - $this->_strpos += $size; |
|
| 552 | - |
|
| 553 | - $value .= $b; |
|
| 554 | - break; |
|
| 555 | - |
|
| 556 | - case XML_WBXML_GLOBAL_TOKEN_END: |
|
| 557 | - // Section 5.8.4.7.1 |
|
| 558 | - $hasMoreAttributes = false; |
|
| 559 | - if (isset($attr)) { |
|
| 560 | - $attrs[] = array('attribute' => $attr, |
|
| 561 | - 'value' => $value); |
|
| 562 | - } |
|
| 563 | - break; |
|
| 564 | - |
|
| 565 | - case XML_WBXML_GLOBAL_TOKEN_SWITCH_PAGE: |
|
| 566 | - // Section 5.8.4.7.2 |
|
| 567 | - $codePage = $this->getByte($input); |
|
| 568 | - if (!$this->_prevAttributeDTD) { |
|
| 569 | - $this->_prevAttributeDTD = $this->_attributeDTD; |
|
| 570 | - } |
|
| 571 | - |
|
| 572 | - $this->switchAttributeCodePage($codePage); |
|
| 573 | - break; |
|
| 574 | - |
|
| 575 | - default: |
|
| 576 | - if ($token > 128) { |
|
| 577 | - if (isset($attr)) { |
|
| 578 | - $attrs[] = array('attribute' => $attr, |
|
| 579 | - 'value' => $value); |
|
| 580 | - } |
|
| 581 | - $attr = $this->_attributeDTD->toAttribute($token); |
|
| 582 | - } else { |
|
| 583 | - // Value. |
|
| 584 | - $value .= $this->_attributeDTD->toAttribute($token); |
|
| 585 | - } |
|
| 586 | - break; |
|
| 500 | + case XML_WBXML_GLOBAL_TOKEN_LITERAL: |
|
| 501 | + // Section 5.8.4.5 |
|
| 502 | + if (isset($attr)) { |
|
| 503 | + $attrs[] = array('attribute' => $attr, |
|
| 504 | + 'value' => $value); |
|
| 505 | + } |
|
| 506 | + |
|
| 507 | + $attr = $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 508 | + break; |
|
| 509 | + |
|
| 510 | + // Value specified. |
|
| 511 | + case XML_WBXML_GLOBAL_TOKEN_EXT_I_0: |
|
| 512 | + case XML_WBXML_GLOBAL_TOKEN_EXT_I_1: |
|
| 513 | + case XML_WBXML_GLOBAL_TOKEN_EXT_I_2: |
|
| 514 | + // Section 5.8.4.2 |
|
| 515 | + $value .= $this->termstr($input); |
|
| 516 | + break; |
|
| 517 | + |
|
| 518 | + case XML_WBXML_GLOBAL_TOKEN_EXT_T_0: |
|
| 519 | + case XML_WBXML_GLOBAL_TOKEN_EXT_T_1: |
|
| 520 | + case XML_WBXML_GLOBAL_TOKEN_EXT_T_2: |
|
| 521 | + // Section 5.8.4.2 |
|
| 522 | + $value .= $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 523 | + break; |
|
| 524 | + |
|
| 525 | + case XML_WBXML_GLOBAL_TOKEN_EXT_0: |
|
| 526 | + case XML_WBXML_GLOBAL_TOKEN_EXT_1: |
|
| 527 | + case XML_WBXML_GLOBAL_TOKEN_EXT_2: |
|
| 528 | + // Section 5.8.4.2 |
|
| 529 | + $value .= $input[$this->_strpos++]; |
|
| 530 | + break; |
|
| 531 | + |
|
| 532 | + case XML_WBXML_GLOBAL_TOKEN_ENTITY: |
|
| 533 | + // Section 5.8.4.3 |
|
| 534 | + $value .= $this->entity(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 535 | + break; |
|
| 536 | + |
|
| 537 | + case XML_WBXML_GLOBAL_TOKEN_STR_I: |
|
| 538 | + // Section 5.8.4.1 |
|
| 539 | + $value .= $this->termstr($input); |
|
| 540 | + break; |
|
| 541 | + |
|
| 542 | + case XML_WBXML_GLOBAL_TOKEN_STR_T: |
|
| 543 | + // Section 5.8.4.1 |
|
| 544 | + $value .= $this->getStringTableEntry(XML_WBXML::MBUInt32ToInt($input, $this->_strpos)); |
|
| 545 | + break; |
|
| 546 | + |
|
| 547 | + case XML_WBXML_GLOBAL_TOKEN_OPAQUE: |
|
| 548 | + // Section 5.8.4.6 |
|
| 549 | + $size = XML_WBXML::MBUInt32ToInt($input, $this->_strpos); |
|
| 550 | + $b = $this->_substr($input, $this->_strpos, $this->_strpos + $size); |
|
| 551 | + $this->_strpos += $size; |
|
| 552 | + |
|
| 553 | + $value .= $b; |
|
| 554 | + break; |
|
| 555 | + |
|
| 556 | + case XML_WBXML_GLOBAL_TOKEN_END: |
|
| 557 | + // Section 5.8.4.7.1 |
|
| 558 | + $hasMoreAttributes = false; |
|
| 559 | + if (isset($attr)) { |
|
| 560 | + $attrs[] = array('attribute' => $attr, |
|
| 561 | + 'value' => $value); |
|
| 562 | + } |
|
| 563 | + break; |
|
| 564 | + |
|
| 565 | + case XML_WBXML_GLOBAL_TOKEN_SWITCH_PAGE: |
|
| 566 | + // Section 5.8.4.7.2 |
|
| 567 | + $codePage = $this->getByte($input); |
|
| 568 | + if (!$this->_prevAttributeDTD) { |
|
| 569 | + $this->_prevAttributeDTD = $this->_attributeDTD; |
|
| 570 | + } |
|
| 571 | + |
|
| 572 | + $this->switchAttributeCodePage($codePage); |
|
| 573 | + break; |
|
| 574 | + |
|
| 575 | + default: |
|
| 576 | + if ($token > 128) { |
|
| 577 | + if (isset($attr)) { |
|
| 578 | + $attrs[] = array('attribute' => $attr, |
|
| 579 | + 'value' => $value); |
|
| 580 | + } |
|
| 581 | + $attr = $this->_attributeDTD->toAttribute($token); |
|
| 582 | + } else { |
|
| 583 | + // Value. |
|
| 584 | + $value .= $this->_attributeDTD->toAttribute($token); |
|
| 585 | + } |
|
| 586 | + break; |
|
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | |
@@ -179,16 +179,16 @@ |
||
| 179 | 179 | } else if ($ns == "DAV:") { |
| 180 | 180 | // parse only the essential tags |
| 181 | 181 | switch ($tag) { |
| 182 | - case "write": |
|
| 183 | - $this->locktype = $tag; |
|
| 184 | - break; |
|
| 185 | - case "exclusive": |
|
| 186 | - case "shared": |
|
| 187 | - $this->lockscope = $tag; |
|
| 188 | - break; |
|
| 189 | - case "owner": |
|
| 190 | - $this->collect_owner = true; |
|
| 191 | - break; |
|
| 182 | + case "write": |
|
| 183 | + $this->locktype = $tag; |
|
| 184 | + break; |
|
| 185 | + case "exclusive": |
|
| 186 | + case "shared": |
|
| 187 | + $this->lockscope = $tag; |
|
| 188 | + break; |
|
| 189 | + case "owner": |
|
| 190 | + $this->collect_owner = true; |
|
| 191 | + break; |
|
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 | } |
@@ -365,18 +365,18 @@ discard block |
||
| 365 | 365 | // the registry) |
| 366 | 366 | // TODO: have a seperate PEAR class for mimetype detection? |
| 367 | 367 | switch (strtolower(strrchr(basename($fspath), "."))) { |
| 368 | - case ".html": |
|
| 369 | - $mime_type = "text/html"; |
|
| 370 | - break; |
|
| 371 | - case ".gif": |
|
| 372 | - $mime_type = "image/gif"; |
|
| 373 | - break; |
|
| 374 | - case ".jpg": |
|
| 375 | - $mime_type = "image/jpeg"; |
|
| 376 | - break; |
|
| 377 | - default: |
|
| 378 | - $mime_type = "application/octet-stream"; |
|
| 379 | - break; |
|
| 368 | + case ".html": |
|
| 369 | + $mime_type = "text/html"; |
|
| 370 | + break; |
|
| 371 | + case ".gif": |
|
| 372 | + $mime_type = "image/gif"; |
|
| 373 | + break; |
|
| 374 | + case ".jpg": |
|
| 375 | + $mime_type = "image/jpeg"; |
|
| 376 | + break; |
|
| 377 | + default: |
|
| 378 | + $mime_type = "application/octet-stream"; |
|
| 379 | + break; |
|
| 380 | 380 | } |
| 381 | 381 | } |
| 382 | 382 | |
@@ -633,16 +633,16 @@ discard block |
||
| 633 | 633 | |
| 634 | 634 | if (is_dir($source)) { // resource is a collection |
| 635 | 635 | switch ($options["depth"]) { |
| 636 | - case "infinity": // valid |
|
| 637 | - break; |
|
| 638 | - case "0": // valid for COPY only |
|
| 639 | - if ($del) { // MOVE? |
|
| 640 | - return "400 Bad request"; |
|
| 641 | - } |
|
| 642 | - break; |
|
| 643 | - case "1": // invalid for both COPY and MOVE |
|
| 644 | - default: |
|
| 645 | - return "400 Bad request"; |
|
| 636 | + case "infinity": // valid |
|
| 637 | + break; |
|
| 638 | + case "0": // valid for COPY only |
|
| 639 | + if ($del) { // MOVE? |
|
| 640 | + return "400 Bad request"; |
|
| 641 | + } |
|
| 642 | + break; |
|
| 643 | + case "1": // invalid for both COPY and MOVE |
|
| 644 | + default: |
|
| 645 | + return "400 Bad request"; |
|
| 646 | 646 | } |
| 647 | 647 | } |
| 648 | 648 | |
@@ -816,34 +816,34 @@ discard block |
||
| 816 | 816 | // this can happen if we have allprop and prop in one propfind: |
| 817 | 817 | // <allprop /><prop><blah /></prop>, eg. blah is not automatic returned by allprop |
| 818 | 818 | switch(is_array($props) ? $props[0] : $props) { |
| 819 | - case "all": |
|
| 820 | - // nothing to remove |
|
| 821 | - break; |
|
| 822 | - |
|
| 823 | - case "names": |
|
| 824 | - // only the names of all existing properties were requested |
|
| 825 | - // so we remove all values |
|
| 826 | - unset($prop["val"]); |
|
| 827 | - break; |
|
| 828 | - |
|
| 829 | - default: |
|
| 830 | - $found = false; |
|
| 831 | - |
|
| 832 | - // search property name in requested properties |
|
| 833 | - foreach ((array)$props as $reqprop) { |
|
| 834 | - if ( $reqprop["name"] == $prop["name"] |
|
| 835 | - && @$reqprop["xmlns"] == $prop["ns"]) { |
|
| 836 | - $found = true; |
|
| 837 | - break; |
|
| 838 | - } |
|
| 839 | - } |
|
| 840 | - |
|
| 841 | - // unset property and continue with next one if not found/requested |
|
| 842 | - if (!$found) { |
|
| 843 | - $prop=""; |
|
| 844 | - continue(2); |
|
| 845 | - } |
|
| 846 | - break; |
|
| 819 | + case "all": |
|
| 820 | + // nothing to remove |
|
| 821 | + break; |
|
| 822 | + |
|
| 823 | + case "names": |
|
| 824 | + // only the names of all existing properties were requested |
|
| 825 | + // so we remove all values |
|
| 826 | + unset($prop["val"]); |
|
| 827 | + break; |
|
| 828 | + |
|
| 829 | + default: |
|
| 830 | + $found = false; |
|
| 831 | + |
|
| 832 | + // search property name in requested properties |
|
| 833 | + foreach ((array)$props as $reqprop) { |
|
| 834 | + if ( $reqprop["name"] == $prop["name"] |
|
| 835 | + && @$reqprop["xmlns"] == $prop["ns"]) { |
|
| 836 | + $found = true; |
|
| 837 | + break; |
|
| 838 | + } |
|
| 839 | + } |
|
| 840 | + |
|
| 841 | + // unset property and continue with next one if not found/requested |
|
| 842 | + if (!$found) { |
|
| 843 | + $prop=""; |
|
| 844 | + continue(2); |
|
| 845 | + } |
|
| 846 | + break; |
|
| 847 | 847 | } |
| 848 | 848 | |
| 849 | 849 | // namespace handling |
@@ -964,49 +964,49 @@ discard block |
||
| 964 | 964 | } else if ($prop["ns"] == "DAV:") { |
| 965 | 965 | // some WebDAV properties need special treatment |
| 966 | 966 | switch ($prop["name"]) { |
| 967 | - case "creationdate": |
|
| 968 | - echo ' <'.($this->crrnd?'':'D:')."creationdate ns0:dt=\"dateTime.tz\">" |
|
| 969 | - . gmdate("Y-m-d\\TH:i:s\\Z", $prop['val']) |
|
| 970 | - . '</'.($this->crrnd?'':'D:')."creationdate>\n"; |
|
| 971 | - break; |
|
| 972 | - case "getlastmodified": |
|
| 973 | - echo ' <'.($this->crrnd?'':'D:')."getlastmodified ns0:dt=\"dateTime.rfc1123\">" |
|
| 974 | - . gmdate("D, d M Y H:i:s ", $prop['val']) |
|
| 975 | - . "GMT</".($this->crrnd?'':'D:')."getlastmodified>\n"; |
|
| 976 | - break; |
|
| 977 | - case "supportedlock": |
|
| 978 | - echo ' <'.($this->crrnd?'':'D:')."supportedlock>$prop[val]</".($this->crrnd?'':'D:')."supportedlock>\n"; |
|
| 979 | - break; |
|
| 980 | - case "lockdiscovery": |
|
| 981 | - echo ' <'.($this->crrnd?'':'D:')."lockdiscovery>\n"; |
|
| 982 | - echo $prop["val"]; |
|
| 983 | - echo ' </'.($this->crrnd?'':'D:')."lockdiscovery>\n"; |
|
| 984 | - break; |
|
| 985 | - // the following are non-standard Microsoft extensions to the DAV namespace |
|
| 986 | - case "lastaccessed": |
|
| 987 | - echo ' <'.($this->crrnd?'':'D:')."lastaccessed ns0:dt=\"dateTime.rfc1123\">" |
|
| 988 | - . gmdate("D, d M Y H:i:s ", $prop['val']) |
|
| 989 | - . 'GMT</'.($this->crrnd?'':'D:')."lastaccessed>\n"; |
|
| 990 | - break; |
|
| 991 | - case "ishidden": |
|
| 992 | - echo ' <'.($this->crrnd?'':'D:')."ishidden>" |
|
| 993 | - . is_string($prop['val']) ? $prop['val'] : ($prop['val'] ? 'true' : 'false') |
|
| 994 | - . '</'.($this->crrnd?'':'D:')."</D:ishidden>\n"; |
|
| 995 | - break; |
|
| 996 | - default: |
|
| 997 | - $ns_defs = ''; |
|
| 998 | - if (is_array($prop['val'])) |
|
| 999 | - { |
|
| 1000 | - $hns_hash = $ns_hash; |
|
| 1001 | - $val = $this->_hierarchical_prop_encode($prop['val'], 'DAV:', $ns_defs, $hns_hash); |
|
| 1002 | - } elseif (isset($prop['raw'])) { |
|
| 1003 | - $val = $this->_prop_encode('<![CDATA['.$prop['val'].']]>'); |
|
| 1004 | - } else { |
|
| 1005 | - $val = $this->_prop_encode(htmlspecialchars($prop['val'], ENT_NOQUOTES, 'utf-8')); |
|
| 1006 | - } |
|
| 1007 | - echo ' <'.($this->crrnd?'':'D:')."$prop[name]$ns_defs>$val". |
|
| 1008 | - '</'.($this->crrnd?'':'D:')."$prop[name]>\n"; |
|
| 1009 | - break; |
|
| 967 | + case "creationdate": |
|
| 968 | + echo ' <'.($this->crrnd?'':'D:')."creationdate ns0:dt=\"dateTime.tz\">" |
|
| 969 | + . gmdate("Y-m-d\\TH:i:s\\Z", $prop['val']) |
|
| 970 | + . '</'.($this->crrnd?'':'D:')."creationdate>\n"; |
|
| 971 | + break; |
|
| 972 | + case "getlastmodified": |
|
| 973 | + echo ' <'.($this->crrnd?'':'D:')."getlastmodified ns0:dt=\"dateTime.rfc1123\">" |
|
| 974 | + . gmdate("D, d M Y H:i:s ", $prop['val']) |
|
| 975 | + . "GMT</".($this->crrnd?'':'D:')."getlastmodified>\n"; |
|
| 976 | + break; |
|
| 977 | + case "supportedlock": |
|
| 978 | + echo ' <'.($this->crrnd?'':'D:')."supportedlock>$prop[val]</".($this->crrnd?'':'D:')."supportedlock>\n"; |
|
| 979 | + break; |
|
| 980 | + case "lockdiscovery": |
|
| 981 | + echo ' <'.($this->crrnd?'':'D:')."lockdiscovery>\n"; |
|
| 982 | + echo $prop["val"]; |
|
| 983 | + echo ' </'.($this->crrnd?'':'D:')."lockdiscovery>\n"; |
|
| 984 | + break; |
|
| 985 | + // the following are non-standard Microsoft extensions to the DAV namespace |
|
| 986 | + case "lastaccessed": |
|
| 987 | + echo ' <'.($this->crrnd?'':'D:')."lastaccessed ns0:dt=\"dateTime.rfc1123\">" |
|
| 988 | + . gmdate("D, d M Y H:i:s ", $prop['val']) |
|
| 989 | + . 'GMT</'.($this->crrnd?'':'D:')."lastaccessed>\n"; |
|
| 990 | + break; |
|
| 991 | + case "ishidden": |
|
| 992 | + echo ' <'.($this->crrnd?'':'D:')."ishidden>" |
|
| 993 | + . is_string($prop['val']) ? $prop['val'] : ($prop['val'] ? 'true' : 'false') |
|
| 994 | + . '</'.($this->crrnd?'':'D:')."</D:ishidden>\n"; |
|
| 995 | + break; |
|
| 996 | + default: |
|
| 997 | + $ns_defs = ''; |
|
| 998 | + if (is_array($prop['val'])) |
|
| 999 | + { |
|
| 1000 | + $hns_hash = $ns_hash; |
|
| 1001 | + $val = $this->_hierarchical_prop_encode($prop['val'], 'DAV:', $ns_defs, $hns_hash); |
|
| 1002 | + } elseif (isset($prop['raw'])) { |
|
| 1003 | + $val = $this->_prop_encode('<![CDATA['.$prop['val'].']]>'); |
|
| 1004 | + } else { |
|
| 1005 | + $val = $this->_prop_encode(htmlspecialchars($prop['val'], ENT_NOQUOTES, 'utf-8')); |
|
| 1006 | + } |
|
| 1007 | + echo ' <'.($this->crrnd?'':'D:')."$prop[name]$ns_defs>$val". |
|
| 1008 | + '</'.($this->crrnd?'':'D:')."$prop[name]>\n"; |
|
| 1009 | + break; |
|
| 1010 | 1010 | } |
| 1011 | 1011 | } else { |
| 1012 | 1012 | // allow multiple values and attributes, required eg. for caldav:supported-calendar-component-set |
@@ -1761,9 +1761,9 @@ discard block |
||
| 1761 | 1761 | foreach ($this->_SERVER as $key => $val) { |
| 1762 | 1762 | if (strncmp($key, "HTTP_CONTENT", 11)) continue; |
| 1763 | 1763 | switch ($key) { |
| 1764 | - case 'HTTP_CONTENT_ENCODING': // RFC 2616 14.11 |
|
| 1765 | - switch($this->_SERVER['HTTP_CONTENT_ENCODING']) |
|
| 1766 | - { |
|
| 1764 | + case 'HTTP_CONTENT_ENCODING': // RFC 2616 14.11 |
|
| 1765 | + switch($this->_SERVER['HTTP_CONTENT_ENCODING']) |
|
| 1766 | + { |
|
| 1767 | 1767 | case 'gzip': |
| 1768 | 1768 | case 'deflate': //zlib |
| 1769 | 1769 | if (extension_loaded('zlib')) break; |
@@ -1772,67 +1772,67 @@ discard block |
||
| 1772 | 1772 | $this->http_status('415 Unsupported Media Type'); |
| 1773 | 1773 | echo "The service does not support '$val' content encoding"; |
| 1774 | 1774 | return; |
| 1775 | - } |
|
| 1775 | + } |
|
| 1776 | 1776 | break; |
| 1777 | 1777 | |
| 1778 | - case 'HTTP_CONTENT_LANGUAGE': // RFC 2616 14.12 |
|
| 1779 | - // we assume it is not critical if this one is ignored |
|
| 1780 | - // in the actual PUT implementation ... |
|
| 1781 | - $options["content_language"] = $val; |
|
| 1782 | - break; |
|
| 1778 | + case 'HTTP_CONTENT_LANGUAGE': // RFC 2616 14.12 |
|
| 1779 | + // we assume it is not critical if this one is ignored |
|
| 1780 | + // in the actual PUT implementation ... |
|
| 1781 | + $options["content_language"] = $val; |
|
| 1782 | + break; |
|
| 1783 | 1783 | |
| 1784 | - case 'HTTP_CONTENT_LENGTH': |
|
| 1785 | - // defined on IIS and has the same value as CONTENT_LENGTH |
|
| 1786 | - break; |
|
| 1784 | + case 'HTTP_CONTENT_LENGTH': |
|
| 1785 | + // defined on IIS and has the same value as CONTENT_LENGTH |
|
| 1786 | + break; |
|
| 1787 | 1787 | |
| 1788 | - case 'HTTP_CONTENT_LOCATION': // RFC 2616 14.14 |
|
| 1789 | - /* The meaning of the Content-Location header in PUT |
|
| 1788 | + case 'HTTP_CONTENT_LOCATION': // RFC 2616 14.14 |
|
| 1789 | + /* The meaning of the Content-Location header in PUT |
|
| 1790 | 1790 | or POST requests is undefined; servers are free |
| 1791 | 1791 | to ignore it in those cases. */ |
| 1792 | - break; |
|
| 1793 | - |
|
| 1794 | - case 'HTTP_CONTENT_RANGE': // RFC 2616 14.16 |
|
| 1795 | - // single byte range requests are supported |
|
| 1796 | - // the header format is also specified in RFC 2616 14.16 |
|
| 1797 | - // TODO we have to ensure that implementations support this or send 501 instead |
|
| 1798 | - $matches = null; |
|
| 1799 | - if (!preg_match('@bytes\s+(\d+)-(\d+)/((\d+)|\*)@', $val, $matches)) { |
|
| 1800 | - $this->http_status("400 bad request"); |
|
| 1801 | - echo "The service does only support single byte ranges"; |
|
| 1802 | - return; |
|
| 1803 | - } |
|
| 1804 | - |
|
| 1805 | - $range = array("start" => $matches[1], "end" => $matches[2]); |
|
| 1806 | - if (is_numeric($matches[3])) { |
|
| 1807 | - $range["total_length"] = $matches[3]; |
|
| 1808 | - } |
|
| 1809 | - |
|
| 1810 | - if (!isset($options['ranges'])) { |
|
| 1811 | - $options['ranges'] = array(); |
|
| 1812 | - } |
|
| 1813 | - |
|
| 1814 | - $options["ranges"][] = $range; |
|
| 1815 | - |
|
| 1816 | - // TODO make sure the implementation supports partial PUT |
|
| 1817 | - // this has to be done in advance to avoid data being overwritten |
|
| 1818 | - // on implementations that do not support this ... |
|
| 1819 | - break; |
|
| 1820 | - |
|
| 1821 | - case 'HTTP_CONTENT_TYPE': |
|
| 1822 | - // defined on IIS and has the same value as CONTENT_TYPE |
|
| 1823 | - break; |
|
| 1824 | - |
|
| 1825 | - case 'HTTP_CONTENT_MD5': // RFC 2616 14.15 |
|
| 1826 | - // TODO: maybe we can just pretend here? |
|
| 1827 | - $this->http_status("501 not implemented"); |
|
| 1828 | - echo "The service does not support content MD5 checksum verification"; |
|
| 1829 | - return; |
|
| 1830 | - |
|
| 1831 | - default: |
|
| 1832 | - // any other unknown Content-* headers |
|
| 1833 | - $this->http_status("501 not implemented"); |
|
| 1834 | - echo "The service does not support '$key'"; |
|
| 1835 | - return; |
|
| 1792 | + break; |
|
| 1793 | + |
|
| 1794 | + case 'HTTP_CONTENT_RANGE': // RFC 2616 14.16 |
|
| 1795 | + // single byte range requests are supported |
|
| 1796 | + // the header format is also specified in RFC 2616 14.16 |
|
| 1797 | + // TODO we have to ensure that implementations support this or send 501 instead |
|
| 1798 | + $matches = null; |
|
| 1799 | + if (!preg_match('@bytes\s+(\d+)-(\d+)/((\d+)|\*)@', $val, $matches)) { |
|
| 1800 | + $this->http_status("400 bad request"); |
|
| 1801 | + echo "The service does only support single byte ranges"; |
|
| 1802 | + return; |
|
| 1803 | + } |
|
| 1804 | + |
|
| 1805 | + $range = array("start" => $matches[1], "end" => $matches[2]); |
|
| 1806 | + if (is_numeric($matches[3])) { |
|
| 1807 | + $range["total_length"] = $matches[3]; |
|
| 1808 | + } |
|
| 1809 | + |
|
| 1810 | + if (!isset($options['ranges'])) { |
|
| 1811 | + $options['ranges'] = array(); |
|
| 1812 | + } |
|
| 1813 | + |
|
| 1814 | + $options["ranges"][] = $range; |
|
| 1815 | + |
|
| 1816 | + // TODO make sure the implementation supports partial PUT |
|
| 1817 | + // this has to be done in advance to avoid data being overwritten |
|
| 1818 | + // on implementations that do not support this ... |
|
| 1819 | + break; |
|
| 1820 | + |
|
| 1821 | + case 'HTTP_CONTENT_TYPE': |
|
| 1822 | + // defined on IIS and has the same value as CONTENT_TYPE |
|
| 1823 | + break; |
|
| 1824 | + |
|
| 1825 | + case 'HTTP_CONTENT_MD5': // RFC 2616 14.15 |
|
| 1826 | + // TODO: maybe we can just pretend here? |
|
| 1827 | + $this->http_status("501 not implemented"); |
|
| 1828 | + echo "The service does not support content MD5 checksum verification"; |
|
| 1829 | + return; |
|
| 1830 | + |
|
| 1831 | + default: |
|
| 1832 | + // any other unknown Content-* headers |
|
| 1833 | + $this->http_status("501 not implemented"); |
|
| 1834 | + echo "The service does not support '$key'"; |
|
| 1835 | + return; |
|
| 1836 | 1836 | } |
| 1837 | 1837 | } |
| 1838 | 1838 | |
@@ -2390,34 +2390,34 @@ discard block |
||
| 2390 | 2390 | |
| 2391 | 2391 | // now it depends on what we found |
| 2392 | 2392 | switch ($c) { |
| 2393 | - case "<": |
|
| 2394 | - // URIs are enclosed in <...> |
|
| 2395 | - $pos2 = strpos($string, ">", $pos); |
|
| 2396 | - $uri = substr($string, $pos, $pos2 - $pos); |
|
| 2397 | - $pos = $pos2 + 1; |
|
| 2398 | - return array("URI", $uri); |
|
| 2399 | - |
|
| 2400 | - case "[": |
|
| 2401 | - //Etags are enclosed in [...] |
|
| 2402 | - if ($string{$pos} == "W") { |
|
| 2403 | - $type = "ETAG_WEAK"; |
|
| 2404 | - $pos += 2; |
|
| 2405 | - } else { |
|
| 2406 | - $type = "ETAG_STRONG"; |
|
| 2407 | - } |
|
| 2408 | - $pos2 = strpos($string, "]", $pos); |
|
| 2409 | - $etag = substr($string, $pos + 1, $pos2 - $pos - 2); |
|
| 2410 | - $pos = $pos2 + 1; |
|
| 2411 | - return array($type, $etag); |
|
| 2412 | - |
|
| 2413 | - case "N": |
|
| 2414 | - // "N" indicates negation |
|
| 2415 | - $pos += 2; |
|
| 2416 | - return array("NOT", "Not"); |
|
| 2417 | - |
|
| 2418 | - default: |
|
| 2419 | - // anything else is passed verbatim char by char |
|
| 2420 | - return array("CHAR", $c); |
|
| 2393 | + case "<": |
|
| 2394 | + // URIs are enclosed in <...> |
|
| 2395 | + $pos2 = strpos($string, ">", $pos); |
|
| 2396 | + $uri = substr($string, $pos, $pos2 - $pos); |
|
| 2397 | + $pos = $pos2 + 1; |
|
| 2398 | + return array("URI", $uri); |
|
| 2399 | + |
|
| 2400 | + case "[": |
|
| 2401 | + //Etags are enclosed in [...] |
|
| 2402 | + if ($string{$pos} == "W") { |
|
| 2403 | + $type = "ETAG_WEAK"; |
|
| 2404 | + $pos += 2; |
|
| 2405 | + } else { |
|
| 2406 | + $type = "ETAG_STRONG"; |
|
| 2407 | + } |
|
| 2408 | + $pos2 = strpos($string, "]", $pos); |
|
| 2409 | + $etag = substr($string, $pos + 1, $pos2 - $pos - 2); |
|
| 2410 | + $pos = $pos2 + 1; |
|
| 2411 | + return array($type, $etag); |
|
| 2412 | + |
|
| 2413 | + case "N": |
|
| 2414 | + // "N" indicates negation |
|
| 2415 | + $pos += 2; |
|
| 2416 | + return array("NOT", "Not"); |
|
| 2417 | + |
|
| 2418 | + default: |
|
| 2419 | + // anything else is passed verbatim char by char |
|
| 2420 | + return array("CHAR", $c); |
|
| 2421 | 2421 | } |
| 2422 | 2422 | } |
| 2423 | 2423 | |
@@ -2461,33 +2461,33 @@ discard block |
||
| 2461 | 2461 | continue; |
| 2462 | 2462 | } |
| 2463 | 2463 | switch ($token[0]) { |
| 2464 | - case "CHAR": |
|
| 2465 | - switch ($token[1]) { |
|
| 2466 | - case "(": |
|
| 2467 | - $level++; |
|
| 2468 | - break; |
|
| 2469 | - case ")": |
|
| 2470 | - $level--; |
|
| 2471 | - break; |
|
| 2472 | - default: |
|
| 2473 | - return false; |
|
| 2474 | - } |
|
| 2464 | + case "CHAR": |
|
| 2465 | + switch ($token[1]) { |
|
| 2466 | + case "(": |
|
| 2467 | + $level++; |
|
| 2468 | + break; |
|
| 2469 | + case ")": |
|
| 2470 | + $level--; |
|
| 2471 | + break; |
|
| 2472 | + default: |
|
| 2473 | + return false; |
|
| 2474 | + } |
|
| 2475 | 2475 | break; |
| 2476 | 2476 | |
| 2477 | - case "URI": |
|
| 2478 | - $list[] = $not."<$token[1]>"; |
|
| 2479 | - break; |
|
| 2477 | + case "URI": |
|
| 2478 | + $list[] = $not."<$token[1]>"; |
|
| 2479 | + break; |
|
| 2480 | 2480 | |
| 2481 | - case "ETAG_WEAK": |
|
| 2482 | - $list[] = $not."[W/'$token[1]']>"; |
|
| 2483 | - break; |
|
| 2481 | + case "ETAG_WEAK": |
|
| 2482 | + $list[] = $not."[W/'$token[1]']>"; |
|
| 2483 | + break; |
|
| 2484 | 2484 | |
| 2485 | - case "ETAG_STRONG": |
|
| 2486 | - $list[] = $not."['$token[1]']>"; |
|
| 2487 | - break; |
|
| 2485 | + case "ETAG_STRONG": |
|
| 2486 | + $list[] = $not."['$token[1]']>"; |
|
| 2487 | + break; |
|
| 2488 | 2488 | |
| 2489 | - default: |
|
| 2490 | - return false; |
|
| 2489 | + default: |
|
| 2490 | + return false; |
|
| 2491 | 2491 | } |
| 2492 | 2492 | $not = ""; |
| 2493 | 2493 | } |
@@ -506,12 +506,12 @@ |
||
| 506 | 506 | |
| 507 | 507 | // always add the fallback directories as last resort |
| 508 | 508 | switch (strtolower($type)) { |
| 509 | - case 'template': |
|
| 510 | - $this->addPath($type, '.'); |
|
| 511 | - break; |
|
| 512 | - case 'resource': |
|
| 513 | - $this->addPath($type, dirname(__FILE__) . '/Savant2/'); |
|
| 514 | - break; |
|
| 509 | + case 'template': |
|
| 510 | + $this->addPath($type, '.'); |
|
| 511 | + break; |
|
| 512 | + case 'resource': |
|
| 513 | + $this->addPath($type, dirname(__FILE__) . '/Savant2/'); |
|
| 514 | + break; |
|
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | // actually add the user-specified directories |
@@ -1023,17 +1023,17 @@ discard block |
||
| 1023 | 1023 | |
| 1024 | 1024 | switch (strtolower($action)) { |
| 1025 | 1025 | |
| 1026 | - case 'start': |
|
| 1027 | - return $this->_blockStart($label, $type, $float, $clear); |
|
| 1028 | - break; |
|
| 1026 | + case 'start': |
|
| 1027 | + return $this->_blockStart($label, $type, $float, $clear); |
|
| 1028 | + break; |
|
| 1029 | 1029 | |
| 1030 | - case 'split': |
|
| 1031 | - return $this->_blockSplit(); |
|
| 1032 | - break; |
|
| 1030 | + case 'split': |
|
| 1031 | + return $this->_blockSplit(); |
|
| 1032 | + break; |
|
| 1033 | 1033 | |
| 1034 | - case 'end': |
|
| 1035 | - return $this->_blockEnd(); |
|
| 1036 | - break; |
|
| 1034 | + case 'end': |
|
| 1035 | + return $this->_blockEnd(); |
|
| 1036 | + break; |
|
| 1037 | 1037 | |
| 1038 | 1038 | } |
| 1039 | 1039 | |
@@ -1577,15 +1577,15 @@ discard block |
||
| 1577 | 1577 | // end the current block and start a new one |
| 1578 | 1578 | switch ($this->_blockType) { |
| 1579 | 1579 | |
| 1580 | - case 'row': |
|
| 1581 | - $xhtml .= '</tr>'; |
|
| 1582 | - $xhtml .= $this->_tag('tr'); |
|
| 1583 | - break; |
|
| 1580 | + case 'row': |
|
| 1581 | + $xhtml .= '</tr>'; |
|
| 1582 | + $xhtml .= $this->_tag('tr'); |
|
| 1583 | + break; |
|
| 1584 | 1584 | |
| 1585 | - case 'col': |
|
| 1586 | - $xhtml .= '</table>'; |
|
| 1587 | - $xhtml .= $this->_tag('table'); |
|
| 1588 | - break; |
|
| 1585 | + case 'col': |
|
| 1586 | + $xhtml .= '</table>'; |
|
| 1587 | + $xhtml .= $this->_tag('table'); |
|
| 1588 | + break; |
|
| 1589 | 1589 | } |
| 1590 | 1590 | |
| 1591 | 1591 | // done! |