diff --git a/dav/main.php b/dav/main.php
index b71ef619..b79a4779 100644
--- a/dav/main.php
+++ b/dav/main.php
@@ -22,6 +22,50 @@ function dav_module()
{
}
+function dav_include_files() {
+ require_once (__DIR__ . "/common/dbclasses/dbclass_animexx.class.php");
+ require_once (__DIR__ . "/common/dbclasses/dbclass.friendica.calendars.class.php");
+ require_once (__DIR__ . "/common/dbclasses/dbclass.friendica.jqcalendar.class.php");
+ require_once (__DIR__ . "/common/dbclasses/dbclass.friendica.notifications.class.php");
+ require_once (__DIR__ . "/common/dbclasses/dbclass.friendica.calendarobjects.class.php");
+
+ /*
+ require_once (__DIR__ . "/SabreDAV/lib/Sabre.includes.php");
+ require_once (__DIR__ . "/SabreDAV/lib/Sabre/VObject/includes.php");
+ require_once (__DIR__ . "/SabreDAV/lib/Sabre/DAVACL/includes.php");
+ require_once (__DIR__ . "/SabreDAV/lib/Sabre/CalDAV/includes.php");
+ */
+ require_once (__DIR__ . "/SabreDAV/lib/Sabre/autoload.php");
+
+ $tz_before = date_default_timezone_get();
+ require_once (__DIR__ . "/iCalcreator/iCalcreator.class.php");
+ date_default_timezone_set($tz_before);
+
+ require_once (__DIR__ . "/common/calendar.fnk.php");
+ require_once (__DIR__ . "/common/dav_caldav_backend_common.inc.php");
+ require_once (__DIR__ . "/common/dav_caldav_backend.inc.php");
+ require_once (__DIR__ . "/common/dav_caldav_root.inc.php");
+ require_once (__DIR__ . "/common/dav_user_calendars.inc.php");
+ require_once (__DIR__ . "/common/dav_carddav_root.inc.php");
+ require_once (__DIR__ . "/common/dav_carddav_backend_std.inc.php");
+ require_once (__DIR__ . "/common/dav_user_addressbooks.inc.php");
+ require_once (__DIR__ . "/common/virtual_cal_source_backend.inc.php");
+ require_once (__DIR__ . "/common/wdcal_configuration.php");
+ require_once (__DIR__ . "/common/wdcal_cal_source.inc.php");
+ require_once (__DIR__ . "/common/wdcal_cal_source_private.inc.php");
+
+ require_once (__DIR__ . "/dav_friendica_principal.inc.php");
+ require_once (__DIR__ . "/dav_friendica_auth.inc.php");
+ require_once (__DIR__ . "/dav_carddav_backend_friendica_community.inc.php");
+ require_once (__DIR__ . "/dav_caldav_backend_friendica.inc.php");
+ require_once (__DIR__ . "/virtual_cal_source_friendica.inc.php");
+ require_once (__DIR__ . "/wdcal_cal_source_friendicaevents.inc.php");
+ require_once (__DIR__ . "/FriendicaACLPlugin.inc.php");
+
+ require_once (__DIR__ . "/calendar.friendica.fnk.php");
+ require_once (__DIR__ . "/layout.fnk.php");
+}
+
/**
* @param App $a
@@ -34,48 +78,8 @@ function dav_init(&$a)
* ALTER TABLE `photo` ADD INDEX ( `contact-id` )
*/
- require_once (__DIR__ . "/common/dbclasses/dbclass_animexx.class.php");
- require_once (__DIR__ . "/common/dbclasses/dbclass.friendica.calendars.class.php");
- require_once (__DIR__ . "/common/dbclasses/dbclass.friendica.jqcalendar.class.php");
- require_once (__DIR__ . "/common/dbclasses/dbclass.friendica.notifications.class.php");
- require_once (__DIR__ . "/common/dbclasses/dbclass.friendica.calendarobjects.class.php");
-
- /*
- require_once (__DIR__ . "/SabreDAV/lib/Sabre.includes.php");
- require_once (__DIR__ . "/SabreDAV/lib/Sabre/VObject/includes.php");
- require_once (__DIR__ . "/SabreDAV/lib/Sabre/DAVACL/includes.php");
- require_once (__DIR__ . "/SabreDAV/lib/Sabre/CalDAV/includes.php");
- */
- require_once (__DIR__ . "/SabreDAV/lib/Sabre/autoload.php");
-
- $tz_before = date_default_timezone_get();
- require_once (__DIR__ . "/iCalcreator/iCalcreator.class.php");
- date_default_timezone_set($tz_before);
-
- require_once (__DIR__ . "/common/calendar.fnk.php");
- require_once (__DIR__ . "/common/dav_caldav_backend_common.inc.php");
- require_once (__DIR__ . "/common/dav_caldav_backend.inc.php");
- require_once (__DIR__ . "/common/dav_caldav_root.inc.php");
- require_once (__DIR__ . "/common/dav_user_calendars.inc.php");
- require_once (__DIR__ . "/common/dav_carddav_root.inc.php");
- require_once (__DIR__ . "/common/dav_carddav_backend_std.inc.php");
- require_once (__DIR__ . "/common/dav_user_addressbooks.inc.php");
- require_once (__DIR__ . "/common/virtual_cal_source_backend.inc.php");
- require_once (__DIR__ . "/common/wdcal_configuration.php");
- require_once (__DIR__ . "/common/wdcal_cal_source.inc.php");
- require_once (__DIR__ . "/common/wdcal_cal_source_private.inc.php");
-
- require_once (__DIR__ . "/dav_friendica_principal.inc.php");
- require_once (__DIR__ . "/dav_friendica_auth.inc.php");
- require_once (__DIR__ . "/dav_carddav_backend_friendica_community.inc.php");
- require_once (__DIR__ . "/dav_caldav_backend_friendica.inc.php");
- require_once (__DIR__ . "/virtual_cal_source_friendica.inc.php");
- require_once (__DIR__ . "/wdcal_cal_source_friendicaevents.inc.php");
- require_once (__DIR__ . "/FriendicaACLPlugin.inc.php");
-
- require_once (__DIR__ . "/calendar.friendica.fnk.php");
- require_once (__DIR__ . "/layout.fnk.php");
-
+ dav_include_files();
+
if (false) {
dbg(true);
error_reporting(E_ALL);
@@ -197,6 +201,7 @@ function dav_content()
*/
function dav_event_created_hook(&$a, &$b)
{
+ dav_include_files();
// @TODO Updating the cache instead of completely invalidating and rebuilding it
FriendicaVirtualCalSourceBackend::invalidateCache($a->user["uid"], CALDAV_FRIENDICA_CONTACTS);
FriendicaVirtualCalSourceBackend::invalidateCache($a->user["uid"], CALDAV_FRIENDICA_MINE);
@@ -208,6 +213,7 @@ function dav_event_created_hook(&$a, &$b)
*/
function dav_event_updated_hook(&$a, &$b)
{
+ dav_include_files();
// @TODO Updating the cache instead of completely invalidating and rebuilding it
FriendicaVirtualCalSourceBackend::invalidateCache($a->user["uid"], CALDAV_FRIENDICA_CONTACTS);
FriendicaVirtualCalSourceBackend::invalidateCache($a->user["uid"], CALDAV_FRIENDICA_MINE);
diff --git a/privacy_image_cache/privacy_image_cache.php b/privacy_image_cache/privacy_image_cache.php
index 4153f7d9..f179a7ba 100644
--- a/privacy_image_cache/privacy_image_cache.php
+++ b/privacy_image_cache/privacy_image_cache.php
@@ -34,20 +34,48 @@ function privacy_image_cache_init() {
$r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' LIMIT 1", $urlhash );
if (count($r)) {
$img_str = $r[0]['data'];
+ $mime = $r[0]["desc"];
+ if ($mime == "") $mime = "image/jpeg";
}
else {
require_once("Photo.php");
$img_str = fetch_url($_REQUEST['url'],true);
- $img = new Photo($img_str);
- if($img->is_valid()) {
- $img->store(0, 0, $urlhash, $_REQUEST['url'], '', 100);
- $img_str = $img->imageString();
- }
+ if (substr($img_str, 0, 6) == "GIF89a") {
+ $mime = "image/gif";
+ $image = @imagecreatefromstring($img_str);
+
+ if($image === FALSE) die();
+
+ q("INSERT INTO `photo`
+ ( `uid`, `contact-id`, `guid`, `resource-id`, `created`, `edited`, `filename`, `album`, `height`, `width`, `desc`, `data`, `scale`, `profile`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` )
+ VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, %d, '%s', '%s', '%s', '%s' )",
+ 0, 0, get_guid(), dbesc($urlhash),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc(basename(dbesc($_REQUEST["url"]))),
+ dbesc(''),
+ intval(imagesy($image)),
+ intval(imagesx($image)),
+ 'image/gif',
+ dbesc($img_str),
+ 100,
+ intval(0),
+ dbesc(''), dbesc(''), dbesc(''), dbesc('')
+ );
+
+ } else {
+ $img = new Photo($img_str);
+ if($img->is_valid()) {
+ $img->store(0, 0, $urlhash, $_REQUEST['url'], '', 100);
+ $img_str = $img->imageString();
+ }
+ $mime = "image/jpeg";
+ }
}
- header("Content-type: image/jpeg");
+ header("Content-type: $mime");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + (3600*24)) . " GMT");
header("Cache-Control: max-age=" . (3600*24));
@@ -75,7 +103,7 @@ function privacy_image_cache_is_local_image($url) {
function privacy_image_cache_img_cb($matches) {
// following line changed per bug #431
if (privacy_image_cache_is_local_image($matches[2])) return $matches[1] . $matches[2] . $matches[3];
- return $matches[1] . "/privacy_image_cache/?url=" . escape_tags(addslashes(rawurlencode($matches[2]))) . $matches[3];
+ return $matches[1] . get_app()->get_baseurl() . "/privacy_image_cache/?url=" . escape_tags(addslashes(rawurlencode($matches[2]))) . $matches[3];
}
/**
@@ -94,9 +122,9 @@ function privacy_image_cache_bbcode_hook(&$a, &$o) {
function privacy_image_cache_display_item_hook(&$a, &$o) {
if (isset($o["output"])) {
if (isset($o["output"]["thumb"]) && !privacy_image_cache_is_local_image($o["output"]["thumb"]))
- $o["output"]["thumb"] = "/privacy_image_cache/?url=" . escape_tags(addslashes(rawurlencode($o["output"]["thumb"])));
+ $o["output"]["thumb"] = $a->get_baseurl() . "/privacy_image_cache/?url=" . escape_tags(addslashes(rawurlencode($o["output"]["thumb"])));
if (isset($o["output"]["author-avatar"]) && !privacy_image_cache_is_local_image($o["output"]["author-avatar"]))
- $o["output"]["author-avatar"] = "/privacy_image_cache/?url=" . escape_tags(addslashes(rawurlencode($o["output"]["author-avatar"])));
+ $o["output"]["author-avatar"] = $a->get_baseurl() . "/privacy_image_cache/?url=" . escape_tags(addslashes(rawurlencode($o["output"]["author-avatar"])));
}
}
@@ -107,7 +135,7 @@ function privacy_image_cache_display_item_hook(&$a, &$o) {
*/
function privacy_image_cache_ping_xmlize_hook(&$a, &$o) {
if ($o["photo"] != "" && !privacy_image_cache_is_local_image($o["photo"]))
- $o["photo"] = "/privacy_image_cache/?url=" . escape_tags(addslashes(rawurlencode($o["photo"])));
+ $o["photo"] = $a->get_baseurl() . "/privacy_image_cache/?url=" . escape_tags(addslashes(rawurlencode($o["photo"])));
}
diff --git a/smiley_pack.tgz b/smiley_pack.tgz
index 7d66664c..a1358539 100644
Binary files a/smiley_pack.tgz and b/smiley_pack.tgz differ
diff --git a/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php b/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php
index fb6faee2..3ae70879 100644
--- a/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php
+++ b/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php
@@ -69,9 +69,6 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':grenouille';
$b['icons'][] = '';
- $b['texts'][] = ':hamster';
- $b['icons'][] = '';
-
$b['texts'][] = ':singe';
$b['icons'][] = '';
@@ -81,9 +78,6 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':perroquet';
$b['icons'][] = '';
- $b['texts'][] = ':tux';
- $b['icons'][] = '';
-
$b['texts'][] = ':escargot';
$b['icons'][] = '';
@@ -142,9 +136,6 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':afro';
$b['icons'][] = '';
- $b['texts'][] = ':cool';
- $b['icons'][] = '';
-
#Devil/Angel Smileys
$b['texts'][] = ':ange';
@@ -168,9 +159,6 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':possédé';
$b['icons'][] = '';
- $b['texts'][] = ':saint';
- $b['icons'][] = '';
-
$b['texts'][] = ':tombe';
$b['icons'][] = '';
@@ -182,9 +170,6 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':pèteaulit';
$b['icons'][] = '';
- $b['texts'][] = ':vomit';
- $b['icons'][] = '';
-
$b['texts'][] = ':pet';
$b['icons'][] = '';
@@ -217,9 +202,6 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':basket';
$b['icons'][] = '';
- $b['texts'][] = ':bowling';
- $b['icons'][] = '';
-
$b['texts'][] = ':vélo';
$b['icons'][] = '';
@@ -229,9 +211,6 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':escrime';
$b['icons'][] = '';
- $b['texts'][] = ':golf';
- $b['icons'][] = '';
-
$b['texts'][] = ':jonglage';
$b['icons'][] = '';
@@ -241,18 +220,12 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':arc';
$b['icons'][] = '';
- $b['texts'][] = ':football';
- $b['icons'][] = '';
-
$b['texts'][] = ':surf';
$b['icons'][] = '';
$b['texts'][] = ':billard';
$b['icons'][] = '';
- $b['texts'][] = ':tennis';
- $b['icons'][] = '';
-
$b['texts'][] = ':équitation';
$b['icons'][] = '';
@@ -264,9 +237,6 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':amoureux';
$b['icons'][] = '';
- $b['texts'][] = ':love';
- $b['icons'][] = '';
-
$b['texts'][] = ':oursamour';
$b['icons'][] = '';
@@ -298,9 +268,6 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':combatalien';
$b['icons'][] = '';
- $b['texts'][] = ':alpha';
- $b['icons'][] = '';
-
$b['texts'][] = ':armée';
$b['icons'][] = '';
@@ -334,21 +301,6 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':mitrailleuse';
$b['icons'][] = '';
- $b['texts'][] = ':marine';
- $b['icons'][] = '';
-
- $b['texts'][] = ':sabre';
- $b['icons'][] = '';
-
- $b['texts'][] = ':tank';
- $b['icons'][] = '';
-
- $b['texts'][] = ':viking';
- $b['icons'][] = '';
-
- $b['texts'][] = ':gangs';
- $b['icons'][] = '';
-
$b['texts'][] = ':acide';
$b['icons'][] = '';
@@ -363,9 +315,6 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':dinosaure';
$b['icons'][] = '';
- $b['texts'][] = ':dragon';
- $b['icons'][] = '';
-
$b['texts'][] = ':petitdragon';
$b['icons'][] = '';
@@ -428,26 +377,11 @@ function smiley_pack_fr_smilies(&$a,&$b) {
#Laugh smileys
- $b['texts'][] = ':hahaha';
- $b['icons'][] = '';
-
- $b['texts'][] = ':loltv';
- $b['icons'][] = '';
-
- $b['texts'][] = ':rofl';
- $b['icons'][] = '';
-
#Music smileys
- $b['texts'][] = ':dj';
- $b['icons'][] = '';
-
$b['texts'][] = ':batterie';
$b['icons'][] = '';
- $b['texts'][] = ':elvis';
- $b['icons'][] = '';
-
$b['texts'][] = ':guitare';
$b['icons'][] = '';
@@ -468,24 +402,7 @@ function smiley_pack_fr_smilies(&$a,&$b) {
$b['texts'][] = ':barbeblanche';
$b['icons'][] = '';
- $b['texts'][] = ':shaka';
- $b['icons'][] = '';
-
- $b['texts'][] = ':\\.../';
- $b['icons'][] = '';
-
- $b['texts'][] = ':\\ooo/';
- $b['icons'][] = '';
-
$b['texts'][] = ':tête';
$b['icons'][] = '';
-#These two are still in core, so oldcore isn't strictly right, but we don't want too many directories
-
- $b['texts'][] = ':-d';
- $b['icons'][] = '';
-
- $b['texts'][] = ':-o';
- $b['icons'][] = '';
-
}
diff --git a/smiley_pack/smiley_pack.php b/smiley_pack/smiley_pack.php
index 74d1da06..258ade76 100644
--- a/smiley_pack/smiley_pack.php
+++ b/smiley_pack/smiley_pack.php
@@ -2,7 +2,7 @@
/*
* Name: Smiley Pack
* Description: Pack of smileys that make master too AOLish.
- * Version: 1.02
+ * Version: 1.04
* Author: Thomas Willingham (based on Mike Macgirvin's Adult Smile template)
* All smileys from sites offering them as Public Domain
*/
@@ -141,9 +141,6 @@ function smiley_pack_smilies(&$a,&$b) {
$b['texts'][] = ':affro';
$b['icons'][] = '';
- $b['texts'][] = ':cool';
- $b['icons'][] = '';
-
#Devil/Angel Smileys
$b['texts'][] = ':angel';
@@ -181,9 +178,6 @@ function smiley_pack_smilies(&$a,&$b) {
$b['texts'][] = ':fartinbed';
$b['icons'][] = '';
- $b['texts'][] = ':vomit';
- $b['icons'][] = '';
-
$b['texts'][] = ':fartblush';
$b['icons'][] = '';
@@ -228,9 +222,6 @@ function smiley_pack_smilies(&$a,&$b) {
$b['texts'][] = ':fencing';
$b['icons'][] = '';
- $b['texts'][] = ':golf';
- $b['icons'][] = '';
-
$b['texts'][] = ':juggling';
$b['icons'][] = '';
@@ -240,18 +231,12 @@ function smiley_pack_smilies(&$a,&$b) {
$b['texts'][] = ':archery';
$b['icons'][] = '';
- $b['texts'][] = ':football';
- $b['icons'][] = '';
-
$b['texts'][] = ':surfing';
$b['icons'][] = '';
$b['texts'][] = ':snooker';
$b['icons'][] = '';
- $b['texts'][] = ':tennis';
- $b['icons'][] = '';
-
$b['texts'][] = ':horseriding';
$b['icons'][] = '';
@@ -297,9 +282,6 @@ function smiley_pack_smilies(&$a,&$b) {
$b['texts'][] = ':alienfight';
$b['icons'][] = '';
- $b['texts'][] = ':alpha';
- $b['icons'][] = '';
-
$b['texts'][] = ':army';
$b['icons'][] = '';
@@ -333,21 +315,6 @@ function smiley_pack_smilies(&$a,&$b) {
$b['texts'][] = ':machinegun';
$b['icons'][] = '';
- $b['texts'][] = ':marine';
- $b['icons'][] = '';
-
- $b['texts'][] = ':sabre';
- $b['icons'][] = '';
-
- $b['texts'][] = ':tank';
- $b['icons'][] = '';
-
- $b['texts'][] = ':viking';
- $b['icons'][] = '';
-
- $b['texts'][] = ':gangs';
- $b['icons'][] = '';
-
$b['texts'][] = ':acid';
$b['icons'][] = '';
@@ -438,14 +405,9 @@ function smiley_pack_smilies(&$a,&$b) {
#Music smileys
- $b['texts'][] = ':dj';
- $b['icons'][] = '';
-
$b['texts'][] = ':drums';
$b['icons'][] = '';
- $b['texts'][] = ':elvis';
- $b['icons'][] = '';
$b['texts'][] = ':guitar';
$b['icons'][] = '';
@@ -453,9 +415,6 @@ function smiley_pack_smilies(&$a,&$b) {
$b['texts'][] = ':trumpet';
$b['icons'][] = '';
- $b['texts'][] = ':violin';
- $b['icons'][] = '';
-
#Smileys that used to be in core
$b['texts'][] = ':headbang';
@@ -487,7 +446,50 @@ function smiley_pack_smilies(&$a,&$b) {
$b['texts'][] = ':-o';
$b['icons'][] = '';
+# Regex killers - stick these at the bottom so they appear at the end of the English and
+# at the start of $OtherLanguage.
+
+ $b['texts'][] = ':cool';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':vomit';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':golf';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':football';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':tennis';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':alpha';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':marine';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':sabre';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':tank';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':viking';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':gangs';
+ $b['icons'][] = '';
+ $b['texts'][] = ':dj';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':elvis';
+ $b['icons'][] = '';
+
+ $b['texts'][] = ':violin';
+ $b['icons'][] = '';
}