]> git.mxchange.org Git - friendica.git/commitdiff
API: Now returns a real 404 when a function isn't implemented
authorMichael Vogel <icarus@dabo.de>
Fri, 13 Jul 2012 21:23:31 +0000 (23:23 +0200)
committerMichael Vogel <icarus@dabo.de>
Fri, 13 Jul 2012 21:23:31 +0000 (23:23 +0200)
parse_url: Image handling improved

include/api.php
include/items.php
mod/parse_url.php

index e0b788424e4d2e7f506efe287d34508d1b647c84..7d230629b0dab4445e41a0d9de140c46f71fef3e 100644 (file)
                                //echo "<pre>"; var_dump($r); die();
                        }
                }
+               header("HTTP/1.1 404 Not Found");
                logger('API call not implemented: '.$a->query_string." - ".print_r($_REQUEST,true));
                $r = '<status><error>not implemented</error></status>';
                switch($type){
index 6ab681c8751a88213007537b812f0f0e2b174d9b..d888f314de1a366ac9e4ffddb600bebd8f7d94a6 100755 (executable)
@@ -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;
 }
index 4d894969aadbde21c152ac87895da09aba6915d9..32f28b7b7bce3c6f67d6260e97e7f74147c6d1e1 100644 (file)
@@ -294,33 +294,6 @@ function parse_url_content(&$a) {
                else
                        $image .= '<img height="'.$imagedata["height"].'" width="'.$imagedata["width"].'" src="'.$imagedata["src"].'" alt="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 = '<br /><br /><img height="' . $new_height . '" width="' . $new_width . '" src="' .$image . '" alt="photo" />';
-                               } else {
-                                       if($textmode)
-                                               $image = $br.$br.'[img]'.$image.'[/img]';
-                                       else
-                                               $image = '<br /><br /><img src="'.$image.'" alt="photo" />';
-                               }
-                       }
-               }
-       }*/
-
        if(strlen($text)) {
                if($textmode)
                        $text = $br.'[quote]'.trim($text).'[/quote]'.$br ;