XoopsModules25x/xoopsinfo

View on GitHub
class/uploader.php

Summary

Maintainability
D
1 day
Test Coverage

fetchMedia accesses the super-global variable $_FILES.
Open

    function fetchMedia($media_name, $index = null) {
/*
        if ( empty( $this->extensionToMime ) ) {
*/
        if ( count( $this->extensionToMime ) == 0 ) {
Severity: Minor
Found in class/uploader.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fetchMedia accesses the super-global variable $_FILES.
Open

    function fetchMedia($media_name, $index = null) {
/*
        if ( empty( $this->extensionToMime ) ) {
*/
        if ( count( $this->extensionToMime ) == 0 ) {
Severity: Minor
Found in class/uploader.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fetchMedia accesses the super-global variable $_FILES.
Open

    function fetchMedia($media_name, $index = null) {
/*
        if ( empty( $this->extensionToMime ) ) {
*/
        if ( count( $this->extensionToMime ) == 0 ) {
Severity: Minor
Found in class/uploader.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fetchMedia accesses the super-global variable $_FILES.
Open

    function fetchMedia($media_name, $index = null) {
/*
        if ( empty( $this->extensionToMime ) ) {
*/
        if ( count( $this->extensionToMime ) == 0 ) {
Severity: Minor
Found in class/uploader.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fetchMedia accesses the super-global variable $_FILES.
Open

    function fetchMedia($media_name, $index = null) {
/*
        if ( empty( $this->extensionToMime ) ) {
*/
        if ( count( $this->extensionToMime ) == 0 ) {
Severity: Minor
Found in class/uploader.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fetchMedia accesses the super-global variable $_FILES.
Open

    function fetchMedia($media_name, $index = null) {
/*
        if ( empty( $this->extensionToMime ) ) {
*/
        if ( count( $this->extensionToMime ) == 0 ) {
Severity: Minor
Found in class/uploader.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fetchMedia accesses the super-global variable $_FILES.
Open

    function fetchMedia($media_name, $index = null) {
/*
        if ( empty( $this->extensionToMime ) ) {
*/
        if ( count( $this->extensionToMime ) == 0 ) {
Severity: Minor
Found in class/uploader.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fetchMedia accesses the super-global variable $_FILES.
Open

    function fetchMedia($media_name, $index = null) {
/*
        if ( empty( $this->extensionToMime ) ) {
*/
        if ( count( $this->extensionToMime ) == 0 ) {
Severity: Minor
Found in class/uploader.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fetchMedia accesses the super-global variable $_FILES.
Open

    function fetchMedia($media_name, $index = null) {
/*
        if ( empty( $this->extensionToMime ) ) {
*/
        if ( count( $this->extensionToMime ) == 0 ) {
Severity: Minor
Found in class/uploader.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fetchMedia accesses the super-global variable $_FILES.
Open

    function fetchMedia($media_name, $index = null) {
/*
        if ( empty( $this->extensionToMime ) ) {
*/
        if ( count( $this->extensionToMime ) == 0 ) {
Severity: Minor
Found in class/uploader.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

The class XoopsMediaUploader has an overall complexity of 76 which is very high. The configured complexity threshold is 50.
Open

class XoopsMediaUploader {
    /**
    * Flag indicating if unrecognized mimetypes should be allowed (use with precaution ! may lead to security issues )
    **/
    var $allowUnknownTypes = false;
Severity: Minor
Found in class/uploader.php by phpmd

File uploader.php has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// $Id: uploader.php 507 2006-05-26 23:39:35Z skalpa $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
Severity: Minor
Found in class/uploader.php - About 2 hrs to fix

    XoopsMediaUploader has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class XoopsMediaUploader {
        /**
        * Flag indicating if unrecognized mimetypes should be allowed (use with precaution ! may lead to security issues )
        **/
        var $allowUnknownTypes = false;
    Severity: Minor
    Found in class/uploader.php - About 2 hrs to fix

      Method fetchMedia has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function fetchMedia($media_name, $index = null) {
      /*
              if ( empty( $this->extensionToMime ) ) {
      */
              if ( count( $this->extensionToMime ) == 0 ) {
      Severity: Minor
      Found in class/uploader.php - About 1 hr to fix

        The class XoopsMediaUploader has 21 fields. Consider redesigning XoopsMediaUploader to keep the number of fields under 15.
        Open

        class XoopsMediaUploader {
            /**
            * Flag indicating if unrecognized mimetypes should be allowed (use with precaution ! may lead to security issues )
            **/
            var $allowUnknownTypes = false;
        Severity: Minor
        Found in class/uploader.php by phpmd

        TooManyFields

        Since: 0.1

        Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

        Example

        class Person {
           protected $one;
           private $two;
           private $three;
           [... many more fields ...]
        }

        Source https://phpmd.org/rules/codesize.html#toomanyfields

        Method upload has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function upload($chmod = 0644) {
                if ($this->uploadDir == '') {
                    $this->setErrors( _ER_UP_UPLOADDIRNOTSET );
                    return false;
                }
        Severity: Minor
        Found in class/uploader.php - About 1 hr to fix

          Function fetchMedia has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              function fetchMedia($media_name, $index = null) {
          /*
                  if ( empty( $this->extensionToMime ) ) {
          */
                  if ( count( $this->extensionToMime ) == 0 ) {
          Severity: Minor
          Found in class/uploader.php - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function upload has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              function upload($chmod = 0644) {
                  if ($this->uploadDir == '') {
                      $this->setErrors( _ER_UP_UPLOADDIRNOTSET );
                      return false;
                  }
          Severity: Minor
          Found in class/uploader.php - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method _copyFile has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function _copyFile($chmod) {
                  $matched = array();
                  if (!preg_match("/\.([a-zA-Z0-9]+)$/", $this->mediaName, $matched)) {
                      return false;
                  }
          Severity: Minor
          Found in class/uploader.php - About 1 hr to fix

            Function _copyFile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                function _copyFile($chmod) {
                    $matched = array();
                    if (!preg_match("/\.([a-zA-Z0-9]+)$/", $this->mediaName, $matched)) {
                        return false;
                    }
            Severity: Minor
            Found in class/uploader.php - About 55 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method XoopsMediaUploader has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
            Severity: Minor
            Found in class/uploader.php - About 35 mins to fix

              Function getErrors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  function &getErrors($ashtml = true) {
                      if (!$ashtml) {
                          return $this->errors;
                      } else {
                          $ret = '';
              Severity: Minor
              Found in class/uploader.php - About 35 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Avoid too many return statements within this method.
              Open

                      return true;
              Severity: Major
              Found in class/uploader.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return false;
                Severity: Major
                Found in class/uploader.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return false;
                  Severity: Major
                  Found in class/uploader.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                        return true;
                    Severity: Major
                    Found in class/uploader.php - About 30 mins to fix

                      Function checkImageType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function checkImageType() {
                              if(empty($this->checkImageType)) return true;
                      
                              if( ("image" == substr($this->mediaType, 0, strpos($this->mediaType, "/"))) ||
                                  (!empty($this->mediaRealType) && "image" == substr($this->mediaRealType, 0, strpos($this->mediaRealType, "/"))) ){
                      Severity: Minor
                      Found in class/uploader.php - About 25 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      The method upload() has an NPath complexity of 1024. The configured NPath complexity threshold is 200.
                      Open

                          function upload($chmod = 0644) {
                              if ($this->uploadDir == '') {
                                  $this->setErrors( _ER_UP_UPLOADDIRNOTSET );
                                  return false;
                              }
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      NPathComplexity

                      Since: 0.1

                      The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                      Example

                      class Foo {
                          function bar() {
                              // lots of complicated code
                          }
                      }

                      Source https://phpmd.org/rules/codesize.html#npathcomplexity

                      The method fetchMedia() has an NPath complexity of 960. The configured NPath complexity threshold is 200.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      NPathComplexity

                      Since: 0.1

                      The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                      Example

                      class Foo {
                          function bar() {
                              // lots of complicated code
                          }
                      }

                      Source https://phpmd.org/rules/codesize.html#npathcomplexity

                      The method fetchMedia() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CyclomaticComplexity

                      Since: 0.1

                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                      Example

                      // Cyclomatic Complexity = 11
                      class Foo {
                      1   public function example() {
                      2       if ($a == $b) {
                      3           if ($a1 == $b1) {
                                      fiddle();
                      4           } elseif ($a2 == $b2) {
                                      fiddle();
                                  } else {
                                      fiddle();
                                  }
                      5       } elseif ($c == $d) {
                      6           while ($c == $d) {
                                      fiddle();
                                  }
                      7        } elseif ($e == $f) {
                      8           for ($n = 0; $n < $h; $n++) {
                                      fiddle();
                                  }
                              } else {
                                  switch ($z) {
                      9               case 1:
                                          fiddle();
                                          break;
                      10              case 2:
                                          fiddle();
                                          break;
                      11              case 3:
                                          fiddle();
                                          break;
                                      default:
                                          fiddle();
                                          break;
                                  }
                              }
                          }
                      }

                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                      The method upload() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                      Open

                          function upload($chmod = 0644) {
                              if ($this->uploadDir == '') {
                                  $this->setErrors( _ER_UP_UPLOADDIRNOTSET );
                                  return false;
                              }
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CyclomaticComplexity

                      Since: 0.1

                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                      Example

                      // Cyclomatic Complexity = 11
                      class Foo {
                      1   public function example() {
                      2       if ($a == $b) {
                      3           if ($a1 == $b1) {
                                      fiddle();
                      4           } elseif ($a2 == $b2) {
                                      fiddle();
                                  } else {
                                      fiddle();
                                  }
                      5       } elseif ($c == $d) {
                      6           while ($c == $d) {
                                      fiddle();
                                  }
                      7        } elseif ($e == $f) {
                      8           for ($n = 0; $n < $h; $n++) {
                                      fiddle();
                                  }
                              } else {
                                  switch ($z) {
                      9               case 1:
                                          fiddle();
                                          break;
                      10              case 2:
                                          fiddle();
                                          break;
                      11              case 3:
                                          fiddle();
                                          break;
                                      default:
                                          fiddle();
                                          break;
                                  }
                              }
                          }
                      }

                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                      The method getErrors has a boolean flag argument $ashtml, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          function &getErrors($ashtml = true) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      BooleanArgumentFlag

                      Since: 1.4.0

                      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                      Example

                      class Foo {
                          public function bar($flag = true) {
                          }
                      }

                      Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                      Remove error control operator '@' on line 376.
                      Open

                          function _copyFile($chmod) {
                              $matched = array();
                              if (!preg_match("/\.([a-zA-Z0-9]+)$/", $this->mediaName, $matched)) {
                                  return false;
                              }
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      ErrorControlOperator

                      Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                      Example

                      function foo($filePath) {
                          $file = @fopen($filPath); // hides exceptions
                          $key = @$array[$notExistingKey]; // assigns null to $key
                      }

                      Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                      Remove error control operator '@' on line 467.
                      Open

                          function checkImageType() {
                              if(empty($this->checkImageType)) return true;
                      
                              if( ("image" == substr($this->mediaType, 0, strpos($this->mediaType, "/"))) ||
                                  (!empty($this->mediaRealType) && "image" == substr($this->mediaRealType, 0, strpos($this->mediaRealType, "/"))) ){
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      ErrorControlOperator

                      Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                      Example

                      function foo($filePath) {
                          $file = @fopen($filPath); // hides exceptions
                          $key = @$array[$notExistingKey]; // assigns null to $key
                      }

                      Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                      Remove error control operator '@' on line 373.
                      Open

                          function _copyFile($chmod) {
                              $matched = array();
                              if (!preg_match("/\.([a-zA-Z0-9]+)$/", $this->mediaName, $matched)) {
                                  return false;
                              }
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      ErrorControlOperator

                      Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                      Example

                      function foo($filePath) {
                          $file = @fopen($filPath); // hides exceptions
                          $key = @$array[$notExistingKey]; // assigns null to $key
                      }

                      Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                      Remove error control operator '@' on line 381.
                      Open

                          function _copyFile($chmod) {
                              $matched = array();
                              if (!preg_match("/\.([a-zA-Z0-9]+)$/", $this->mediaName, $matched)) {
                                  return false;
                              }
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      ErrorControlOperator

                      Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                      Example

                      function foo($filePath) {
                          $file = @fopen($filPath); // hides exceptions
                          $key = @$array[$notExistingKey]; // assigns null to $key
                      }

                      Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                      Avoid assigning values to variables in if clauses and the like (line '406', column '17').
                      Open

                          function checkMaxWidth() {
                              if (!isset($this->maxWidth)) {
                                  return true;
                              }
                              if (false !== $dimension = getimagesize($this->mediaTmpName)) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      IfStatementAssignment

                      Since: 2.7.0

                      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                      Example

                      class Foo
                      {
                          public function bar($flag)
                          {
                              if ($foo = 'bar') { // possible typo
                                  // ...
                              }
                              if ($baz = 0) { // always false
                                  // ...
                              }
                          }
                      }

                      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                      The method _copyFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  $this->savedFileName = strtolower($this->mediaName);
                              }
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      ElseExpression

                      Since: 1.4.0

                      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                      Example

                      class Foo
                      {
                          public function bar($flag)
                          {
                              if ($flag) {
                                  // one branch
                              } else {
                                  // another branch
                              }
                          }
                      }

                      Source https://phpmd.org/rules/cleancode.html#elseexpression

                      The method getErrors uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  $ret = '';
                                  if (count($this->errors) > 0) {
                                      $ret = '<h4>Errors Returned While Uploading</h4>';
                                      foreach ($this->errors as $error) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      ElseExpression

                      Since: 1.4.0

                      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                      Example

                      class Foo
                      {
                          public function bar($flag)
                          {
                              if ($flag) {
                                  // one branch
                              } else {
                                  // another branch
                              }
                          }
                      }

                      Source https://phpmd.org/rules/cleancode.html#elseexpression

                      Avoid assigning values to variables in if clauses and the like (line '467', column '13').
                      Open

                          function checkImageType() {
                              if(empty($this->checkImageType)) return true;
                      
                              if( ("image" == substr($this->mediaType, 0, strpos($this->mediaType, "/"))) ||
                                  (!empty($this->mediaRealType) && "image" == substr($this->mediaRealType, 0, strpos($this->mediaRealType, "/"))) ){
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      IfStatementAssignment

                      Since: 2.7.0

                      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                      Example

                      class Foo
                      {
                          public function bar($flag)
                          {
                              if ($foo = 'bar') { // possible typo
                                  // ...
                              }
                              if ($baz = 0) { // always false
                                  // ...
                              }
                          }
                      }

                      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                      The method fetchMedia uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                          } else {
                              $media_name =& $_FILES[$media_name];
                              $this->mediaName = (get_magic_quotes_gpc()) ? stripslashes($media_name['name']) : $media_name['name'];
                              $this->mediaName = $media_name['name'];
                              $this->mediaType = $media_name['type'];
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      ElseExpression

                      Since: 1.4.0

                      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                      Example

                      class Foo
                      {
                          public function bar($flag)
                          {
                              if ($flag) {
                                  // one branch
                              } else {
                                  // another branch
                              }
                          }
                      }

                      Source https://phpmd.org/rules/cleancode.html#elseexpression

                      The method checkMaxWidth uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  trigger_error(sprintf('Failed fetching image size of %s, skipping max width check..', $this->mediaTmpName), E_USER_WARNING);
                              }
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      ElseExpression

                      Since: 1.4.0

                      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                      Example

                      class Foo
                      {
                          public function bar($flag)
                          {
                              if ($flag) {
                                  // one branch
                              } else {
                                  // another branch
                              }
                          }
                      }

                      Source https://phpmd.org/rules/cleancode.html#elseexpression

                      Avoid assigning values to variables in if clauses and the like (line '425', column '17').
                      Open

                          function checkMaxHeight() {
                              if (!isset($this->maxHeight)) {
                                  return true;
                              }
                              if (false !== $dimension = getimagesize($this->mediaTmpName)) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      IfStatementAssignment

                      Since: 2.7.0

                      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                      Example

                      class Foo
                      {
                          public function bar($flag)
                          {
                              if ($foo = 'bar') { // possible typo
                                  // ...
                              }
                              if ($baz = 0) { // always false
                                  // ...
                              }
                          }
                      }

                      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                      Avoid unused local variables such as '$info'.
                      Open

                                  if ( ! ( $info = @getimagesize( $this->mediaTmpName ) ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      UnusedLocalVariable

                      Since: 0.2

                      Detects when a local variable is declared and/or assigned, but not used.

                      Example

                      class Foo {
                          public function doSomething()
                          {
                              $i = 5; // Unused
                          }
                      }

                      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                      Avoid excessively long variable names like $extensionsToBeSanitized. Keep variable name length under 20.
                      Open

                          var $extensionsToBeSanitized = array( 'php' , 'phtml' , 'phtm' , 'php3' , 'php4' , 'cgi' , 'pl' , 'asp', 'php5' );
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      LongVariable

                      Since: 0.2

                      Detects when a field, formal or local variable is declared with a long name.

                      Example

                      class Something {
                          protected $reallyLongIntName = -3; // VIOLATION - Field
                          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                              $otherReallyLongName = -5; // VIOLATION - Local
                              for ($interestingIntIndex = 0; // VIOLATION - For
                                   $interestingIntIndex < 10;
                                   $interestingIntIndex++ ) {
                              }
                          }
                      }

                      Source https://phpmd.org/rules/naming.html#longvariable

                      Each class must be in a namespace of at least one level (a top-level vendor name)
                      Open

                      class XoopsMediaUploader {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The parameter $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseParameterName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name parameters.

                      Example

                      class ClassName {
                          public function doSomething($user_name) {
                          }
                      }

                      Source

                      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 68 and the first side effect is on line 63.
                      Open

                      <?php
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $allowedMimeTypes = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $targetFileName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$errors"
                      Open

                          var $errors = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $allowUnknownTypes = false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $mediaName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $maxHeight;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$mediaName"
                      Open

                          var $mediaName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$mediaSize"
                      Open

                          var $mediaSize;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace of a class must be on the line after the definition
                      Open

                      class XoopsMediaUploader {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$allowedMimeTypes"
                      Open

                          var $allowedMimeTypes = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$mediaError"
                      Open

                          var $mediaError;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $mediaRealType = '';
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$uploadDir"
                      Open

                          var $uploadDir = '';
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $errors = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $extensionToMime = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $uploadDir = '';
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$prefix"
                      Open

                          var $prefix;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $savedDestination;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $savedFileName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $mediaSize;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $maxFileSize = 0;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$savedFileName"
                      Open

                          var $savedFileName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                      if ( file_exists(XOOPS_ROOT_PATH . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/uploader_error.php') ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $mediaError;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$maxWidth"
                      Open

                          var $maxWidth;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $mediaType;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$maxFileSize"
                      Open

                          var $maxFileSize = 0;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$targetFileName"
                      Open

                          var $targetFileName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$extensionToMime"
                      Open

                          var $extensionToMime = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$mediaTmpName"
                      Open

                          var $mediaTmpName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $maxWidth;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$maxHeight"
                      Open

                          var $maxHeight;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$mediaRealType"
                      Open

                          var $mediaRealType = '';
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$savedDestination"
                      Open

                          var $savedDestination;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$allowUnknownTypes"
                      Open

                          var $allowUnknownTypes = false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $mediaTmpName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $prefix;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$mediaType"
                      Open

                          var $mediaType;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Method name "XoopsMediaUploader::XoopsMediaUploader" is not in camel caps format
                      Open

                          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Incorrect spacing between default value and equals sign for argument "$maxFileSize"; expected 1 but found 0
                      Open

                          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Incorrect spacing between argument "$maxHeight" and equals sign; expected 1 but found 0
                      Open

                          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Incorrect spacing between default value and equals sign for argument "$maxHeight"; expected 1 but found 0
                      Open

                          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $checkImageType = true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Incorrect spacing between argument "$maxFileSize" and equals sign; expected 1 but found 0
                      Open

                          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                          if ( array_key_exists($this->mediaExt, $this->extensionToMime) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $extensionsToBeSanitized = array( 'php' , 'phtml' , 'phtm' , 'php3' , 'php4' , 'cgi' , 'pl' , 'asp', 'php5' );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "XoopsMediaUploader"
                      Open

                          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Incorrect spacing between argument "$maxWidth" and equals sign; expected 1 but found 0
                      Open

                          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Incorrect spacing between default value and equals sign for argument "$maxWidth"; expected 1 but found 0
                      Open

                          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$extensionsToBeSanitized"
                      Open

                          var $extensionsToBeSanitized = array( 'php' , 'phtml' , 'phtm' , 'php3' , 'php4' , 'cgi' , 'pl' , 'asp', 'php5' );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$imageExtensions"
                      Open

                          var $imageExtensions = array( 1 => 'gif', 2 => 'jpg', 3 => 'png', 4 => 'swf', 5 => 'psd', 6 => 'bmp', 7 => 'tif', 8 => 'tif', 9 => 'jpc', 10 => 'jp2', 11 => 'jpx', 12 => 'jb2', 13 => 'swc', 14 => 'iff', 15 => 'wbmp', 16 => 'xbm' );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "fetchMedia"
                      Open

                          function fetchMedia($media_name, $index = null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on property "$checkImageType"
                      Open

                          var $checkImageType = true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The var keyword must not be used to declare a property
                      Open

                          var $imageExtensions = array( 1 => 'gif', 2 => 'jpg', 3 => 'png', 4 => 'swf', 5 => 'psd', 6 => 'bmp', 7 => 'tif', 8 => 'tif', 9 => 'jpc', 10 => 'jp2', 11 => 'jpx', 12 => 'jb2', 13 => 'swc', 14 => 'iff', 15 => 'wbmp', 16 => 'xbm' );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "getMediaSize"
                      Open

                          function getMediaSize() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "getSavedFileName"
                      Open

                          function getSavedFileName(){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "upload"
                      Open

                          function upload($chmod = 0644) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "getMediaType"
                      Open

                          function getMediaType() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "setTargetFileName"
                      Open

                          function setTargetFileName($value) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "getMediaTmpName"
                      Open

                          function getMediaTmpName() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "setPrefix"
                      Open

                          function setPrefix($value){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "getMediaName"
                      Open

                          function getMediaName() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "getSavedDestination"
                      Open

                          function getSavedDestination(){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "_copyFile"
                      Open

                          function _copyFile($chmod) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  if( $info === false || $this->imageExtensions[ (int)$info[2] ] != $ext ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "checkMaxHeight"
                      Open

                          function checkMaxHeight() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space found before comma in function call
                      Open

                              if( in_array( $ext , $this->imageExtensions ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "checkMimeType"
                      Open

                          function checkMimeType() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space found before comma in function call
                      Open

                              $ext = strtolower( substr( strrchr( $this->savedDestination , '.' ) , 1 ) ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              if( in_array( $ext , $this->imageExtensions ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "checkMaxFileSize"
                      Open

                          function checkMaxFileSize() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "checkMaxWidth"
                      Open

                          function checkMaxWidth() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Method name "_copyFile" should not be prefixed with an underscore to indicate visibility
                      Open

                          function _copyFile($chmod) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space found before comma in function call
                      Open

                              $ext = strtolower( substr( strrchr( $this->savedDestination , '.' ) , 1 ) ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "getErrors"
                      Open

                          function &getErrors($ashtml = true) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Blank line found at start of control structure
                      Open

                                  (!empty($this->mediaRealType) && "image" == substr($this->mediaRealType, 0, strpos($this->mediaRealType, "/"))) ){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Method name "XoopsMediaUploader::GetextensionToMime" is not in camel caps format
                      Open

                          function GetextensionToMime() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  if ( ! ( $info = @getimagesize( $this->mediaTmpName ) ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "checkImageType"
                      Open

                          function checkImageType() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              if (!is_object ( $xoopsModule ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "setErrors"
                      Open

                          function setErrors($error) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "sanitizeMultipleExtensions"
                      Open

                          function sanitizeMultipleExtensions() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space found before comma in function call
                      Open

                              $xoopsDB->prefix("mimetypes") . ' t on p.mperm_mime = t.mime_id' . ' WHERE p.mperm_module=' . $xoopsModule->mid() . ' AND p.mperm_groups IN (' . implode(',' , $groups) . ')' . ' GROUP BY t.mime_ext' ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              while ( $myrow = $xoopsDB->fetchArray($result) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Visibility must be declared on method "GetextensionToMime"
                      Open

                          function GetextensionToMime() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $allowUnknownTypes = false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $allowedMimeTypes = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $extensionToMime = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $mediaRealType = '';
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          include_once XOOPS_ROOT_PATH . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/uploader_error.php';
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $targetFileName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $mediaError;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Flag indicating if unrecognized mimetypes should be allowed (use with precaution ! may lead to security issues )
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $savedDestination;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $uploadDir = '';
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $maxHeight;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $prefix;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $checkImageType = true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $mediaName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $maxWidth;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $savedFileName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $maxFileSize = 0;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $mediaSize;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $errors = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line exceeds 120 characters; contains 126 characters
                      Open

                       * $uploader = new XoopsMediaUploader('/home/xoops/uploads', $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $mediaType;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          include_once XOOPS_ROOT_PATH . '/language/english/uploader_error.php';
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $mediaTmpName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          // extensions needed image check (anti-IE Content-Type XSS)
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param   string  $uploadDir
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param   array   $allowedMimeTypes
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaError = !empty($_FILES[$media_name]['error'][$index]) ? $_FILES[$media_name]['error'][$index] : 0;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaName = (get_magic_quotes_gpc()) ? stripslashes($media_name['name']) : $media_name['name'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->allowedMimeTypes =& $allowedMimeTypes;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function fetchMedia($media_name, $index = null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->maxWidth = $this->extensionToMime[$this->mediaExt]['maxWidth'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->setErrors( _ER_UP_NOFILEUPLOADED );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param   int$cmodvalue
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param   int$index Index of the file (if more than one uploaded under that name)
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaType = $_FILES[$media_name]['type'][$index];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          } else {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          $this->mediaExt = strtolower(substr( $this->mediaName, strrpos( $this->mediaName, '.' ) + 1 ));
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          if ( array_key_exists($this->mediaExt, $this->extensionToMime) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->maxFileSize = $this->extensionToMime[$this->mediaExt]['maxSize'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          $this->errors = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  bool
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaName = (get_magic_quotes_gpc()) ? stripslashes($_FILES[$media_name]['name'][$index]) : $_FILES[$media_name]['name'][$index];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaName = $media_name['name'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line exceeds 120 characters; contains 235 characters
                      Open

                          var $imageExtensions = array( 1 => 'gif', 2 => 'jpg', 3 => 'png', 4 => 'swf', 5 => 'psd', 6 => 'bmp', 7 => 'tif', 8 => 'tif', 9 => 'jpc', 10 => 'jp2', 11 => 'jpx', 12 => 'jb2', 13 => 'swc', 14 => 'iff', 15 => 'wbmp', 16 => 'xbm' );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->GetextensionToMime();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaSize = $_FILES[$media_name]['size'][$index];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->setErrors(  _ER_UP_INVALIDFILESIZE );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          if ($this->mediaTmpName == 'none' || !is_uploaded_file($this->mediaTmpName)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->maxFileSize = intval($maxFileSize);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $media_name =& $_FILES[$media_name];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->maxWidth = intval($maxWidth);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaTmpName = $media_name['tmp_name'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          if ($this->mediaName == '') {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->setErrors( _ER_UP_FILENAMEEMPTY );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Fetch the uploaded file
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          if (intval($this->mediaSize) < 0) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $imageExtensions = array( 1 => 'gif', 2 => 'jpg', 3 => 'png', 4 => 'swf', 5 => 'psd', 6 => 'bmp', 7 => 'tif', 8 => 'tif', 9 => 'jpc', 10 => 'jp2', 11 => 'jpx', 12 => 'jb2', 13 => 'swc', 14 => 'iff', 15 => 'wbmp', 16 => 'xbm' );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Constructor
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->setErrors( _ER_UP_MIMETYPELOAD );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaSize = $media_name['size'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param   int$maxWidth
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->setErrors( _ER_UP_FILENOTFOUND );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $index = intval($index);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaTmpName = $_FILES[$media_name]['tmp_name'][$index];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param   int$maxFileSize
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaType = $media_name['type'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->maxHeight = $this->extensionToMime[$this->mediaExt]['maxHeight'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->maxHeight = intval($maxHeight);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param   string  $media_name Name of the file field
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          if (!isset($_FILES[$media_name])) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaError = !empty($media_name['error']) ? $media_name['error'] : 0;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line exceeds 120 characters; contains 137 characters
                      Open

                                  //trigger_error( "XoopsMediaUploader: Set mediaRealType to {$this->mediaRealType} (file extension is $ext)", E_USER_NOTICE );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          } elseif (is_array($_FILES[$media_name]['name']) && isset($index)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          var $extensionsToBeSanitized = array( 'php' , 'phtml' , 'phtm' , 'php3' , 'php4' , 'cgi' , 'pl' , 'asp', 'php5' );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param   int$maxHeight
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (is_array($allowedMimeTypes)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->uploadDir = $uploadDir;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line exceeds 120 characters; contains 144 characters
                      Open

                              $this->mediaName = (get_magic_quotes_gpc()) ? stripslashes($_FILES[$media_name]['name'][$index]) : $_FILES[$media_name]['name'][$index];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Set the target filename
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param   string  $value
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FAILEDOPENDIRWRITE, $this->uploadDir) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!$this->checkMaxWidth()) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          if ($this->mediaError > 0) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return $this->mediaName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  string
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!is_dir($this->uploadDir)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->sanitizeMultipleExtensions();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FILESIZETOOLARGE, $this->mediaSize) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->setErrors( sprintf(_ER_UP_ERROROCCURRED, $this->mediaError) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  string
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  bool
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Get the uploaded filename
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  string
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return $this->mediaSize;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return $this->mediaTmpName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function upload($chmod = 0644) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Set the prefix
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function getMediaType() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  int
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Get the temporary name that the uploaded file was stored under
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  string
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->setErrors( sprintf(_ER_UP_MIMETYPENOTALLOWED, $this->mediaType) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return $this->mediaType;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return $this->savedFileName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return $this->savedDestination;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!$this->checkMimeType()) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!is_writeable($this->uploadDir)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FILEWIDTHTOOLARGE, $this->maxWidth) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function getMediaSize() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function getMediaTmpName() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!$this->checkMaxFileSize()) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!$this->checkImageType()) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (count($this->errors) > 0) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->targetFileName = strval(trim($value));
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Get the size of the uploaded file
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Get the saved filename
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  string
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function getSavedFileName(){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!$this->checkMaxHeight()) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param   string  $value
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function getMediaName() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Get the type of the uploaded file
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Check the file and copy it to the destination
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if ($this->uploadDir == '') {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->setErrors( _ER_UP_INVALIDIMAGEFILE );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function setPrefix($value){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function getSavedDestination(){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->setErrors( _ER_UP_UPLOADDIRNOTSET );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function setTargetFileName($value) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Get the destination the file is saved to
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FAILEDOPENDIR, $this->uploadDir) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FILEHEIGHTTOOLARGE, $this->maxHeight) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->prefix = strval(trim($value));
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->savedFileName = strtolower($this->mediaName);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $info = @getimagesize( $this->savedDestination ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                   trigger_error(sprintf('Failed fetching image size of %s, skipping max height check..', $this->mediaTmpName), E_USER_WARNING);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              } elseif (isset($this->prefix)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              } else {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!isset($this->maxWidth)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  bool
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Check whether or not the uploaded image type is valid
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              } else {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  bool
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->savedFileName = uniqid($this->prefix).'.'.strtolower($matched[1]);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->savedDestination = $this->uploadDir.'/'.$this->savedFileName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  if ($dimension[0] > $this->maxWidth) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line exceeds 120 characters; contains 136 characters
                      Open

                                  trigger_error(sprintf('Failed fetching image size of %s, skipping max width check..', $this->mediaTmpName), E_USER_WARNING);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (false !== $dimension = getimagesize($this->mediaTmpName)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Is the file the right size?
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $this->setErrors( _ER_UP_SUSPICIOUSIMAGE );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      @unlink( $this->savedDestination );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function checkImageType() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function _copyFile($chmod) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              // Check IE XSS before returning success
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  if ($dimension[1] > $this->maxHeight) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->setErrors( _ER_UP_UNKNOWNFILETYPEREJECTED );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Copy the file to its destination
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              @chmod($this->savedDestination, $chmod);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function checkMaxFileSize() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line exceeds 120 characters; contains 137 characters
                      Open

                                   trigger_error(sprintf('Failed fetching image size of %s, skipping max height check..', $this->mediaTmpName), E_USER_WARNING);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return ( empty($this->extensionToMime) || array_key_exists($this->mediaExt, $this->extensionToMime) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  bool
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function checkMaxWidth() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  trigger_error(sprintf('Failed fetching image size of %s, skipping max width check..', $this->mediaTmpName), E_USER_WARNING);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!preg_match("/\.([a-zA-Z0-9]+)$/", $this->mediaName, $matched)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (isset($this->targetFileName)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Is the picture the right width?
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  bool
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $matched = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->savedFileName = $this->targetFileName;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!move_uploaded_file($this->mediaTmpName, $this->savedDestination)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  bool
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if ($this->mediaSize > $this->maxFileSize) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function checkMimeType() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FAILEDUPLOADFILE, $this->mediaName) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if( in_array( $ext , $this->imageExtensions ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Check whether or not the uploaded file type is allowed
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $ext = strtolower( substr( strrchr( $this->savedDestination , '.' ) , 1 ) ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return  bool
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!isset($this->maxHeight)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!$this->_copyFile($chmod)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  if( $info === false || $this->imageExtensions[ (int)$info[2] ] != $ext ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (false !== $dimension = getimagesize($this->mediaTmpName)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Is the picture the right height?
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function checkMaxHeight() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          */
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return $this->errors;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if(empty($this->checkImageType)) return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Inline control structures are not allowed
                      Open

                              if(empty($this->checkImageType)) return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $patterns[] = "/\.".preg_quote($ext)."\./i";
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $mime_types = explode('|',$myrow['mime_types']);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Add an error
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function setErrors($error) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line exceeds 120 characters; contains 178 characters
                      Open

                                      $this->extensionToMime[$mimeExt] = array( 'maxWidth' => $myrow['mperm_maxwidth'], 'maxHeight' => $myrow['mperm_maxwidth'], 'maxSize' => $myrow['mperm_maxsize'] );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Get generated errors
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $replaces = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  foreach($this->extensionsToBeSanitized as $ext){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function GetextensionToMime() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line exceeds 120 characters; contains 208 characters
                      Open

                              $xoopsDB->prefix("mimetypes") . ' t on p.mperm_mime = t.mime_id' . ' WHERE p.mperm_module=' . $xoopsModule->mid() . ' AND p.mperm_groups IN (' . implode(',' , $groups) . ')' . ' GROUP BY t.mime_ext' ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $result = $xoopsDB->query($sql);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  if (count($this->errors) > 0) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return $ret;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line exceeds 120 characters; contains 126 characters
                      Open

                                  (!empty($this->mediaRealType) && "image" == substr($this->mediaRealType, 0, strpos($this->mediaRealType, "/"))) ){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              global $xoopsModule, $xoopsUser, $xoopsDB;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->errors[] = trim($error);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function &getErrors($ashtml = true) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              } else {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if(empty($this->extensionsToBeSanitized)) return;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $replaces[] = "_".$ext.".";
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          **/
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param    bool    $ashtml Format using HTML?
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @return    array|string    Array of array messages OR HTML string
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!$ashtml) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $sql = 'SELECT t.mime_types, t.mime_ext, p.mperm_maxwidth, p.mperm_maxheight, p.mperm_maxsize FROM ' .
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $xoopsDB->prefix("mimetypes") . ' t on p.mperm_mime = t.mime_id' . ' WHERE p.mperm_module=' . $xoopsModule->mid() . ' AND p.mperm_groups IN (' . implode(',' , $groups) . ')' . ' GROUP BY t.mime_ext' ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $mimeExt = $myrow['mime_ext'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $ret .= $error.'<br />';
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              while ( $myrow = $xoopsDB->fetchArray($result) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  if (count($intersect) > 0) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  (!empty($this->mediaRealType) && "image" == substr($this->mediaRealType, 0, strpos($this->mediaRealType, "/"))) ){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  if ( ! ( $info = @getimagesize( $this->mediaTmpName ) ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $this->mediaName = preg_replace($patterns, $replaces, $this->mediaName);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $xoopsModule = $hModule->getByDirname('system');
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * @param   string  $error
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Inline control structures are not allowed
                      Open

                              if(empty($this->extensionsToBeSanitized)) return;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!is_object ( $xoopsModule ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $ret = '';
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          * Sanitize executable filename with multiple extensions
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $intersect = array_intersect($this->allowedMimeTypes,$mime_types);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $this->extensionToMime[$mimeExt] = array( 'maxWidth' => $myrow['mperm_maxwidth'], 'maxHeight' => $myrow['mperm_maxwidth'], 'maxSize' => $myrow['mperm_maxsize'] );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          function sanitizeMultipleExtensions() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $hModule = &xoops_gethandler('module');
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $groups = is_object( $xoopsUser ) ? $xoopsUser -> getGroups() : array(XOOPS_GROUP_ANONYMOUS) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $xoopsDB->prefix('mimetypes_perms') . ' p LEFT JOIN ' .
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $ret = '<h4>Errors Returned While Uploading</h4>';
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      foreach ($this->errors as $error) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if( ("image" == substr($this->mediaType, 0, strpos($this->mediaType, "/"))) ||
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $patterns = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          *
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces after opening bracket; 1 found
                      Open

                      if ( file_exists(XOOPS_ROOT_PATH . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/uploader_error.php') ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->mediaName = $media_name['name'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          if (intval($this->mediaSize) < 0) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->mediaType = $media_name['type'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $this->setErrors( _ER_UP_MIMETYPELOAD );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              $this->setErrors( _ER_UP_FILENOTFOUND );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                          $this->mediaExt = strtolower(substr( $this->mediaName, strrpos( $this->mediaName, '.' ) + 1 ));
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              $this->setErrors( _ER_UP_FILENAMEEMPTY );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          } elseif (is_array($_FILES[$media_name]['name']) && isset($index)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 8 spaces, found 4
                      Open

                          $this->mediaExt = strtolower(substr( $this->mediaName, strrpos( $this->mediaName, '.' ) + 1 ));
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                          $this->mediaExt = strtolower(substr( $this->mediaName, strrpos( $this->mediaName, '.' ) + 1 ));
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces after opening bracket; 1 found
                      Open

                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->setErrors( _ER_UP_FILENOTFOUND );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->setErrors( _ER_UP_NOFILEUPLOADED );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Closing brace indented incorrectly; expected 8 spaces, found 4
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          if (!isset($_FILES[$media_name])) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->mediaType = $_FILES[$media_name]['type'][$index];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->mediaError = !empty($media_name['error']) ? $media_name['error'] : 0;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                          $this->mediaExt = strtolower(substr( $this->mediaName, strrpos( $this->mediaName, '.' ) + 1 ));
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->maxFileSize = $this->extensionToMime[$this->mediaExt]['maxSize'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          if ($this->mediaName == '') {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces after opening bracket; 1 found
                      Open

                          if ( array_key_exists($this->mediaExt, $this->extensionToMime) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->mediaSize = $_FILES[$media_name]['size'][$index];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          } else {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->mediaName = (get_magic_quotes_gpc()) ? stripslashes($media_name['name']) : $media_name['name'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->mediaSize = $media_name['size'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->setErrors(  _ER_UP_INVALIDFILESIZE );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              $this->setErrors( _ER_UP_NOFILEUPLOADED );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $index = intval($index);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $media_name =& $_FILES[$media_name];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                          $this->mediaExt = strtolower(substr( $this->mediaName, strrpos( $this->mediaName, '.' ) + 1 ));
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              $this->setErrors(  _ER_UP_INVALIDFILESIZE );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              $this->setErrors( _ER_UP_FILENOTFOUND );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->mediaName = (get_magic_quotes_gpc()) ? stripslashes($_FILES[$media_name]['name'][$index]) : $_FILES[$media_name]['name'][$index];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->setErrors( _ER_UP_FILENAMEEMPTY );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              $this->setErrors( _ER_UP_FILENAMEEMPTY );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          if ($this->mediaTmpName == 'none' || !is_uploaded_file($this->mediaTmpName)) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function fetchMedia($media_name, $index = null) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $this->setErrors( _ER_UP_MIMETYPELOAD );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->mediaTmpName = $media_name['tmp_name'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 8 spaces, found 4
                      Open

                          $this->errors = array();
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              $this->setErrors( _ER_UP_NOFILEUPLOADED );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              $this->setErrors(  _ER_UP_INVALIDFILESIZE );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->mediaTmpName = $_FILES[$media_name]['tmp_name'][$index];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->mediaError = !empty($_FILES[$media_name]['error'][$index]) ? $_FILES[$media_name]['error'][$index] : 0;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          if ( array_key_exists($this->mediaExt, $this->extensionToMime) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->maxWidth = $this->extensionToMime[$this->mediaExt]['maxWidth'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->maxHeight = $this->extensionToMime[$this->mediaExt]['maxHeight'];
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 8 spaces, found 4
                      Open

                          return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $this->setErrors( sprintf(_ER_UP_MIMETYPENOTALLOWED, $this->mediaType) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $this->setErrors( _ER_UP_INVALIDIMAGEFILE );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              $this->setErrors( sprintf(_ER_UP_ERROROCCURRED, $this->mediaError) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function getMediaSize() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Closing brace indented incorrectly; expected 4 spaces, found 0
                      Open

                      }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function setTargetFileName($value) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FAILEDOPENDIRWRITE, $this->uploadDir) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function getMediaType() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function getMediaTmpName() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $this->setErrors( _ER_UP_INVALIDIMAGEFILE );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 4 spaces, found 0
                      Open

                      }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FAILEDOPENDIRWRITE, $this->uploadDir) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FILEWIDTHTOOLARGE, $this->maxWidth) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FILEHEIGHTTOOLARGE, $this->maxHeight) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FAILEDOPENDIR, $this->uploadDir) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FILESIZETOOLARGE, $this->mediaSize) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FILEWIDTHTOOLARGE, $this->maxWidth) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          if ($this->mediaError > 0) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 4
                      Open

                          }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FAILEDOPENDIR, $this->uploadDir) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FILESIZETOOLARGE, $this->mediaSize) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function upload($chmod = 0644) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $this->setErrors( _ER_UP_UPLOADDIRNOTSET );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function getSavedDestination(){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $this->setErrors( _ER_UP_UPLOADDIRNOTSET );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function getSavedFileName(){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              $this->setErrors( sprintf(_ER_UP_ERROROCCURRED, $this->mediaError) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function getMediaName() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function setPrefix($value){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $this->setErrors( sprintf(_ER_UP_MIMETYPENOTALLOWED, $this->mediaType) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FILEHEIGHTTOOLARGE, $this->maxHeight) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected at least 12 spaces, found 8
                      Open

                              return false;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              $this->setErrors( sprintf(_ER_UP_ERROROCCURRED, $this->mediaError) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 1 space after IF keyword; 0 found
                      Open

                              if( in_array( $ext , $this->imageExtensions ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $this->setErrors( _ER_UP_UNKNOWNFILETYPEREJECTED );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 1 space after IF keyword; 0 found
                      Open

                                  if( $info === false || $this->imageExtensions[ (int)$info[2] ] != $ext ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              $ext = strtolower( substr( strrchr( $this->savedDestination , '.' ) , 1 ) ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              $ext = strtolower( substr( strrchr( $this->savedDestination , '.' ) , 1 ) ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              if( in_array( $ext , $this->imageExtensions ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $info = @getimagesize( $this->savedDestination ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $this->setErrors( _ER_UP_UNKNOWNFILETYPEREJECTED );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FAILEDUPLOADFILE, $this->mediaName) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                      @unlink( $this->savedDestination );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces after opening bracket; 1 found
                      Open

                                  if( $info === false || $this->imageExtensions[ (int)$info[2] ] != $ext ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                      $this->setErrors( _ER_UP_SUSPICIOUSIMAGE );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              $ext = strtolower( substr( strrchr( $this->savedDestination , '.' ) , 1 ) ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              $ext = strtolower( substr( strrchr( $this->savedDestination , '.' ) , 1 ) ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              $ext = strtolower( substr( strrchr( $this->savedDestination , '.' ) , 1 ) ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function checkMaxFileSize() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces after opening bracket; 1 found
                      Open

                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function _copyFile($chmod) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              $ext = strtolower( substr( strrchr( $this->savedDestination , '.' ) , 1 ) ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                      $this->setErrors( _ER_UP_SUSPICIOUSIMAGE );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $this->setErrors( sprintf(_ER_UP_FAILEDUPLOADFILE, $this->mediaName) );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces after opening bracket; 1 found
                      Open

                              if( in_array( $ext , $this->imageExtensions ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              if( in_array( $ext , $this->imageExtensions ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function checkMaxWidth() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function checkMimeType() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  $info = @getimagesize( $this->savedDestination ) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                      @unlink( $this->savedDestination );
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function checkMaxHeight() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              if (!is_object ( $xoopsModule ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces after opening bracket; 1 found
                      Open

                              while ( $myrow = $xoopsDB->fetchArray($result) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 1 space after closing parenthesis; found 0
                      Open

                                  (!empty($this->mediaRealType) && "image" == substr($this->mediaRealType, 0, strpos($this->mediaRealType, "/"))) ){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                                  if ( ! ( $info = @getimagesize( $this->mediaTmpName ) ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function sanitizeMultipleExtensions() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces before closing bracket; 1 found
                      Open

                              $groups = is_object( $xoopsUser ) ? $xoopsUser -> getGroups() : array(XOOPS_GROUP_ANONYMOUS) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      No space found after comma in function call
                      Open

                                  $intersect = array_intersect($this->allowedMimeTypes,$mime_types);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function setErrors($error) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                                  if ( ! ( $info = @getimagesize( $this->mediaTmpName ) ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 1 space after FOREACH keyword; 0 found
                      Open

                                  foreach($this->extensionsToBeSanitized as $ext){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Closing brace indented incorrectly; expected 12 spaces, found 8
                      Open

                              }
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              $groups = is_object( $xoopsUser ) ? $xoopsUser -> getGroups() : array(XOOPS_GROUP_ANONYMOUS) ;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 1 space after IF keyword; 0 found
                      Open

                              if( ("image" == substr($this->mediaType, 0, strpos($this->mediaType, "/"))) ||
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces after opening bracket; 1 found
                      Open

                                  if ( ! ( $info = @getimagesize( $this->mediaTmpName ) ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Line indented incorrectly; expected 8 spaces, found 12
                      Open

                                  foreach($this->extensionsToBeSanitized as $ext){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 0 spaces after opening bracket; 1 found
                      Open

                              if( ("image" == substr($this->mediaType, 0, strpos($this->mediaType, "/"))) ||
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function &getErrors($ashtml = true) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      A closing tag is not permitted at the end of a PHP file
                      Open

                      ?>
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 1 space after IF keyword; 0 found
                      Open

                              if(empty($this->checkImageType)) return true;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 1 newline at end of file; 0 found
                      Open

                      ?>
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 1 space after IF keyword; 0 found
                      Open

                              if(empty($this->extensionsToBeSanitized)) return;
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space before opening parenthesis of function call prohibited
                      Open

                              if (!is_object ( $xoopsModule ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Space after opening parenthesis of function call prohibited
                      Open

                              if (!is_object ( $xoopsModule ) ) {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      No space found after comma in function call
                      Open

                                  $mime_types = explode('|',$myrow['mime_types']);
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function checkImageType() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Opening brace should be on a new line
                      Open

                          function GetextensionToMime() {
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      Expected 1 space after closing parenthesis; found 0
                      Open

                                  foreach($this->extensionsToBeSanitized as $ext){
                      Severity: Minor
                      Found in class/uploader.php by phpcodesniffer

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $mime_types is not named in camelCase.
                      Open

                          function GetextensionToMime() {
                              global $xoopsModule, $xoopsUser, $xoopsDB;
                              if (!is_object ( $xoopsModule ) ) {
                                  $hModule = &xoops_gethandler('module');
                                  $xoopsModule = $hModule->getByDirname('system');
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $mime_types is not named in camelCase.
                      Open

                          function GetextensionToMime() {
                              global $xoopsModule, $xoopsUser, $xoopsDB;
                              if (!is_object ( $xoopsModule ) ) {
                                  $hModule = &xoops_gethandler('module');
                                  $xoopsModule = $hModule->getByDirname('system');
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The variable $media_name is not named in camelCase.
                      Open

                          function fetchMedia($media_name, $index = null) {
                      /*
                              if ( empty( $this->extensionToMime ) ) {
                      */
                              if ( count( $this->extensionToMime ) == 0 ) {
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseVariableName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name variables.

                      Example

                      class ClassName {
                          public function doSomething() {
                              $data_module = new DataModule();
                          }
                      }

                      Source

                      The method XoopsMediaUploader is not named in camelCase.
                      Open

                          function XoopsMediaUploader($uploadDir, $allowedMimeTypes, $maxFileSize=0, $maxWidth=null, $maxHeight=null) {
                      /*
                              @$this->extensionToMime = include( XOOPS_ROOT_PATH . '/class/mimetypes.inc.php' );
                              if ( !is_array( $this->extensionToMime ) ) {
                                  $this->extensionToMime = array();
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseMethodName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name methods.

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method GetextensionToMime is not named in camelCase.
                      Open

                          function GetextensionToMime() {
                              global $xoopsModule, $xoopsUser, $xoopsDB;
                              if (!is_object ( $xoopsModule ) ) {
                                  $hModule = &xoops_gethandler('module');
                                  $xoopsModule = $hModule->getByDirname('system');
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseMethodName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name methods.

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method _copyFile is not named in camelCase.
                      Open

                          function _copyFile($chmod) {
                              $matched = array();
                              if (!preg_match("/\.([a-zA-Z0-9]+)$/", $this->mediaName, $matched)) {
                                  return false;
                              }
                      Severity: Minor
                      Found in class/uploader.php by phpmd

                      CamelCaseMethodName

                      Since: 0.2

                      It is considered best practice to use the camelCase notation to name methods.

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      There are no issues that match your filters.

                      Category
                      Status