first commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2014 PrestaShop SA
|
||||
* @license http://addons.prestashop.com/en/content/12-terms-and-conditions-of-use
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class EmailTemplateFilterIterator extends RecursiveFilterIterator
|
||||
{
|
||||
private static $validExtensions = array('tpl', 'html', 'txt');
|
||||
|
||||
public function accept()
|
||||
{
|
||||
if ($this->getInnerIterator()->hasChildren()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return in_array(
|
||||
$this->current()->getExtension(),
|
||||
self::$validExtensions,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
50
modules/ps_emailsmanager/classes/ImageFilterIterator.php
Normal file
50
modules/ps_emailsmanager/classes/ImageFilterIterator.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2014 PrestaShop SA
|
||||
* @license http://addons.prestashop.com/en/content/12-terms-and-conditions-of-use
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class ImageFilterIterator extends RecursiveFilterIterator
|
||||
{
|
||||
private static $validTypeConstants = array(
|
||||
IMAGETYPE_GIF,
|
||||
IMAGETYPE_JPEG,
|
||||
IMAGETYPE_PNG,
|
||||
);
|
||||
|
||||
public function accept()
|
||||
{
|
||||
return $this->getInnerIterator()->hasChildren() || $this->isImage();
|
||||
}
|
||||
|
||||
private function isImage()
|
||||
{
|
||||
$filePath = $this->current()->getRealPath();
|
||||
|
||||
if (is_dir($filePath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (function_exists('exif_imagetype')) {
|
||||
$type = exif_imagetype($filePath);
|
||||
|
||||
return in_array($type, self::$validTypeConstants, true);
|
||||
} else {
|
||||
$imagesize = getimagesize($filePath);
|
||||
|
||||
// Index 2 is one of the IMAGETYPE_XXX constants indicating the
|
||||
// type of the image
|
||||
return in_array($imagesize[2], self::$validTypeConstants, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
25
modules/ps_emailsmanager/classes/index.php
Normal file
25
modules/ps_emailsmanager/classes/index.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2014 PrestaShop SA
|
||||
* @license http://addons.prestashop.com/en/content/12-terms-and-conditions-of-use
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
Reference in New Issue
Block a user