Bug #26660

imagecopyresized has invalid function parameter

Added by Benjamin Schulte over 8 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2011-05-06
Due date:
% Done:

100%

TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The class t3lib_stdgraphic provides the method imagecopyresized with a parameter list which defines the parameters $w and $h twice.

Due to this, it is impossible to create a mock of the stdGraphic class using PHPUnit.

In any way, I don't know how the method should work correctly.

function imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h)

Related issues

Related to TYPO3 Core - Bug #36947: GIFBUILDER render twice Closed 2012-05-08
Related to TYPO3 Core - Bug #39563: Regression in t3lib_iconWorks::imagecopyresized Closed 2012-08-06

Associated revisions

Revision 06ea329b (diff)
Added by Stefan Neufeind almost 8 years ago

[BUGFIX] imagecopyresized: correct invalid parameters

The classes t3lib_stdgraphic and t3lib_iconworks provide
the method imagecopyresized. Those functions got parameters
$w, $h twice in the function-header and therefore the function
only worked in "special cases".

This patch also adds a docblock and improves the (internal)
naming of the variables.

Change-Id: Id43229caa3694e8859f9912946c963f907f92951
Fixes: #26660
Releases: 4.4, 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/2564
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Philipp Gampe
Reviewed-by: Stefan Neufeind
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter

Revision 98f73d8b (diff)
Added by Stefan Neufeind almost 8 years ago

[BUGFIX] imagecopyresized: correct invalid parameters

The classes t3lib_stdgraphic and t3lib_iconworks provide
the method imagecopyresized. Those functions got parameters
$w, $h twice in the function-header and therefore the function
only worked in "special cases".

This patch also adds a docblock and improves the (internal)
naming of the variables.

Change-Id: Id43229caa3694e8859f9912946c963f907f92951
Fixes: #26660
Releases: 4.4, 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/9608
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter

Revision 1af5018d (diff)
Added by Stefan Neufeind over 7 years ago

[BUGFIX] imagecopyresized: correct invalid parameters

The classes t3lib_stdgraphic and t3lib_iconworks provide
the method imagecopyresized. Those functions got parameters
$w, $h twice in the function-header and therefore the function
only worked in "special cases".

This patch also adds a docblock and improves the (internal)
naming of the variables.

Change-Id: I00166cb30b278e1124675111d2cc3174811e4151
Resolves: #26660
Releases: 4.4, 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/6829
Reviewed-by: Wouter Wolters
Reviewed-by: Andreas Bouche
Tested-by: Andreas Bouche
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter

Revision 56e66659 (diff)
Added by Stefan Neufeind about 7 years ago

[BUGFIX] imagecopyresized: correct invalid parameters

The classes t3lib_stdgraphic and t3lib_iconworks provide
the method imagecopyresized. Those functions got parameters
$w, $h twice in the function-header and therefore the function
only worked in "special cases".

This patch also adds a docblock and improves the (internal)
naming of the variables.

Change-Id: Id43229caa3694e8859f9912946c963f907f92951
Resolves: #26660
Releases: 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/6831
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

History

#1 Updated by Mr. Hudson over 8 years ago

Patch set 1 of change Id43229caa3694e8859f9912946c963f907f92951 has been pushed to the review server.
It is available at http://review.typo3.org/2564

#2 Updated by Stefan Neufeind over 8 years ago

Quickly hacked together script to check for duplicate params. Detected two occurences of this here and didn't find something else on Core, extbase, fluid or FLOW3.

  1. search, leave out some comment-lines
    $ grep "function " -R * | grep -v \* >found

find-script:
$fp = fopen("found", "r");
while($s = fgets($fp)) {
$params = $s;
$pos = strpos($params, '(');
if($pos <= 0) continue;
$params = substr($params, $pos+1);

$pos = strpos($params, ')');
if($pos <= 0) continue;
$params = substr($params, 0, $pos);
$aParams = explode(',', $params);
$aParams = array_map('trim', $aParams);
if(count($aParams) != count(array_unique($aParams))) {
var_dump($s);
}
}

#3 Updated by Mr. Hudson over 8 years ago

Patch set 2 of change Id43229caa3694e8859f9912946c963f907f92951 has been pushed to the review server.
It is available at http://review.typo3.org/2564

#4 Updated by Thorsten Kahler over 8 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Benjamin Schulte

Does this grievance really produce any errors? From what I read from PHPDoc this is just a wrapper method for internal use and the duplicated variable names always should be assigned the same values.

#5 Updated by Mr. Jenkins about 8 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 3 of change Id43229caa3694e8859f9912946c963f907f92951 has been pushed to the review server.
It is available at http://review.typo3.org/2564

#6 Updated by Mr. Jenkins about 8 years ago

Patch set 1 of change I00166cb30b278e1124675111d2cc3174811e4151 has been pushed to the review server.
It is available at http://review.typo3.org/6829

#7 Updated by Mr. Jenkins about 8 years ago

Patch set 1 of change Id43229caa3694e8859f9912946c963f907f92951 has been pushed to the review server.
It is available at http://review.typo3.org/6831

#8 Updated by Mr. Jenkins about 8 years ago

Patch set 1 of change Id43229caa3694e8859f9912946c963f907f92951 has been pushed to the review server.
It is available at http://review.typo3.org/6834

#9 Updated by Mr. Jenkins about 8 years ago

Patch set 4 of change Id43229caa3694e8859f9912946c963f907f92951 has been pushed to the review server.
It is available at http://review.typo3.org/2564

#10 Updated by Gerrit Code Review about 8 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/2564

#11 Updated by Gerrit Code Review about 8 years ago

Patch set 2 for branch TYPO3_4-4 has been pushed to the review server.
It is available at http://review.typo3.org/6834

#12 Updated by Gerrit Code Review about 8 years ago

Patch set 2 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/6831

#13 Updated by Gerrit Code Review about 8 years ago

Patch set 2 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/6829

#14 Updated by Gerrit Code Review about 8 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/2564

#15 Updated by Gerrit Code Review about 8 years ago

Patch set 3 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/6829

#16 Updated by Gerrit Code Review about 8 years ago

Patch set 3 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/6831

#17 Updated by Gerrit Code Review about 8 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/2564

#18 Updated by Gerrit Code Review almost 8 years ago

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/9608

#19 Updated by Stefan Neufeind almost 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#20 Updated by Gerrit Code Review almost 8 years ago

  • Status changed from Resolved to Under Review

Patch set 4 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/6829

#21 Updated by Gerrit Code Review almost 8 years ago

Patch set 5 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/6829

#22 Updated by Gerrit Code Review over 7 years ago

Patch set 6 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/6829

#23 Updated by Gerrit Code Review over 7 years ago

Patch set 4 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/6831

#24 Updated by Stefan Neufeind over 7 years ago

  • Status changed from Under Review to Resolved

#25 Updated by Gerrit Code Review about 7 years ago

  • Status changed from Resolved to Under Review

Patch set 5 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/6831

#26 Updated by Stefan Neufeind about 7 years ago

  • Status changed from Under Review to Resolved

#27 Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF