Select Git revision
-
ale authored
The login handler is now a simpler, standalone http.Handler wrapper. The separation between the SSO application and the login handler is now fairly complete. The login handler no longer forces the user to a specific workflow via session cookies, but it works on a request-by-request basis instead, which makes the "back" button works as expected (allowing the user to bail out of a broken 2FA process, for example). Session handling has been simplified as well: there is a single session for authentication and login state, which should remove the opportunity for session synchronization errors.
ale authoredThe login handler is now a simpler, standalone http.Handler wrapper. The separation between the SSO application and the login handler is now fairly complete. The login handler no longer forces the user to a specific workflow via session cookies, but it works on a request-by-request basis instead, which makes the "back" button works as expected (allowing the user to bail out of a broken 2FA process, for example). Session handling has been simplified as well: there is a single session for authentication and login state, which should remove the opportunity for session synchronization errors.
class-wp-image-editor-imagick.php 21.20 KiB
<?php
/**
* WordPress Imagick Image Editor
*
* @package WordPress
* @subpackage Image_Editor
*/
/**
* WordPress Image Editor Class for Image Manipulation through Imagick PHP Module
*
* @since 3.5.0
* @package WordPress
* @subpackage Image_Editor
* @uses WP_Image_Editor Extends class
*/
class WP_Image_Editor_Imagick extends WP_Image_Editor {
/**
* Imagick object.
*
* @access protected
* @var Imagick
*/
protected $image;
public function __destruct() {
if ( $this->image instanceof Imagick ) {
// we don't need the original in memory anymore
$this->image->clear();
$this->image->destroy();
}
}
/**
* Checks to see if current environment supports Imagick.
*
* We require Imagick 2.2.0 or greater, based on whether the queryFormats()
* method can be called statically.
*
* @since 3.5.0
*
* @static
* @access public
*
* @param array $args
* @return bool
*/
public static function test( $args = array() ) {
// First, test Imagick's extension and classes.
if ( ! extension_loaded( 'imagick' ) || ! class_exists( 'Imagick', false ) || ! class_exists( 'ImagickPixel', false ) )
return false;
if ( version_compare( phpversion( 'imagick' ), '2.2.0', '<' ) )
return false;
$required_methods = array(
'clear',
'destroy',
'valid',
'getimage',
'writeimage',
'getimageblob',
'getimagegeometry',
'getimageformat',
'setimageformat',
'setimagecompression',
'setimagecompressionquality',
'setimagepage',
'setoption',