Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

There are two ideas mixed together that complicate the code:

  • Manipulating an image.
  • Uploading an image.

Separate the concerns into two different classes (e.g., SimpleImage and SecureImageUpload).

See the SimpleImage class for a reasonably designed class that handles image manipulation. It has methods to resize, scale, load, and save image files of various formats. I'd recommend that you extend the SimpleImage class to include methods that expose the extra functionality you desire.

Encapsulation means that object data is manipulated by exposing methods to other objects. For example:

$image->load( "filename.jpg" );
$image->scale( 100 );
$image->save( "thumbnails/filename.jpg" );

Securely handling image file uploads in PHP is a daunting task to do correctly. See:

There are two ideas mixed together that complicate the code:

  • Manipulating an image.
  • Uploading an image.

Separate the concerns into two different classes (e.g., SimpleImage and SecureImageUpload).

See the SimpleImage class for a reasonably designed class that handles image manipulation. It has methods to resize, scale, load, and save image files of various formats. I'd recommend that you extend the SimpleImage class to include methods that expose the extra functionality you desire.

Encapsulation means that object data is manipulated by exposing methods to other objects. For example:

$image->load( "filename.jpg" );
$image->scale( 100 );
$image->save( "thumbnails/filename.jpg" );

Securely handling image file uploads in PHP is a daunting task to do correctly. See:

There are two ideas mixed together that complicate the code:

  • Manipulating an image.
  • Uploading an image.

Separate the concerns into two different classes (e.g., SimpleImage and SecureImageUpload).

See the SimpleImage class for a reasonably designed class that handles image manipulation. It has methods to resize, scale, load, and save image files of various formats. I'd recommend that you extend the SimpleImage class to include methods that expose the extra functionality you desire.

Encapsulation means that object data is manipulated by exposing methods to other objects. For example:

$image->load( "filename.jpg" );
$image->scale( 100 );
$image->save( "thumbnails/filename.jpg" );

Securely handling image file uploads in PHP is a daunting task to do correctly. See:

replaced http://security.stackexchange.com/ with https://security.stackexchange.com/
Source Link

There are two ideas mixed together that complicate the code:

  • Manipulating an image.
  • Uploading an image.

Separate the concerns into two different classes (e.g., SimpleImage and SecureImageUpload).

See the SimpleImage class for a reasonably designed class that handles image manipulation. It has methods to resize, scale, load, and save image files of various formats. I'd recommend that you extend the SimpleImage class to include methods that expose the extra functionality you desire.

Encapsulation means that object data is manipulated by exposing methods to other objects. For example:

$image->load( "filename.jpg" );
$image->scale( 100 );
$image->save( "thumbnails/filename.jpg" );

Securely handling image file uploads in PHP is a daunting task to do correctly. See:

There are two ideas mixed together that complicate the code:

  • Manipulating an image.
  • Uploading an image.

Separate the concerns into two different classes (e.g., SimpleImage and SecureImageUpload).

See the SimpleImage class for a reasonably designed class that handles image manipulation. It has methods to resize, scale, load, and save image files of various formats. I'd recommend that you extend the SimpleImage class to include methods that expose the extra functionality you desire.

Encapsulation means that object data is manipulated by exposing methods to other objects. For example:

$image->load( "filename.jpg" );
$image->scale( 100 );
$image->save( "thumbnails/filename.jpg" );

Securely handling image file uploads in PHP is a daunting task to do correctly. See:

There are two ideas mixed together that complicate the code:

  • Manipulating an image.
  • Uploading an image.

Separate the concerns into two different classes (e.g., SimpleImage and SecureImageUpload).

See the SimpleImage class for a reasonably designed class that handles image manipulation. It has methods to resize, scale, load, and save image files of various formats. I'd recommend that you extend the SimpleImage class to include methods that expose the extra functionality you desire.

Encapsulation means that object data is manipulated by exposing methods to other objects. For example:

$image->load( "filename.jpg" );
$image->scale( 100 );
$image->save( "thumbnails/filename.jpg" );

Securely handling image file uploads in PHP is a daunting task to do correctly. See:

deleted 4 characters in body
Source Link
Dave Jarvis
  • 1.9k
  • 1
  • 12
  • 29

There are two ideas mixed together that complicate the code:

  • Manipulating an image.
  • Uploading an image.

Separate the concerns into two different classes (e.g., SimpleImage and SecureImageUpload).

See the SimpleImage class for a reasonably designed class that handles image manipulation. It has methods to resize, scale, load, and save image files of various formats. I'd recommend that you extend the SimpleImage class to include methods that expose the extra functionality you desire.

Encapsulation means that object data is manipulated throughby exposing methods exposed to other classesobjects. For example:

$image->load( "filename.jpg" );
$image->scale( 100 );
$image->save( "thumbnails/filename.jpg" );

Securely handling image file uploads in PHP is a daunting task to do correctly. See:

There are two ideas mixed together that complicate the code:

  • Manipulating an image.
  • Uploading an image.

Separate the concerns into two different classes (e.g., SimpleImage and SecureImageUpload).

See the SimpleImage class for a reasonably designed class that handles image manipulation. It has methods to resize, scale, load, and save image files of various formats. I'd recommend that you extend the SimpleImage class to include methods that expose the extra functionality you desire.

Encapsulation means that object data is manipulated through methods exposed to other classes. For example:

$image->load( "filename.jpg" );
$image->scale( 100 );
$image->save( "thumbnails/filename.jpg" );

Securely handling image file uploads in PHP is a daunting task to do correctly. See:

There are two ideas mixed together that complicate the code:

  • Manipulating an image.
  • Uploading an image.

Separate the concerns into two different classes (e.g., SimpleImage and SecureImageUpload).

See the SimpleImage class for a reasonably designed class that handles image manipulation. It has methods to resize, scale, load, and save image files of various formats. I'd recommend that you extend the SimpleImage class to include methods that expose the extra functionality you desire.

Encapsulation means that object data is manipulated by exposing methods to other objects. For example:

$image->load( "filename.jpg" );
$image->scale( 100 );
$image->save( "thumbnails/filename.jpg" );

Securely handling image file uploads in PHP is a daunting task to do correctly. See:

added 34 characters in body
Source Link
Dave Jarvis
  • 1.9k
  • 1
  • 12
  • 29
Loading
Source Link
Dave Jarvis
  • 1.9k
  • 1
  • 12
  • 29
Loading
lang-php

AltStyle によって変換されたページ (->オリジナル) /