Uploaded image for project: 'Shindig'
  1. Shindig
  2. SHINDIG-1405

Fatal Error in MediaItemHandler with strict error reporting

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-RC2
    • Component/s: PHP
    • Labels:
      None

      Description

      In PHP you should only pass variables by reference. If you turn error reporting to strict this even causes a fatal error:

      — - 2010-07-29 15:22:40.000000000 +0200
      +++ php/src/social/service/MediaItemHandler.php 2010-07-29 12:11:11.000000000 +0200
      @@ -126,7 +126,8 @@
      throw new SocialSpiException("The content type " . $response->getContentType() .
      " fetched from $uri is not valid.", ResponseError::$BAD_REQUEST);
      }

      • return $this->writeBinaryContent($response->getResponseContent(), $response->getContentType());
        + $content = $response->getResponseContent();
        + return $this->writeBinaryContent($content, $response->getContentType());
        }

      /**
      @@ -159,7 +160,9 @@
      } else if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) {
      // The REST api supports to post the file using the content type 'image/', 'video/' or 'audio/*'.
      if ($this->isValidContentType($_SERVER['CONTENT_TYPE']))

      { - $file = $this->writeBinaryContent($GLOBALS['HTTP_RAW_POST_DATA'], $_SERVER['CONTENT_TYPE']); + $postData = $GLOBALS['HTTP_RAW_POST_DATA']; + + $file = $this->writeBinaryContent($postData, $_SERVER['CONTENT_TYPE']); }

      }
      return $file;

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bhofmann Bastian Hofmann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: