die forcefully but gracefully on missing api templates

This commit is contained in:
friendica 2013-01-23 17:07:55 -08:00
parent 759f36e7e8
commit b3b0a9de24
4 changed files with 66 additions and 61 deletions

View File

@ -12,7 +12,7 @@ require_once('library/Mobile_Detect/Mobile_Detect.php');
require_once('include/features.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.1.1592' );
define ( 'FRIENDICA_VERSION', '3.1.1597' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1158 );

View File

@ -450,6 +450,11 @@
case "xml":
$data = array_xmlify($data);
$tpl = get_markup_template("api_".$templatename."_".$type.".tpl");
if(! $tpl) {
header ("Content-Type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n".'<status><error>not implemented</error></status>';
killme();
}
$ret = replace_macros($tpl, $data);
break;
case "json":

View File

@ -41,7 +41,7 @@ function queue_run(&$argv, &$argc){
$interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
$r = q("select * from deliverq where 1");
if(count($r)) {
if($r) {
foreach($r as $rr) {
logger('queue: deliverq');
proc_run('php','include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']);
@ -53,7 +53,7 @@ function queue_run(&$argv, &$argc){
$r = q("SELECT `queue`.*, `contact`.`name`, `contact`.`uid` FROM `queue`
LEFT JOIN `contact` ON `queue`.`cid` = `contact`.`id`
WHERE `queue`.`created` < UTC_TIMESTAMP() - INTERVAL 3 DAY");
if(count($r)) {
if($r) {
foreach($r as $rr) {
logger('Removing expired queue item for ' . $rr['name'] . ', uid=' . $rr['uid']);
logger('Expired queue data :' . $rr['content'], LOGGER_DATA);
@ -73,7 +73,7 @@ function queue_run(&$argv, &$argc){
$r = q("SELECT `id` FROM `queue` WHERE (( `created` > UTC_TIMESTAMP() - INTERVAL 12 HOUR && `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ) OR ( `last` < UTC_TIMESTAMP() - INTERVAL 1 HOUR ))");
}
if(! count($r)){
if(! $r){
return;
}

View File

@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 3.1.1592\n"
"Project-Id-Version: 3.1.1597\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-01-18 10:00-0800\n"
"POT-Creation-Date: 2013-01-23 10:00-0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -61,7 +61,7 @@ msgstr ""
#: ../../addon/fbpost/fbpost.php:176
#: ../../addon/dav/friendica/layout.fnk.php:354
#: ../../addon/tumblr/tumblr.php:34 ../../include/items.php:3987
#: ../../index.php:340 ../../addon.old/facebook/facebook.php:510
#: ../../index.php:341 ../../addon.old/facebook/facebook.php:510
#: ../../addon.old/facebook/facebook.php:516
#: ../../addon.old/fbpost/fbpost.php:159 ../../addon.old/fbpost/fbpost.php:165
#: ../../addon.old/dav/friendica/layout.fnk.php:354
@ -242,11 +242,11 @@ msgstr ""
msgid "Help"
msgstr ""
#: ../../mod/help.php:90 ../../index.php:225
#: ../../mod/help.php:90 ../../index.php:226
msgid "Not Found"
msgstr ""
#: ../../mod/help.php:93 ../../index.php:228
#: ../../mod/help.php:93 ../../index.php:229
msgid "Page not found."
msgstr ""
@ -289,7 +289,7 @@ msgid "link to source"
msgstr ""
#: ../../mod/events.php:358 ../../view/theme/diabook/theme.php:91
#: ../../include/nav.php:52 ../../boot.php:1836
#: ../../include/nav.php:52 ../../boot.php:1857
msgid "Events"
msgstr ""
@ -348,7 +348,7 @@ msgstr ""
#: ../../mod/events.php:459 ../../mod/directory.php:134
#: ../../addon/forumdirectory/forumdirectory.php:156
#: ../../include/event.php:40 ../../include/bb2diaspora.php:415
#: ../../boot.php:1358
#: ../../boot.php:1379
msgid "Location:"
msgstr ""
@ -438,7 +438,7 @@ msgstr ""
msgid "No"
msgstr ""
#: ../../mod/photos.php:51 ../../boot.php:1829
#: ../../mod/photos.php:51 ../../boot.php:1850
msgid "Photo Albums"
msgstr ""
@ -1432,7 +1432,7 @@ msgid "is interested in:"
msgstr ""
#: ../../mod/match.php:58 ../../mod/suggest.php:59
#: ../../include/contact_widgets.php:9 ../../boot.php:1296
#: ../../include/contact_widgets.php:9 ../../boot.php:1317
msgid "Connect"
msgstr ""
@ -2106,7 +2106,7 @@ msgid ""
"Password reset failed."
msgstr ""
#: ../../mod/lostpass.php:84 ../../boot.php:1030
#: ../../mod/lostpass.php:84 ../../boot.php:1051
msgid "Password Reset"
msgstr ""
@ -2786,7 +2786,7 @@ msgstr ""
msgid "Invalid contact."
msgstr ""
#: ../../mod/notes.php:44 ../../boot.php:1843
#: ../../mod/notes.php:44 ../../boot.php:1864
msgid "Personal Notes"
msgstr ""
@ -2960,7 +2960,7 @@ msgstr ""
#: ../../mod/newmember.php:32 ../../mod/profperm.php:103
#: ../../view/theme/diabook/theme.php:88 ../../include/profile_advanced.php:7
#: ../../include/profile_advanced.php:84 ../../include/nav.php:50
#: ../../boot.php:1819
#: ../../boot.php:1840
msgid "Profile"
msgstr ""
@ -3131,7 +3131,7 @@ msgstr ""
msgid "Group name changed."
msgstr ""
#: ../../mod/group.php:72 ../../mod/profperm.php:19 ../../index.php:339
#: ../../mod/group.php:72 ../../mod/profperm.php:19 ../../index.php:340
msgid "Permission denied"
msgstr ""
@ -3265,7 +3265,7 @@ msgstr ""
msgid "Choose a nickname: "
msgstr ""
#: ../../mod/register.php:275 ../../include/nav.php:81 ../../boot.php:991
#: ../../mod/register.php:275 ../../include/nav.php:81 ../../boot.php:1012
msgid "Register"
msgstr ""
@ -3322,7 +3322,7 @@ msgid "Access denied."
msgstr ""
#: ../../mod/fbrowser.php:25 ../../view/theme/diabook/theme.php:90
#: ../../include/nav.php:51 ../../boot.php:1826
#: ../../include/nav.php:51 ../../boot.php:1847
msgid "Photos"
msgstr ""
@ -4259,7 +4259,7 @@ msgstr ""
msgid "FTP Password"
msgstr ""
#: ../../mod/profile.php:21 ../../boot.php:1204
#: ../../mod/profile.php:21 ../../boot.php:1225
msgid "Requested profile is not available."
msgstr ""
@ -4666,23 +4666,23 @@ msgstr ""
msgid "Edit/Manage Profiles"
msgstr ""
#: ../../mod/profiles.php:722 ../../boot.php:1324
#: ../../mod/profiles.php:722 ../../boot.php:1345
msgid "Change profile photo"
msgstr ""
#: ../../mod/profiles.php:723 ../../boot.php:1325
#: ../../mod/profiles.php:723 ../../boot.php:1346
msgid "Create New Profile"
msgstr ""
#: ../../mod/profiles.php:734 ../../boot.php:1335
#: ../../mod/profiles.php:734 ../../boot.php:1356
msgid "Profile Image"
msgstr ""
#: ../../mod/profiles.php:736 ../../boot.php:1338
#: ../../mod/profiles.php:736 ../../boot.php:1359
msgid "visible to everybody"
msgstr ""
#: ../../mod/profiles.php:737 ../../boot.php:1339
#: ../../mod/profiles.php:737 ../../boot.php:1360
msgid "Edit visibility"
msgstr ""
@ -4818,19 +4818,19 @@ msgstr ""
#: ../../mod/directory.php:136
#: ../../addon/forumdirectory/forumdirectory.php:158
#: ../../include/profile_advanced.php:17 ../../boot.php:1360
#: ../../include/profile_advanced.php:17 ../../boot.php:1381
msgid "Gender:"
msgstr ""
#: ../../mod/directory.php:138
#: ../../addon/forumdirectory/forumdirectory.php:160
#: ../../include/profile_advanced.php:37 ../../boot.php:1363
#: ../../include/profile_advanced.php:37 ../../boot.php:1384
msgid "Status:"
msgstr ""
#: ../../mod/directory.php:140
#: ../../addon/forumdirectory/forumdirectory.php:162
#: ../../include/profile_advanced.php:48 ../../boot.php:1365
#: ../../include/profile_advanced.php:48 ../../boot.php:1386
msgid "Homepage:"
msgstr ""
@ -5735,7 +5735,7 @@ msgstr ""
#: ../../addon/communityhome/communityhome.php:28
#: ../../addon/communityhome/communityhome.php:34 ../../include/nav.php:64
#: ../../boot.php:1016 ../../addon.old/communityhome/communityhome.php:28
#: ../../boot.php:1037 ../../addon.old/communityhome/communityhome.php:28
#: ../../addon.old/communityhome/communityhome.php:34
#: ../../addon.old/communityhome/twillingham/communityhome.php:28
#: ../../addon.old/communityhome/twillingham/communityhome.php:34
@ -8718,7 +8718,7 @@ msgstr ""
msgid "Contacts not in any group"
msgstr ""
#: ../../include/nav.php:46 ../../boot.php:1015
#: ../../include/nav.php:46 ../../boot.php:1036
msgid "Logout"
msgstr ""
@ -8726,7 +8726,7 @@ msgstr ""
msgid "End this session"
msgstr ""
#: ../../include/nav.php:49 ../../boot.php:1812
#: ../../include/nav.php:49 ../../boot.php:1833
msgid "Status"
msgstr ""
@ -8818,7 +8818,7 @@ msgstr ""
msgid "Delegations"
msgstr ""
#: ../../include/nav.php:142 ../../boot.php:1318
#: ../../include/nav.php:142 ../../boot.php:1339
msgid "Profiles"
msgstr ""
@ -9652,117 +9652,117 @@ msgstr ""
msgid "show fewer"
msgstr ""
#: ../../boot.php:878
#: ../../boot.php:899
#, php-format
msgid "Update %s failed. See error logs."
msgstr ""
#: ../../boot.php:880
#: ../../boot.php:901
#, php-format
msgid "Update Error at %s"
msgstr ""
#: ../../boot.php:990
#: ../../boot.php:1011
msgid "Create a New Account"
msgstr ""
#: ../../boot.php:1018
#: ../../boot.php:1039
msgid "Nickname or Email address: "
msgstr ""
#: ../../boot.php:1019
#: ../../boot.php:1040
msgid "Password: "
msgstr ""
#: ../../boot.php:1020
#: ../../boot.php:1041
msgid "Remember me"
msgstr ""
#: ../../boot.php:1023
#: ../../boot.php:1044
msgid "Or login using OpenID: "
msgstr ""
#: ../../boot.php:1029
#: ../../boot.php:1050
msgid "Forgot your password?"
msgstr ""
#: ../../boot.php:1032
#: ../../boot.php:1053
msgid "Website Terms of Service"
msgstr ""
#: ../../boot.php:1033
#: ../../boot.php:1054
msgid "terms of service"
msgstr ""
#: ../../boot.php:1035
#: ../../boot.php:1056
msgid "Website Privacy Policy"
msgstr ""
#: ../../boot.php:1036
#: ../../boot.php:1057
msgid "privacy policy"
msgstr ""
#: ../../boot.php:1165
#: ../../boot.php:1186
msgid "Requested account is not available."
msgstr ""
#: ../../boot.php:1244
#: ../../boot.php:1265
msgid "Edit profile"
msgstr ""
#: ../../boot.php:1310
#: ../../boot.php:1331
msgid "Message"
msgstr ""
#: ../../boot.php:1318
#: ../../boot.php:1339
msgid "Manage/edit profiles"
msgstr ""
#: ../../boot.php:1440 ../../boot.php:1526
#: ../../boot.php:1461 ../../boot.php:1547
msgid "g A l F d"
msgstr ""
#: ../../boot.php:1441 ../../boot.php:1527
#: ../../boot.php:1462 ../../boot.php:1548
msgid "F d"
msgstr ""
#: ../../boot.php:1486 ../../boot.php:1567
#: ../../boot.php:1507 ../../boot.php:1588
msgid "[today]"
msgstr ""
#: ../../boot.php:1498
#: ../../boot.php:1519
msgid "Birthday Reminders"
msgstr ""
#: ../../boot.php:1499
#: ../../boot.php:1520
msgid "Birthdays this week:"
msgstr ""
#: ../../boot.php:1560
#: ../../boot.php:1581
msgid "[No description]"
msgstr ""
#: ../../boot.php:1578
#: ../../boot.php:1599
msgid "Event Reminders"
msgstr ""
#: ../../boot.php:1579
#: ../../boot.php:1600
msgid "Events this week:"
msgstr ""
#: ../../boot.php:1815
#: ../../boot.php:1836
msgid "Status Messages and Posts"
msgstr ""
#: ../../boot.php:1822
#: ../../boot.php:1843
msgid "Profile Details"
msgstr ""
#: ../../boot.php:1839
#: ../../boot.php:1860
msgid "Events and Calendar"
msgstr ""
#: ../../boot.php:1846
#: ../../boot.php:1867
msgid "Only You Can See This"
msgstr ""
@ -9770,7 +9770,7 @@ msgstr ""
msgid "via"
msgstr ""
#: ../../index.php:399
#: ../../index.php:400
msgid "toggle mobile"
msgstr ""