// 6 // Force UTF-8 behaviour for server (cannot be moved into top.inc.php which is not included into every file)
if (!defined('UNIT_TEST_MODE')) {
- header('Content-Type: text/html; charset=utf-8');
+ //API files define that, so we need a way to support both of them
+ if (!isset($httpContentType)) {
+ $httpContentType = 'text/html';
+ }
+ if ($httpContentType !== false) {
+ header('Content-Type: ' . $httpContentType . '; charset=utf-8');
+ }
}
?>
***************************************************************************/
/* Return a json file with list of linked tags */
-
+$httpContentType = 'application/json';
require_once '../www-header.php';
/* Service creation: only useful services are created */
***************************************************************************/
/* Return a json file with list of tags according to current user and sort by popularity*/
-
+$httpContentType = 'application/json';
require_once '../www-header.php';
/* Service creation: only useful services are created */
***************************************************************************/
/* Return a json file with list of tags according to current user and sort by popularity*/
-
+$httpContentType = 'application/json';
require_once '../www-header.php';
/* Service creation: only useful services are created */
***************************************************************************/
/* Return a json file with list of linked tags */
-
+$httpContentType = 'application/json';
require_once '../www-header.php';
/* Service creation: only useful services are created */
***************************************************************************/
/* Return a json file with list of tags according to current user and sort by popularity*/
-
+$httpContentType = 'application/json';
require_once '../www-header.php';
/* Service creation: only useful services are created */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-header('Content-Type: text/xml; charset=UTF-8');
header('Last-Modified: '. gmdate("D, d M Y H:i:s") .' GMT');
header('Cache-Control: no-cache, must-revalidate');
+$httpContentType = 'text/xml';
require_once 'www-header.php';
/* Service creation: only useful services are created */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-header('Content-Type: text/xml; charset=UTF-8');
header("Last-Modified: ". gmdate("D, d M Y H:i:s") ." GMT");
header("Cache-Control: no-cache, must-revalidate");
+$httpContentType = 'text/xml';
require_once 'www-header.php';
/* Managing all possible inputs */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-header('Content-Type: text/xml; charset=UTF-8');
header("Last-Modified: ". gmdate("D, d M Y H:i:s") ." GMT");
header("Cache-Control: no-cache, must-revalidate");
+$httpContentType = 'text/xml';
require_once 'www-header.php';
/* Service creation: only useful services are created */
/**
* We re-use vote.php but set the ajax flag
*/
+$httpContentType = 'text/xml';
$GLOBALS['ajaxRequest'] = true;
require 'vote.php';
$template = 'bookmarks-vote.inc.tpl.php';
}
-header('Content-Type: text/xml; charset=utf-8');
echo '<voteresult><bookmark>' . $bookmark . '</bookmark>'
. '<html xmlns="http://www.w3.org/1999/xhtml">';
$ts->loadTemplate(
// Export in CSV format in order to allow the import into a spreadsheet tool like Excel
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once '../www-header.php';
+$httpContentType = 'application/csv-tab-delimited-table';
+require_once 'httpauth.inc.php';
+header("Content-disposition: filename=exportBookmarks.csv");
/* Service creation: only useful services are created */
$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark');
// Get the posts relevant to the passed-in variables.
$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag, NULL, getSortOrder());
-header("Content-Type: application/csv-tab-delimited-table;charset=UTF-8");
-header("Content-disposition: filename=exportBookmarks.csv");
-
//columns titles
echo 'url;title;tags;description';
echo "\n";
// Force HTTP authentication first!
//require_once('httpauth.inc.php');
+$httpContentType = false;
require_once '../www-header.php';
if($GLOBALS['enableGoogleCustomSearch'] == false) {
// Set up the plain file and output all the posts.
-header('Content-Type: text/plain');
+header('Content-Type: text/plain; charset=utf-8');
if(!$xml) {
header('Content-Type: text/plain');
foreach($bookmarks['bookmarks'] as $row) {
}
}
} else {
- header('Content-Type: application/xml');
+ header('Content-Type: text/xml');
echo '<GoogleCustomizations>'."\n";
echo ' <Annotations>'."\n";
foreach($bookmarks['bookmarks'] as $row) {
<?php
/* Export data with semantic format (SIOC: http://sioc-project.org/, FOAF, SKOS, Annotea Ontology) */
+$httpContentType = 'text/xml';
require_once '../www-header.php';
-header('Content-Type: text/xml; charset=utf-8'); //we change headers html defined in headers.inc.php
/* Service creation: only useful services are created */
$userservice =SemanticScuttle_Service_Factory::get('User');
<?php
+$httpContentType = 'text/xml';
require_once '../www-header.php';
-header("Content-type: text/xml");
?>
<?xml version="1.0" encoding="utf-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
// - No support for 'replace' variable
// Force HTTP authentication
-require_once('httpauth.inc.php');
-require_once '../www-header.php';
+$httpContentType = 'text/xml';
+require_once 'httpauth.inc.php';
/* Service creation: only useful services are created */
$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark');
}
// Set up the XML file and output the result.
-header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<result code="'. ($added ? 'done' : 'something went wrong') .'" />';
?>
\ No newline at end of file
// - doesn't include the filtered tag as an attribute on the root element (we do)
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once '../www-header.php';
+$httpContentType = 'text/xml';
+require_once 'httpauth.inc.php';
/* Service creation: only useful services are created */
$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark');
$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag);
// Set up the XML file and output all the posts.
-header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<posts update="'. gmdate('Y-m-d\TH:i:s\Z') .'" user="'. htmlspecialchars($currentUser->getUsername()) .'"'. (is_null($tag) ? '' : ' tag="'. htmlspecialchars($tag) .'"') .">\r\n";
*/
// Force HTTP authentication first!
+$httpContentType = 'text/xml';
require_once 'httpauth.inc.php';
/* Service creation: only useful services are created */
);
// Set up the XML file and output all the tags.
-header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<dates tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentUser->getUsername(), 'xml') ."\">\r\n";
// - doesn't set the Content-Type to text/xml (we do).
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once '../www-header.php';
+$httpContentType = 'text/xml';
+require_once 'httpauth.inc.php';
/* Service creation: only useful services are created */
$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark');
}
// Set up the XML file and output the result.
-header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<result code="'. ($deleted ? 'done' : 'something went wrong') .'" />';
?>
\ No newline at end of file
*/
// Force HTTP authentication first!
+$httpContentType = 'text/xml';
require_once 'httpauth.inc.php';
/* Service creation: only useful services are created */
// Set up the XML file and output all the tags.
-header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<posts'. (is_null($dtstart) ? '' : ' dt="'. $dtstart .'"') .' tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentUser->getUsername(), 'xml') ."\">\r\n";
// Force HTTP authentication first!
//require_once('httpauth.inc.php');
+$httpContentType = 'text/xml';
require_once '../www-header.php';
/* Service creation: only useful services are created */
$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, NULL, $tag);
// Set up the XML file and output all the posts.
-header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<posts update="'. gmdate('Y-m-d\TH:i:s\Z') .'" '. (is_null($tag) ? '' : ' tag="'. htmlspecialchars($tag) .'"') .">\r\n";
$countMax = 100;
// Force HTTP authentication first!
+$httpContentType = 'text/xml';
require_once 'httpauth.inc.php';
/* Service creation: only useful services are created */
// Set up the XML file and output all the tags.
-header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<posts tag="'. (is_null($tag) ? '' : filter($tag, 'xml')) .'" user="'. filter($currentUser->getUsername(), 'xml') ."\">\r\n";
// - doesn't set the Content-Type to text/xml (we do).
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once '../www-header.php';
+$httpContentType = 'text/xml';
+require_once 'httpauth.inc.php';
/* Service creation: only useful services are created */
$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark');
// Set up the XML file and output all the tags.
-header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
foreach($bookmarks['bookmarks'] as $row) {
echo '<update time="'. gmdate('Y-m-d\TH:i:s\Z', strtotime($row['bDatetime'])) .'" />';
// - tags can't have spaces
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once '../www-header.php';
+$httpContentType = 'text/xml';
+require_once 'httpauth.inc.php';
/* Service creation: only useful services are created */
$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag');
$tags =& $b2tservice->getTags($userservice->getCurrentUserId());
// Set up the XML file and output all the tags.
-header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo "<tags>\r\n";
foreach($tags as $row) {
// - oddly, returns an entirely different result (<result></result>) than the other API calls.
// Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once '../www-header.php';
+$httpContentType = 'text/xml';
+require_once 'httpauth.inc.php';
/* Service creation: only useful services are created */
$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag');
}
// Set up the XML file and output the result.
-header('Content-Type: text/xml');
echo '<?xml version="1.0" standalone="yes" ?'.">\r\n";
echo '<result>'. ($renamed ? 'done' : 'something went wrong') .'</result>';
?>
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
+$httpContentType = false;
require_once 'www-header.php';
if (!$GLOBALS['shorturl']) {
<?php
-header('Content-Type: text/javascript');
$GLOBALS['saveInLastUrl'] = false;
+$httpContentType = 'text/javascript';
require_once 'www-header.php';
require_once 'SemanticScuttle/functions.php';
$player_root = ROOT .'includes/player/';
* @link http://sourceforge.net/projects/semanticscuttle
*/
+$httpContentType = 'application/rss+xml';
require_once 'www-header.php';
/* Service creation: only useful services are created */
$bookmarkservice = SemanticScuttle_Service_Factory::get('Bookmark');
$cacheservice = SemanticScuttle_Service_Factory::get('Cache');
-header('Content-Type: application/rss+xml; charset=utf-8');
-
if (isset($_SERVER['PATH_INFO']) && strlen($_SERVER['PATH_INFO']) >1) {
list($url, $user, $cat) = explode('/', $_SERVER['PATH_INFO']);
} else {