From 5f400c4a9798d04c267cc05f2250a6c810802553 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 13 Jul 2012 23:23:31 +0200 Subject: [PATCH] API: Now returns a real 404 when a function isn't implemented parse_url: Image handling improved --- include/api.php | 1 + include/items.php | 7 ++++--- mod/parse_url.php | 27 --------------------------- 3 files changed, 5 insertions(+), 30 deletions(-) diff --git a/include/api.php b/include/api.php index e0b788424e..7d230629b0 100644 --- a/include/api.php +++ b/include/api.php @@ -156,6 +156,7 @@ //echo "
"; var_dump($r); die();
 			}
 		}
+		header("HTTP/1.1 404 Not Found");
 		logger('API call not implemented: '.$a->query_string." - ".print_r($_REQUEST,true));
 		$r = 'not implemented';
 		switch($type){
diff --git a/include/items.php b/include/items.php
index 6ab681c875..d888f314de 100755
--- a/include/items.php
+++ b/include/items.php
@@ -698,9 +698,10 @@ function get_atom_elements($feed,$item) {
 	call_hooks('parse_atom', $arr);
 
 	//if (($res["title"] != "") or (strpos($res["body"], "RT @") > 0)) {
-	//	$debugfile = tempnam("/home/ike/log", "item-res2-");
-	//	file_put_contents($debugfile, serialize($res));
-	//}
+	if (strpos($res["body"], "RT @") !== false) {
+		$debugfile = tempnam("/home/ike/log", "item-res2-");
+		file_put_contents($debugfile, serialize($arr));
+	}
 
 	return $res;
 }
diff --git a/mod/parse_url.php b/mod/parse_url.php
index 4d894969aa..32f28b7b7b 100644
--- a/mod/parse_url.php
+++ b/mod/parse_url.php
@@ -294,33 +294,6 @@ function parse_url_content(&$a) {
 		else
 			$image .= 'photo';
 
-/*	if ($image != "") {
-		$i = fetch_url($image);
-		if($i) {
-			require_once('include/Photo.php');
-			// guess mimetype from headers or filename
-			$type = guess_image_type($image,true);
-
-			$ph = new Photo($i, $type);
-			if($ph->is_valid()) {
-				if($ph->getWidth() > 300 || $ph->getHeight() > 300) {
-					$ph->scaleImage(300);
-					$new_width = $ph->getWidth();
-					$new_height = $ph->getHeight();
-					if($textmode)
-						$image = $br . $br . '[img=' . $new_width . 'x' . $new_height . ']' . $image . '[/img]';
-					else
-						$image = '

photo'; - } else { - if($textmode) - $image = $br.$br.'[img]'.$image.'[/img]'; - else - $image = '

photo'; - } - } - } - }*/ - if(strlen($text)) { if($textmode) $text = $br.'[quote]'.trim($text).'[/quote]'.$br ; -- 2.39.5