1. 11 Sep, 2012 1 commit
    • Christian Kuhn's avatar
      [TASK] Move fixture files from tests/ · b5fcb5b7
      Christian Kuhn authored
      There are still some fixture files within the root tests/ directory.
      The patch moves them to Fixtures/ folders below the using tests
      within the affected core and backend extensions.
      
      Change-Id: Ied23b542a65becac02c9af576728da886552484d
      Resolves: #40834
      Related: #40095
      Releases: 6.0
      Reviewed-on: http://review.typo3.org/14525
      Reviewed-by: Christian Kuhn
      Tested-by: Christian Kuhn
      b5fcb5b7
  2. 09 Sep, 2012 1 commit
    • Christian Kuhn's avatar
      [TASK] Fix for unit tests to change singletons and reset again · 4fd6bfa2
      Christian Kuhn authored
      TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance() is a method
      for unit tests to inject singleton mocks for classes that are
      instantiated with makeInstance. purgeInstances() can be used to reset all
      registered singletons, so makeInstance() creates new objects after that.
      purgeInstances() can change the behaviour of tests that are executed
      afterwards, because *all* registered singletons are reset. Currently the
      helper methods for singletons around makeInstance() are not able to get
      the list of registered singletons, and reset them to the previous list.
      
      The patch introduces method getSingletonInstances() that returns a list
      of all registered singletons (used in setUp()), and method
      resetSingletonInstances() that resets registered singletons to a given
      stored list (used in tearDown()). This way it is possible to fiddle in
      tests with purgeInstances() without introducing side effects to other
      tests.
      
      All unit tests that used purgeInstances() are adapted to take care
      of re constitution of changed objects this way.
      
      Change-Id: I19dc869423a537226bb019e227d84b6f74fe9afc
      Resolves: #40780
      Releases: 6.0
      Reviewed-on: http://review.typo3.org/14487
      Reviewed-by: Christian Kuhn
      Tested-by: Christian Kuhn
      4fd6bfa2
  3. 02 Sep, 2012 1 commit
    • Christian Kuhn's avatar
      [TASK] Stabilize some tests if run as root · 2ec10d97
      Christian Kuhn authored
      GeneralUtility::fixPermissions has a bug if createGroup is set to the id
      of the root group (0), and does not set the correct group. This is fixed
      with a more sophisticated test in fixPermissions to allow 0 as
      valid group. Default for createGroup is empty string, so it is now
      checked with isset and strlen > 0 if chgrp() should be applied.
      
      Additionally, the FAL test permissionsAreCorrectlyRetrieved is splitted
      to four tests, and two of them are skipped if the test is run on linux
      as root.
      
      Change-Id: Icd3bb5808fef195da8394a8fd9c2797f9f01e9aa
      Resolves: #40523
      Releases: 6.0
      Reviewed-on: http://review.typo3.org/14288
      Reviewed-by: Christian Kuhn
      Tested-by: Christian Kuhn
      2ec10d97
  4. 26 Aug, 2012 1 commit
    • Christian Kuhn's avatar
      [TASK] Namespace and move t3lib unit tests - 1 · d78f8bec
      Christian Kuhn authored
      This patch moves most unit tests of the tests/Unit/t3lib/ main
      directory. They follow the new class names of the classes under
      test and are namespaced. Covered are files that belong to the
      backend and core extension.
      The travis test configuration is adapted to execute tests
      located in those extension folders.
      
      Change-Id: Ibda0cb72596a418a3f97eeba83f39428a4d0d532
      Resolves: #40247
      Related: #40095
      Releases: 6.0
      Reviewed-on: http://review.typo3.org/14123
      Reviewed-by: Christian Kuhn
      Tested-by: Christian Kuhn
      d78f8bec
  5. 25 Aug, 2012 1 commit
  6. 24 Aug, 2012 1 commit
  7. 15 Aug, 2012 1 commit
    • Helmut Hummel's avatar
      [SECURITY] t3lib_div::quoteJSvalue allows XSS · 51fe9e0f
      Helmut Hummel authored and Oliver Hader's avatar Oliver Hader committed
      When t3lib_div::quoteJSvalue() was used with second
      parameter set to TRUE closing HTML script tags were
      not escaped correctly.
      
      Now every character except harmless ones is encoded
      to a hex representation.
      
      Change-Id: I4ce17c924458bc4db659b2d37e7932cc9b0c340d
      Releases: 6.0, 4.7, 4.6, 4.5
      Fixes: #23226
      Security-Commit: ee1778ab0c7b4525dbabab4fcb94eb112b767e69
      Security-Bulletin: TYPO3-CORE-SA-2012-004
      Reviewed-on: http://review.typo3.org/13765
      Reviewed-by: Oliver Hader
      Tested-by: Oliver Hader
      51fe9e0f
  8. 14 Aug, 2012 1 commit
    • Christian Welzel's avatar
      [BUGFIX] replace non-free jsmin.php with hook · ae5a216a
      Christian Welzel authored and Christian Kuhn's avatar Christian Kuhn committed
      jsmin.php has a non free license. See referenced bug report for
      details. This patch replaces jsmin.php with a hook to provide a
      way for extensions to implement own compression algorithms.
      
      Change-Id: I1fc5bfe29aaa20692c4323dd28d5c0a95863cf3d
      Fixes: #31832
      Releases: 6.0
      Reviewed-on: http://review.typo3.org/6682
      Reviewed-by: Marcus Schwemer
      Tested-by: Marcus Schwemer
      Reviewed-by: Stefan Neufeind
      Reviewed-by: Wouter Wolters
      Tested-by: Wouter Wolters
      Reviewed-by: Christian Kuhn
      Tested-by: Christian Kuhn
      ae5a216a
  9. 01 Aug, 2012 1 commit
  10. 21 Jul, 2012 1 commit
    • Anja Leichsenring's avatar
      [-FEATURE] Remove restricted class prefixes · 7b586738
      Anja Leichsenring authored and Christian Kuhn's avatar Christian Kuhn committed
      Sometimes the core enforces classes to be prefixed with special names
      like 'tx_' or 'user_', especially if they are loaded as user functions.
      This constraint is in the core for a long time, but was already weakened
      by for example the extbase code, and was only required at some arbitrary
      points. The constraint itself does not make much sense, and is now
      fully removed with this patch.
      As an additional advantage, this patch eases the transition to
      namespaced class names.
      
      Notes:
      - Remove configuration Setting '[sys][additionalAllowedClassPrefixes]'
      - Update t3lib_registry to accept every namespace at least 2 chars long
      - Adapt tests
      - Remove and deprecate calls to t3lib_div::hasValidClassPrefix
      
      Change-Id: I0ba4fd41beb5f05bf87a14d735bb83922d62b247
      Resolves: #39164
      Releases: 6.0
      Reviewed-on: http://review.typo3.org/12976
      Reviewed-by: Daniel Lorenz
      Tested-by: Daniel Lorenz
      Reviewed-by: Christian Kuhn
      Tested-by: Christian Kuhn
      7b586738
  11. 04 Jul, 2012 1 commit
    • Andy Grunwald's avatar
      [BUGFIX] Fix UnitTests for t3lib_div::validPathStr · c428524d
      Andy Grunwald authored and Oliver Hader's avatar Oliver Hader committed
      The change in #38604 introduced failing UnitTests
      for t3lib_div::validPathStr, because we changed
      the return value to real boolean.
      The UnitTest was checked about a NULL value.
      With the change in #38604, we return FALSE.
      
      Change-Id: I8d7203564401f0add45fbdbaa7e0b371d57e5b7d
      Fixes: #38613
      Releases: 6.0
      Reviewed-on: http://review.typo3.org/12561
      Reviewed-by: Georg Ringer
      Tested-by: Georg Ringer
      Reviewed-by: Oliver Hader
      Tested-by: Oliver Hader
      c428524d
  12. 02 Jul, 2012 1 commit
  13. 30 Jun, 2012 1 commit
  14. 10 Jun, 2012 1 commit
  15. 09 Jun, 2012 1 commit
    • Felix Kopp's avatar
      [TASK] CGL: Improve function spacing · 941f7dd8
      Felix Kopp authored
      Improves last outstanding function spacing issues of type
      OpeningFunctionBraceKernighanRitchieSpaceBeforeBrace.
      
      Change-Id: I393ca85d63779b5368ea6d8aaa8dbcf629ca0df6
      Fixes: #37827
      Reviewed-on: http://review.typo3.org/11877
      Reviewed-by: Oliver Klee
      Reviewed-by: Georg Ringer
      Tested-by: Georg Ringer
      941f7dd8
  16. 25 May, 2012 1 commit
    • Tolleiv Nietsch's avatar
      [TASK] Add unittest for url parameter related functions · 7b741f13
      Tolleiv Nietsch authored
      Adds tests for implodeArrayForUrl, explodeUrl2Array and
      compileSelectedGetVarsFromArray.
      
      Change-Id: I07c7ee3a743632056b4e061fdb32af63b92abf17
      Resolves: #37342
      Releases: 6.0
      Reviewed-on: http://review.typo3.org/11347
      Reviewed-by: Philipp Gampe
      Tested-by: Philipp Gampe
      Reviewed-by: Wouter Wolters
      Tested-by: Wouter Wolters
      Reviewed-by: Oliver Klee
      Tested-by: Oliver Klee
      Reviewed-by: Georg Ringer
      Tested-by: Georg Ringer
      7b741f13
  17. 20 May, 2012 3 commits
  18. 19 May, 2012 2 commits
  19. 13 May, 2012 1 commit
  20. 05 May, 2012 1 commit
  21. 15 Apr, 2012 1 commit
  22. 14 Apr, 2012 1 commit
    • Christian Kuhn's avatar
      [TASK] Remove t3lib_div::intInRange() · 31aa2572
      Christian Kuhn authored
      The method is scheduled for deletion in 6.0 but was still used in the core.
      The patch adapts the usages and removes intInRange.
      
      Change-Id: Id4724c566f61c5a7238ea29be6f385bdc99d8876
      Resolves: #36029
      Releases: 6.0
      Reviewed-on: http://review.typo3.org/10454
      Reviewed-by: Christian Kuhn
      Tested-by: Christian Kuhn
      31aa2572
  23. 13 Apr, 2012 1 commit
    • Christian Kuhn's avatar
      [TASK] Remove deprecated code for 6.0 · d5979e4c
      Christian Kuhn authored
      Removes all deprecated methods and files that are unused in core and scheduled
      for deletion in 4.8 / 6.0. Some more complicated parts are left out for now.
      
      Change-Id: I03e236cedfbfa666d9b6f83848b11bb0977cdff0
      Resolves: #35923
      Releases: 6.0
      Reviewed-on: http://review.typo3.org/10361
      Reviewed-by: Georg Ringer
      Tested-by: Georg Ringer
      Reviewed-by: Christian Kuhn
      Tested-by: Christian Kuhn
      d5979e4c
  24. 11 Apr, 2012 1 commit
    • Ingo Renner's avatar
      [BUGFIX] t3lib_div::getUrl() providing wrong error information · ecc71ee8
      Ingo Renner authored
      When using t3lib_div::getUrl() with lib file/context it uses
      file_get_contents() to read a URL. When this fails it tries to provide the
      reason for the error but does not return the actual issue.
      
      The error key in the returned array contains the error retrieved by
      error_get_last() which does not provide the error that occurred with
      file_get_contents(), but with PHP. Usually this is a notice.
      
      The actual error message of file_get_contents() is in the variable
      $http_response_header which is available after calling file_get_contents().
      
      See http://de2.php.net/manual/en/reserved.variables.httpresponseheader.php
      
      Change-Id: I6bb9ad7010a633f259da103f71f404592194f743
      Fixes: #35847
      Releases: 6.0, 4.7, 4.6, 4.5
      Reviewed-on: http://review.typo3.org/10229
      Reviewed-by: Oliver Klee
      Tested-by: Oliver Klee
      Reviewed-by: Andy Grunwald
      Tested-by: Andy Grunwald
      Reviewed-by: Christian Kuhn
      Tested-by: Christian Kuhn
      Reviewed-by: Ingo Renner
      Tested-by: Ingo Renner
      ecc71ee8
  25. 24 Mar, 2012 1 commit
    • Philipp Gampe's avatar
      [BUGFIX] Fatal error function posix_getgroups is not available · 40d8fec1
      Philipp Gampe authored
      This happens for the mkdirSetsGroupOwnershipOfCreatedDirectory() test in
      t3lib_divTest.
      
      Solution, just skip the test if the function does not exists.
      
      Also do same safety check for posix_getegid() as done some tests above.
      
      Change-Id: I18cbebc0b22ae5a7318673ed8abd2bd01003ba57
      Fixes: #33718
      Releases: 6.0, 4.7
      Reviewed-on: http://review.typo3.org/8867
      Reviewed-by: Tolleiv Nietsch
      Tested-by: Tolleiv Nietsch
      Reviewed-by: Jigal van Hemert
      Tested-by: Jigal van Hemert
      40d8fec1
  26. 07 Mar, 2012 1 commit
  27. 16 Feb, 2012 1 commit
  28. 25 Jan, 2012 1 commit
  29. 14 Jan, 2012 1 commit
    • Dmitry Dulepov's avatar
      [BUGFIX] t3lib_div::validPathStr() fails on certain file names · faf04f9d
      Dmitry Dulepov authored
      Function t3lib_div::validPathStr() fails on file names with Unicode
      characters. Adding 'u' modifier to the regular expression solves
      the problem.
      
      Change-Id: I9dfb31090d12133798f4e8d47e7394e6c7be51a6
      Resolves: #32046
      Releases: 4.7, 4.6, 4.5
      Reviewed-on: http://review.typo3.org/7032
      Reviewed-by: Oliver Klee
      Reviewed-by: Helmut Hummel
      Tested-by: Helmut Hummel
      Reviewed-by: Stefan Neufeind
      Reviewed-by: Tolleiv Nietsch
      Tested-by: Tolleiv Nietsch
      faf04f9d
  30. 24 Oct, 2011 1 commit
    • Helmut Hummel's avatar
      [BUGFIX] Restructure the random byte generator · 35801296
      Helmut Hummel authored and Steffen Gebert's avatar Steffen Gebert committed
      Restructure the code to use the most performant methods first
      if available. Take specialities of Windows OS and special
      PHP versions into account.
      
      Read/ generate more bytes than needed in one call, because it
      does not cost (much) more to generate more random bytes, but it's
      much cheaper for the next calls, because the bytes are already there.
      
      Resolves: #23355
      Releases: 4.6, 4.5, 4.4
      
      Change-Id: I6bad300842f3da40c620b3d79b8116345a2749a0
      Reviewed-on: http://review.typo3.org/4537
      Reviewed-by: Helmut Hummel
      Tested-by: Helmut Hummel
      Reviewed-by: Steffen Ritter
      Tested-by: Steffen Ritter
      Reviewed-by: Steffen Gebert
      Tested-by: Steffen Gebert
      35801296
  31. 24 Aug, 2011 1 commit
    • Susanne Moog's avatar
      [TASK] Streamline class prefix handling in the core · fb0b7724
      Susanne Moog authored and Christian Kuhn's avatar Christian Kuhn committed
      At the moment the frontend option userFuncClassPrefix is also checked in
      various backend scenarios (for example the registry) and in general
      everywhere t3lib_div::hasValidPrefix is called. Therefore it should be a system
      option. Additionally to ensure "user_" is working as a prefix this was given
      hardcoded as additionalPrefix to the function in some cases.
      
      This patch streamlines the handling of prefixes, introduces a [SYS] option
      additionalAllowedClassPrefixes, deprecates the [FE] option and allows
      the prefixes 'tx_', 'Tx_', 'user_' and 'User_' by default.
      
      Change-Id: I70fa89120dbe8c7790e3d6de4b173b69beb8a6f9
      Resolves: #29166
      Releases: 4.6
      Reviewed-on: http://review.typo3.org/4526
      Reviewed-by: Philipp Gampe
      Tested-by: Philipp Gampe
      Reviewed-by: Christian Kuhn
      Tested-by: Christian Kuhn
      fb0b7724
  32. 21 Aug, 2011 1 commit
    • Susanne Moog's avatar
      [BUGFIX] Setting userFuncClassPrefix to empty string does not work · f2c20600
      Susanne Moog authored and Christian Kuhn's avatar Christian Kuhn committed
      Setting $GLOBALS['TYPO3_CONF_VARS']['FE']['userFuncClassPrefix']
      to an empty string - to allow all prefixes - does not work as
      expected as the check in t3lib_div expects a valid string with
      length > 0. Adjust t3lib_div::hasValidClassPrefix to also
      allow empty prefix var.
      
      Change-Id: Idbd8cf7a547d9549f1c31dadd731eda48f52fcec
      Resolves: #29133
      Releases: 4.6
      Reviewed-on: http://review.typo3.org/4445
      Reviewed-by: Philipp Gampe
      Tested-by: Philipp Gampe
      Reviewed-by: Christian Kuhn
      Tested-by: Christian Kuhn
      f2c20600
  33. 07 Aug, 2011 2 commits
    • Stefan Neufeind's avatar
      [TASK] Optimizations for IPv6-functions in t3lib_div · de17eb22
      Stefan Neufeind authored
      * speedup by using IPv6-support from PHP if present
      * since there is IPv6Hex2Bin(), also add IPv6Bin2Hex()
      * since there is normalizeIPv6(), also add compressIPv6()
      * normalization also involves converting to lowercase
      * extend unit-tests
      
      Change-Id: I7c9eda4de0f2c06f06a530f1180233d592f9dfdc
      Resolves: #28669
      Releases: 4.6, 4.7
      Reviewed-on: http://review.typo3.org/4019
      Reviewed-by: Andreas Wolf
      Tested-by: Andreas Wolf
      de17eb22
    • Stefan Neufeind's avatar
      [BUGFIX] cmpIPv4: prevent E_NOTICE, cleanup compare, testcases · 2329466c
      Stefan Neufeind authored
      Cleanup for an E_NOTICE on exploding the bitmask.
      Replaced (correct working, but "unreadable") strcmp().
      Add testcases.
      
      Change-Id: I3836d3c53ab6093e3427047c4a5089778dd04ca2
      Resolves: #27230
      Releases: 4.3, 4.4, 4.5, 4.6
      Reviewed-on: http://review.typo3.org/2536
      Reviewed-by: Björn Pedersen
      Tested-by: Björn Pedersen
      Reviewed-by: Andreas Wolf
      Tested-by: Andreas Wolf
      2329466c
  34. 31 Jul, 2011 1 commit
  35. 24 Jul, 2011 1 commit
  36. 12 Jul, 2011 1 commit
    • Stefan Neufeind's avatar
      [BUGFIX] t3lib_div::cmpIPv6() fails to compare · adcf6084
      Stefan Neufeind authored
      cmpIPv6 makes wrong assumptions about the output of IPv6Hex2Bin().
      Also currently only netmasks of /48, /64 and /128 are supported.
      
      Added a cleanup for an E_NOTICE on exploding the bitmask.
      Replaced IPv6Hex2Bin() with php function (same output, just quicker).
      Added testcases.
      
      Change-Id: I816db2b9ce42d13f61ecd7f87406730c424de52f
      Resolves: #27210
      Releases: 4.6, 4.5
      Reviewed-on: http://review.typo3.org/2519
      Reviewed-by: Stefan Neufeind
      Tested-by: Stefan Neufeind
      Reviewed-by: Xavier Perseguers
      Tested-by: Xavier Perseguers
      adcf6084