From 3306daecf4450555961490c11e70e7cf7fe7b86e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 11 Apr 2013 19:12:00 +0400 Subject: implement upload-related support for open_basedir --- include/rssfuncs.php | 2 +- include/sanity_check.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 727e42897..7c2e1655b 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -1191,7 +1191,7 @@ } function expire_cached_files($debug) { - foreach (array("simplepie", "images", "export") as $dir) { + foreach (array("simplepie", "images", "export", "upload") as $dir) { $cache_dir = CACHE_DIR . "/$dir"; if ($debug) _debug("Expiring $cache_dir"); diff --git a/include/sanity_check.php b/include/sanity_check.php index 99d3051f3..69309290e 100644 --- a/include/sanity_check.php +++ b/include/sanity_check.php @@ -55,6 +55,10 @@ array_push($errors, "Image cache is not writable (chmod -R 777 ".CACHE_DIR."/images)"); } + if (!is_writable(CACHE_DIR . "/upload")) { + array_push($errors, "Upload cache is not writable (chmod -R 777 ".CACHE_DIR."/upload)"); + } + if (!is_writable(CACHE_DIR . "/export")) { array_push($errors, "Data export cache is not writable (chmod -R 777 ".CACHE_DIR."/export)"); } @@ -102,10 +106,6 @@ array_push($errors, "LOCK_DIRECTORY defined in config.php is not writable (chmod -R 777 ".LOCK_DIRECTORY.").\n"); } - if (ini_get("open_basedir")) { - array_push($errors, "PHP configuration option open_basedir is not supported. Please disable this in PHP settings file (php.ini)."); - } - if (!function_exists("curl_init") && !ini_get("allow_url_fopen")) { array_push($errors, "PHP configuration option allow_url_fopen is disabled, and CURL functions are not present. Either enable allow_url_fopen or install PHP extension for CURL."); } -- cgit v1.2.3 From 9bfda43e775ff23d980795363c3c792fd6d8b89d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Apr 2013 09:55:41 +0400 Subject: digest: use proper logging, update.php: fix typo --- include/digest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/digest.php b/include/digest.php index ab29d9432..34b699094 100644 --- a/include/digest.php +++ b/include/digest.php @@ -33,7 +33,7 @@ if ($preferred_ts && time() >= $preferred_ts && time() - $preferred_ts <= 7200) { - if ($debug) print "Sending digest for UID:" . $line['id'] . " - " . $line["email"] . " ... "; + if ($debug) _debug("Sending digest for UID:" . $line['id'] . " - " . $line["email"]); $do_catchup = get_pref($link, 'DIGEST_CATCHUP', $line['id'], false); @@ -54,16 +54,16 @@ $rc = $mail->quickMail($line["email"], $line["login"] , DIGEST_SUBJECT, $digest, $digest_text); - if (!$rc && $debug) print "ERROR: " . $mail->ErrorInfo; + if (!$rc && $debug) _debug("ERROR: " . $mail->ErrorInfo); - if ($debug) print "RC=$rc\n"; + if ($debug) _debug("RC=$rc"); if ($rc && $do_catchup) { - if ($debug) print "Marking affected articles as read...\n"; + if ($debug) _debug("Marking affected articles as read..."); catchupArticlesById($link, $affected_ids, 0, $line["id"]); } } else { - if ($debug) print "No headlines\n"; + if ($debug) _debug("No headlines"); } db_query($link, "UPDATE ttrss_users SET last_digest_sent = NOW() -- cgit v1.2.3 From b68a266a734193dfeee8d9f52b9888b2798eb50c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Apr 2013 14:06:20 +0400 Subject: remove no_cache_incantation() --- include/functions.php | 9 --------- 1 file changed, 9 deletions(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 4ac4e0968..31a4c1f2d 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2929,15 +2929,6 @@ exit; } - // from http://developer.apple.com/internet/safari/faq.html - function no_cache_incantation() { - header("Expires: Mon, 22 Dec 1980 00:00:00 GMT"); // Happy birthday to me :) - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified - header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); // HTTP/1.1 - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); // HTTP/1.0 - } - function format_warning($msg, $id = "") { global $link; return "
-- cgit v1.2.3 From bb399c62712cfe99503d7d92bbeb8afef1c10918 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Apr 2013 14:14:11 +0400 Subject: add cache-control: public to the login page so that firefox would bother making a thumbnail --- include/functions.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 31a4c1f2d..f5685b89a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2925,6 +2925,8 @@ } function render_login_form($link) { + header('Cache-Control: public'); + require_once "login_form.php"; exit; } -- cgit v1.2.3 From c5569ff8d30d3cda4667d5e22923455a68482478 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Apr 2013 16:30:40 +0400 Subject: decode html entities in article title on import --- include/rssfuncs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 7c2e1655b..6e3ef4cf1 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -524,7 +524,7 @@ _debug("update_rss_feed: date $entry_timestamp [$entry_timestamp_fmt]"); } - $entry_title = $item->get_title(); + $entry_title = html_entity_decode($item->get_title()); $entry_link = rewrite_relative_url($site_url, $item->get_link()); -- cgit v1.2.3 From 044cff2d74ece46256201695346d1a0d1d66c746 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 13 Apr 2013 18:24:27 +0400 Subject: implement basic feed authentication parameter encryption in the database (FEED_CRYPT_KEY) --- include/crypt.php | 36 ++++++++++++++++++++++++++++++++++++ include/functions.php | 12 ++++++++++-- include/rssfuncs.php | 9 ++++++++- include/sanity_check.php | 8 ++++++++ include/sanity_config.php | 4 ++-- 5 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 include/crypt.php (limited to 'include') diff --git a/include/crypt.php b/include/crypt.php new file mode 100644 index 000000000..f06483ef1 --- /dev/null +++ b/include/crypt.php @@ -0,0 +1,36 @@ + diff --git a/include/functions.php b/include/functions.php index f5685b89a..73ed97d08 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1614,12 +1614,20 @@ "SELECT id FROM ttrss_feeds WHERE feed_url = '$url' AND owner_uid = ".$_SESSION["uid"]); + if (strlen(FEED_CRYPT_KEY) > 0) { + require_once "crypt.php"; + $auth_pass = substr(encrypt_string($auth_pass), 0, 250); + $auth_pass_encrypted = 'true'; + } else { + $auth_pass_encrypted = 'false'; + } + if (db_num_rows($result) == 0) { $result = db_query($link, "INSERT INTO ttrss_feeds - (owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method) + (owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method,auth_pass_encrypted) VALUES ('".$_SESSION["uid"]."', '$url', - '[Unknown]', $cat_qpart, '$auth_login', '$auth_pass', 0)"); + '[Unknown]', $cat_qpart, '$auth_login', '$auth_pass', 0, $auth_pass_encrypted)"); $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE feed_url = '$url' diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 6e3ef4cf1..859c575cc 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -203,7 +203,7 @@ $result = db_query($link, "SELECT id,update_interval,auth_login, feed_url,auth_pass,cache_images,last_updated, mark_unread_on_update, owner_uid, - pubsub_state + pubsub_state, auth_pass_encrypted FROM ttrss_feeds WHERE id = '$feed'"); if (db_num_rows($result) == 0) { @@ -218,6 +218,8 @@ $mark_unread_on_update = sql_bool_to_bool(db_fetch_result($result, 0, "mark_unread_on_update")); $pubsub_state = db_fetch_result($result, 0, "pubsub_state"); + $auth_pass_encrypted = sql_bool_to_bool(db_fetch_result($result, + 0, "auth_pass_encrypted")); db_query($link, "UPDATE ttrss_feeds SET last_update_started = NOW() WHERE id = '$feed'"); @@ -225,6 +227,11 @@ $auth_login = db_fetch_result($result, 0, "auth_login"); $auth_pass = db_fetch_result($result, 0, "auth_pass"); + if ($auth_pass_encrypted) { + require_once "crypt.php"; + $auth_pass = decrypt_string($auth_pass); + } + $cache_images = sql_bool_to_bool(db_fetch_result($result, 0, "cache_images")); $fetch_url = db_fetch_result($result, 0, "feed_url"); diff --git a/include/sanity_check.php b/include/sanity_check.php index 69309290e..b4102d234 100644 --- a/include/sanity_check.php +++ b/include/sanity_check.php @@ -67,6 +67,14 @@ array_push($errors, "Javascript cache is not writable (chmod -R 777 ".CACHE_DIR."/js)"); } + if (strlen(FEED_CRYPT_KEY) != 24) { + array_push($errors, "FEED_CRYPT_KEY should be exactly 24 characters in length."); + } + + if (strlen(FEED_CRYPT_KEY) != 0 && !function_exists("mcrypt_decrypt")) { + array_push($errors, "FEED_CRYPT_KEY requires mcrypt functions which are not found."); + } + if (GENERATED_CONFIG_CHECK != EXPECTED_CONFIG_VERSION) { array_push($errors, "Configuration option checker sanity_config.php is outdated, please recreate it using ./utils/regen_config_checks.sh"); diff --git a/include/sanity_config.php b/include/sanity_config.php index cb1c1e8ca..0c829981e 100644 --- a/include/sanity_config.php +++ b/include/sanity_config.php @@ -1,3 +1,3 @@ - +$requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MYSQL_CHARSET', 'SELF_URL_PATH', 'FEED_CRYPT_KEY', 'SINGLE_USER_MODE', 'SIMPLE_UPDATE_MODE', 'PHP_EXECUTABLE', 'LOCK_DIRECTORY', 'CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'AUTH_AUTO_CREATE', 'AUTH_AUTO_LOGIN', 'FORCE_ARTICLE_PURGE', 'PUBSUBHUBBUB_HUB', 'PUBSUBHUBBUB_ENABLED', 'SPHINX_ENABLED', 'SPHINX_INDEX', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'SESSION_COOKIE_LIFETIME', 'SESSION_CHECK_ADDRESS', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'SMTP_HOST', 'SMTP_PORT', 'SMTP_LOGIN', 'SMTP_PASSWORD', 'CHECK_FOR_NEW_VERSION', 'ENABLE_GZIP_OUTPUT', 'PLUGINS', 'CONFIG_VERSION'); ?> -- cgit v1.2.3 From 5276b7c768332800f6a39658d99b103f81b1598d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 13 Apr 2013 18:32:57 +0400 Subject: fix handling of blank FEED_CRYPT_KEY --- include/sanity_check.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sanity_check.php b/include/sanity_check.php index b4102d234..29de4ff5e 100644 --- a/include/sanity_check.php +++ b/include/sanity_check.php @@ -67,11 +67,11 @@ array_push($errors, "Javascript cache is not writable (chmod -R 777 ".CACHE_DIR."/js)"); } - if (strlen(FEED_CRYPT_KEY) != 24) { + if (strlen(FEED_CRYPT_KEY) > 0 && strlen(FEED_CRYPT_KEY) != 24) { array_push($errors, "FEED_CRYPT_KEY should be exactly 24 characters in length."); } - if (strlen(FEED_CRYPT_KEY) != 0 && !function_exists("mcrypt_decrypt")) { + if (strlen(FEED_CRYPT_KEY) > 0 && !function_exists("mcrypt_decrypt")) { array_push($errors, "FEED_CRYPT_KEY requires mcrypt functions which are not found."); } -- cgit v1.2.3 From 41694a956d4cbe4da633a967c06908b69e942c17 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 13 Apr 2013 18:58:09 +0400 Subject: fix double-escaping possible with encrypted passwords --- include/functions.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 73ed97d08..1b6b3e820 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1622,6 +1622,8 @@ $auth_pass_encrypted = 'false'; } + $auth_pass = db_escape_string($this->link, $auth_pass); + if (db_num_rows($result) == 0) { $result = db_query($link, "INSERT INTO ttrss_feeds -- cgit v1.2.3 From 96de8fea677d4c031700cadea16fc8c7b0de0172 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 14 Apr 2013 09:11:02 +0400 Subject: subscribe_to_feed: fix typo --- include/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 1b6b3e820..e2357f6c0 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1622,7 +1622,7 @@ $auth_pass_encrypted = 'false'; } - $auth_pass = db_escape_string($this->link, $auth_pass); + $auth_pass = db_escape_string($link, $auth_pass); if (db_num_rows($result) == 0) { $result = db_query($link, -- cgit v1.2.3 From 2cfbb448fb197837c063c377c042beb3ba704a52 Mon Sep 17 00:00:00 2001 From: moontear Date: Mon, 15 Apr 2013 12:28:52 +0200 Subject: Added average color calculation of feeds' favicons for banded display. --- include/functions.php | 42 ++++++++++++++++++++++++++++++++++++++++++ include/rssfuncs.php | 11 ++++++++--- 2 files changed, 50 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index e2357f6c0..1ae5bbbe2 100644 --- a/include/functions.php +++ b/include/functions.php @@ -508,8 +508,50 @@ } } } + return $icon_file; } } + + function calculate_avg_color($iconFile) { + + require_once "lib/floIcon.php"; + + $imgInfo = @getimagesize($iconFile); + + if(strtolower($imgInfo['mime'])=='image/vnd.microsoft.icon') { + $ico = new floIcon(); + @$ico->readICO($iconFile); + //TODO: error logging + if(count($ico->images)==0) + return null; + else { + $image = @$ico->images[count($ico->images)-1]->getImageResource(); + } + $type = "ico"; + } + elseif(strtolower($imgInfo['mime'])=='image/png') { + $image = imagecreatefrompng($iconFile); + $type = 'png'; + } + elseif(strtolower($imgInfo['mime'])=='image/jpeg') { + $image = imagecreatefromjpeg($iconFile); + $type = 'jpg'; + } + elseif(strtolower($imgInfo['mime'])=='image/gif') { + $image = imagecreatefromgif($iconFile); + $type = 'gif'; + } + //TODO: error logging + if (is_null($image)) + return null; + $width = imagesx($image); + $height = imagesy($image); + $pixel = imagecreatetruecolor(1, 1); + imagecopyresampled($pixel, $image, 0, 0, 0, 0, 1, 1, $width, $height); + $rgb = imagecolorat($pixel, 0, 0); + $color = imagecolorsforindex($pixel, $rgb); + return $color; + } function print_select($id, $default, $values, $attributes = "") { print ""; foreach ($values as $v) { diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 2e522175e..0d55dce36 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -412,18 +412,13 @@ $favicon_file = ICONS_DIR . "/$feed.ico"; if (file_exists($favicon_file)) { - $favicon_color = calculate_avg_color($favicon_file); - require_once "colors.php"; - if (is_array($favicon_color)) - $tmp = array($favicon_color['red'], - $favicon_color['green'], - $favicon_color['blue']); + $favicon_color = db_escape_string($link, + calculate_avg_color($favicon_file)); - $favicon_colorstring = ",favicon_avg_color = '" . - _color_pack($tmp) . "'"; - } + $favicon_colorstring = ",favicon_avg_color = '".$favicon_color."'"; + } db_query($link, "UPDATE ttrss_feeds SET favicon_last_checked = NOW() $favicon_colorstring WHERE id = '$feed'"); -- cgit v1.2.3 From 12a6bd28ace16ff20f1f920831cffe1041b36d5c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Apr 2013 17:07:06 +0400 Subject: remove hsl stuff from classes/feeds, we take care of this when choosing the color --- include/rssfuncs.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 0d55dce36..250534bd7 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -417,6 +417,8 @@ $favicon_color = db_escape_string($link, calculate_avg_color($favicon_file)); + if ($debug_enabled) _debug("color: $favicon_color"); + $favicon_colorstring = ",favicon_avg_color = '".$favicon_color."'"; } -- cgit v1.2.3 From bc7a144dd589302025c3b024d6da71f2e53d6496 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Apr 2013 18:22:48 +0400 Subject: properly remove and replace favicon color when favicon gets manually removed/uploaded --- include/colors.php | 2 +- include/rssfuncs.php | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/colors.php b/include/colors.php index 19c891517..1359b9e2d 100644 --- a/include/colors.php +++ b/include/colors.php @@ -336,6 +336,6 @@ function hsl2rgb($arr) { } } } - return false; + return ''; } ?> diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 250534bd7..283e48532 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -412,17 +412,16 @@ $favicon_file = ICONS_DIR . "/$feed.ico"; if (file_exists($favicon_file)) { - require_once "colors.php"; + require_once "colors.php"; - $favicon_color = db_escape_string($link, - calculate_avg_color($favicon_file)); + $favicon_color = db_escape_string($link, + calculate_avg_color($favicon_file)); - if ($debug_enabled) _debug("color: $favicon_color"); - - $favicon_colorstring = ",favicon_avg_color = '".$favicon_color."'"; + $favicon_colorstring = ",favicon_avg_color = '".$favicon_color."'"; } - db_query($link, "UPDATE ttrss_feeds SET favicon_last_checked = NOW() $favicon_colorstring + db_query($link, "UPDATE ttrss_feeds SET favicon_last_checked = NOW() + $favicon_colorstring WHERE id = '$feed'"); } -- cgit v1.2.3 From 5e3d5480f7e154a897363770327001fe1b72f504 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Apr 2013 19:28:11 +0400 Subject: use hashed guids in a hopefully backwards compatible fashion --- include/rssfuncs.php | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 283e48532..b3bf25849 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -517,14 +517,16 @@ if (!$entry_guid) $entry_guid = $item->get_link(); if (!$entry_guid) $entry_guid = make_guid_from_title($item->get_title()); - if ($debug_enabled) { - _debug("update_rss_feed: guid $entry_guid"); - } - if (!$entry_guid) continue; $entry_guid = "$owner_uid,$entry_guid"; + $entry_guid_hashed = db_escape_string($link, 'SHA1:' . sha1($entry_guid)); + + if ($debug_enabled) { + _debug("update_rss_feed: guid $entry_guid / $entry_guid_hashed"); + } + $entry_timestamp = ""; $entry_timestamp = strtotime($item->get_date()); @@ -633,7 +635,7 @@ // FIXME not sure if owner_uid is a good idea here, we may have a base entry without user entry (?) $result = db_query($link, "SELECT plugin_data,title,content,link,tag_cache,author FROM ttrss_entries, ttrss_user_entries - WHERE ref_id = id AND guid = '".db_escape_string($link, $entry_guid)."' AND owner_uid = $owner_uid"); + WHERE ref_id = id AND (guid = '".db_escape_string($link, $entry_guid)."' OR guid = '$entry_guid_hashed') AND owner_uid = $owner_uid"); if (db_num_rows($result) != 0) { $entry_plugin_data = db_fetch_result($result, 0, "plugin_data"); @@ -684,7 +686,7 @@ db_query($link, "BEGIN"); $result = db_query($link, "SELECT id FROM ttrss_entries - WHERE guid = '$entry_guid'"); + WHERE (guid = '$entry_guid' OR guid = '$entry_guid_hashed')"); if (db_num_rows($result) == 0) { @@ -712,7 +714,7 @@ author) VALUES ('$entry_title', - '$entry_guid', + '$entry_guid_hashed', '$entry_link', '$entry_timestamp_fmt', '$entry_content', @@ -745,13 +747,13 @@ // now it should exist, if not - bad luck then $result = db_query($link, "SELECT - id,content_hash,no_orig_date,title,plugin_data, + id,content_hash,no_orig_date,title,plugin_data,guid, ".SUBSTRING_FOR_DATE."(date_updated,1,19) as date_updated, ".SUBSTRING_FOR_DATE."(updated,1,19) as updated, num_comments FROM ttrss_entries - WHERE guid = '$entry_guid'"); + WHERE guid = '$entry_guid' OR guid = '$entry_guid_hashed'"); $entry_ref_id = 0; $entry_int_id = 0; @@ -759,7 +761,7 @@ if (db_num_rows($result) == 1) { if ($debug_enabled) { - _debug("update_rss_feed: base guid [$entry_guid] found, checking for user record"); + _debug("update_rss_feed: base guid found, checking for user record"); } // this will be used below in update handler @@ -773,6 +775,14 @@ $ref_id = db_fetch_result($result, 0, "id"); $entry_ref_id = $ref_id; + /* $stored_guid = db_fetch_result($result, 0, "guid"); + if ($stored_guid != $entry_guid_hashed) { + if ($debug_enabled) _debug("upgrading compat guid to hashed one"); + + db_query($link, "UPDATE ttrss_entries SET guid = '$entry_guid_hashed' WHERE + id = '$ref_id'"); + } */ + // check for user post link to main table // do we allow duplicate posts with same GUID in different feeds? @@ -933,7 +943,7 @@ if ($post_needs_update) { if (defined('DAEMON_EXTENDED_DEBUG')) { - _debug("update_rss_feed: post $entry_guid needs update..."); + _debug("update_rss_feed: post $entry_guid_hashed needs update..."); } // print ""; -- cgit v1.2.3 From 76e087b0173743657a2066dd2fd3446b6a34d558 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 16 Apr 2013 01:02:42 +0400 Subject: format_article_labels: bail out if passed something other than array --- include/functions.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 306014d96..018520648 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3450,6 +3450,8 @@ function format_article_labels($labels, $id) { + if (is_array($labels)) return ''; + $labels_str = ""; foreach ($labels as $l) { -- cgit v1.2.3 From 40fe2d73821788e7c202191dc7b94b025585d338 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 16 Apr 2013 15:44:38 +0400 Subject: remove js-based player, better mp3 support detection for html5 audio --- include/functions.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 018520648..87eb3d6a9 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2990,19 +2990,12 @@ if (strpos($ctype, "audio/") === 0) { if ($_SESSION["hasAudio"] && (strpos($ctype, "ogg") !== false || - strpos($_SERVER['HTTP_USER_AGENT'], "Chrome") !== false || - strpos($_SERVER['HTTP_USER_AGENT'], "Safari") !== false )) { + $_SESSION["hasMp3"])) { - $id = 'AUDIO-' . uniqid(); - - $entry .= "