Changeset 12752 for trunk/wp-app.php
- Timestamp:
- 01/18/2010 08:34:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-app.php
r12734 r12752 285 285 286 286 // redirect to /service in case no path is found. 287 if (strlen($path) == 0 || $path == '/')287 if (strlen($path) == 0 || $path == '/') 288 288 $this->redirect($this->get_service_url()); 289 289 … … 664 664 665 665 $parser = new AtomParser(); 666 if (!$parser->parse()) {666 if (!$parser->parse()) { 667 667 $this->bad_request(); 668 668 } … … 806 806 $location = "{$upload_dir['basedir']}/{$location}"; 807 807 808 if (!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))808 if (!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext'])) 809 809 $this->internal_error(__('Error ocurred while accessing post metadata for file location.')); 810 810 … … 900 900 function get_attachments_url($page = null) { 901 901 $url = $this->app_base . $this->MEDIA_PATH; 902 if (isset($page) && is_int($page)) {902 if (isset($page) && is_int($page)) { 903 903 $url .= "/$page"; 904 904 } … … 937 937 */ 938 938 function get_entry_url($postID = null) { 939 if (!isset($postID)) {939 if (!isset($postID)) { 940 940 global $post; 941 941 $postID = (int) $post->ID; … … 968 968 */ 969 969 function get_media_url($postID = null) { 970 if (!isset($postID)) {970 if (!isset($postID)) { 971 971 global $post; 972 972 $postID = (int) $post->ID; … … 1001 1001 log_app('function',"set_current_entry($postID)"); 1002 1002 1003 if (!isset($postID)) {1003 if (!isset($postID)) { 1004 1004 // $this->bad_request(); 1005 1005 $this->not_found(); … … 1008 1008 $entry = wp_get_single_post($postID,ARRAY_A); 1009 1009 1010 if (!isset($entry) || !isset($entry['ID']))1010 if (!isset($entry) || !isset($entry['ID'])) 1011 1011 $this->not_found(); 1012 1012 … … 1059 1059 $this->ENTRY_PATH = $post_type; 1060 1060 1061 if (!isset($page)) {1061 if (!isset($page)) { 1062 1062 $page = 1; 1063 1063 } … … 1088 1088 <subtitle type="text"><?php bloginfo_rss("description") ?></subtitle> 1089 1089 <link rel="first" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url() ?>" /> 1090 <?php if (isset($prev_page)): ?>1090 <?php if (isset($prev_page)): ?> 1091 1091 <link rel="previous" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url($prev_page) ?>" /> 1092 1092 <?php endif; ?> 1093 <?php if (isset($next_page)): ?>1093 <?php if (isset($next_page)): ?> 1094 1094 <link rel="next" type="<?php echo $this->ATOM_CONTENT_TYPE ?>" href="<?php $this->the_entries_url($next_page) ?>" /> 1095 1095 <?php endif; ?> … … 1172 1172 <?php } ?> 1173 1173 </author> 1174 <?php if ($GLOBALS['post']->post_type == 'attachment') { ?>1174 <?php if ($GLOBALS['post']->post_type == 'attachment') { ?> 1175 1175 <link rel="edit-media" href="<?php $this->the_media_url() ?>" /> 1176 1176 <content type="<?php echo $GLOBALS['post']->post_mime_type ?>" src="<?php the_guid(); ?>"/> … … 1365 1365 } 1366 1366 header("Content-Type: $this->ATOM_CONTENT_TYPE"); 1367 if (isset($ctloc))1367 if (isset($ctloc)) 1368 1368 header('Content-Location: ' . $ctloc); 1369 1369 header('Location: ' . $edit); … … 1420 1420 header('Content-Disposition: attachment; filename=atom.xml'); 1421 1421 header('Date: '. date('r')); 1422 if ($this->do_output)1422 if ($this->do_output) 1423 1423 echo $xml; 1424 1424 log_app('function', "output:\n$xml"); … … 1459 1459 // if using mod_rewrite/ENV hack 1460 1460 // http://www.besthostratings.com/articles/http-auth-php-cgi.html 1461 if (isset($_SERVER['HTTP_AUTHORIZATION'])) {1461 if (isset($_SERVER['HTTP_AUTHORIZATION'])) { 1462 1462 list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = 1463 1463 explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6))); … … 1470 1470 1471 1471 // If Basic Auth is working... 1472 if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {1472 if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { 1473 1473 log_app("Basic Auth",$_SERVER['PHP_AUTH_USER']); 1474 1474 … … 1494 1494 function get_accepted_content_type($types = null) { 1495 1495 1496 if (!isset($types)) {1496 if (!isset($types)) { 1497 1497 $types = $this->media_content_types; 1498 1498 } 1499 1499 1500 if (!isset($_SERVER['CONTENT_LENGTH']) || !isset($_SERVER['CONTENT_TYPE'])) {1500 if (!isset($_SERVER['CONTENT_LENGTH']) || !isset($_SERVER['CONTENT_TYPE'])) { 1501 1501 $this->length_required(); 1502 1502 } … … 1509 1509 foreach($types as $t) { 1510 1510 list($acceptedType,$acceptedSubtype) = explode('/',$t); 1511 if ($acceptedType == '*' || $acceptedType == $type) {1512 if ($acceptedSubtype == '*' || $acceptedSubtype == $subtype)1511 if ($acceptedType == '*' || $acceptedType == $type) { 1512 if ($acceptedSubtype == '*' || $acceptedSubtype == $subtype) 1513 1513 return $type . "/" . $subtype; 1514 1514 } … … 1525 1525 function process_conditionals() { 1526 1526 1527 if (empty($this->params)) return;1528 if ($_SERVER['REQUEST_METHOD'] == 'DELETE') return;1527 if (empty($this->params)) return; 1528 if ($_SERVER['REQUEST_METHOD'] == 'DELETE') return; 1529 1529 1530 1530 switch($this->params[0]) { … … 1577 1577 1578 1578 $match = false; 1579 if (!preg_match("/(\d{4}-\d{2}-\d{2})T(\d{2}\:\d{2}\:\d{2})\.?\d{0,3}(Z|[+-]+\d{2}\:\d{2})/", $str, $match))1579 if (!preg_match("/(\d{4}-\d{2}-\d{2})T(\d{2}\:\d{2}\:\d{2})\.?\d{0,3}(Z|[+-]+\d{2}\:\d{2})/", $str, $match)) 1580 1580 return false; 1581 1581 1582 if ($match[3] == 'Z')1582 if ($match[3] == 'Z') 1583 1583 $match[3] == '+0000'; 1584 1584 … … 1598 1598 $pubtime = $this->rfc3339_str2time($published); 1599 1599 1600 if (!$pubtime) {1600 if (!$pubtime) { 1601 1601 return array(current_time('mysql'),current_time('mysql',1)); 1602 1602 } else {
Note: See TracChangeset
for help on using the changeset viewer.