Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This patch adds inline css functionality to sendy (1.1.9.5).
- Thanks to tijsverkoyen for his great inline css class: https://github.com/tijsverkoyen/CssToInlineStyles
- Also thanks to Fabien Potencier and his team (Symfony) for being awesome: http://symfony.com/
- Patch by Kai Fricke <kai@kaifricke.com>
- diff -uNr sendy/includes/create/send-now.php sendy-modified/includes/create/send-now.php
- --- sendy/includes/create/send-now.php 2014-08-05 16:29:00.000000000 +0200
- +++ sendy-modified/includes/create/send-now.php 2014-11-19 15:53:34.812099786 +0100
- @@ -2,6 +2,7 @@
- <?php include('../login/auth.php');?>
- <?php include('../helpers/class.phpmailer.php');?>
- <?php include('../helpers/short.php');?>
- +<?php include('../inline_css.php');?>
- <?php
- //variables
- @@ -463,9 +464,11 @@
- $html_treated = str_replace($unconverted_date, $converted_date, $html_treated);
- $plain_treated = str_replace($unconverted_date, $converted_date, $plain_treated);
- $title_treated = str_replace($unconverted_date, $converted_date, $title_treated);
- +
- + $html_treated = inline_css($html_treated);
- //add tracking 1 by 1px image
- - $html_treated .= '<img src="'.get_app_info('path').'/t/'.short($campaign_id).'/'.short($subscriber_id).'" alt=""/>';
- + $html_treated .= '<img src="'.APP_PATH.'/t/'.short($campaign_id).'/'.short($subscriber_id).'" alt="" width="1" height="1"/>';
- //send email
- $mail = new PHPMailer();
- diff -uNr sendy/includes/create/test-send.php sendy-modified/includes/create/test-send.php
- --- sendy/includes/create/test-send.php 2014-04-03 15:57:48.000000000 +0200
- +++ sendy-modified/includes/create/test-send.php 2014-11-19 15:53:35.572099790 +0100
- @@ -1,6 +1,7 @@
- <?php include('../functions.php');?>
- <?php include('../login/auth.php');?>
- <?php include('../helpers/class.phpmailer.php');?>
- +<?php include('../inline_css.php');?>
- <?php
- //POST variables
- @@ -122,6 +123,8 @@
- $html_text2 = str_replace('[Email]', $test_email_array[$i], $html_text);
- $plain_text2 = str_replace('[Email]', $test_email_array[$i], $plain_text);
- $title2 = str_replace('[Email]', $test_email_array[$i], $title);
- +
- + $html_text2 = inline_css($html_text2);
- //send test email
- $mail = new PHPMailer();
- @@ -171,4 +174,4 @@
- mysqli_query($mysqli, 'UPDATE apps SET test_email = "'.$test_email.'" WHERE id = '.$app);
- }
- -?>
- \ No newline at end of file
- +?>
- diff -uNr sendy/includes/inline_css.php sendy-modified/includes/inline_css.php
- --- sendy/includes/inline_css.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/inline_css.php 2014-11-19 15:53:12.988099654 +0100
- @@ -0,0 +1,14 @@
- +<?php
- +
- +require_once __DIR__ . '/vendor/autoload.php';
- +use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;
- +
- +function inline_css($html) {
- + $inliner = new CssToInlineStyles();
- +
- + $inliner->setHTML($html);
- + $inliner->setUseInlineStylesBlock(true);
- +
- + return $inliner->convert();
- +
- +}
- diff -uNr sendy/includes/vendor/autoload.php sendy-modified/includes/vendor/autoload.php
- --- sendy/includes/vendor/autoload.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/autoload.php 2014-11-19 15:54:31.644100130 +0100
- @@ -0,0 +1,7 @@
- +<?php
- +
- +// autoload.php @generated by Composer
- +
- +require_once __DIR__ . '/composer' . '/autoload_real.php';
- +
- +return ComposerAutoloaderInit8df2fcf8c38bde27d6e06ea05b60660d::getLoader();
- diff -uNr sendy/includes/vendor/composer/autoload_classmap.php sendy-modified/includes/vendor/composer/autoload_classmap.php
- --- sendy/includes/vendor/composer/autoload_classmap.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/composer/autoload_classmap.php 2014-11-19 15:53:57.904099925 +0100
- @@ -0,0 +1,9 @@
- +<?php
- +
- +// autoload_classmap.php @generated by Composer
- +
- +$vendorDir = dirname(dirname(__FILE__));
- +$baseDir = dirname($vendorDir);
- +
- +return array(
- +);
- diff -uNr sendy/includes/vendor/composer/autoload_namespaces.php sendy-modified/includes/vendor/composer/autoload_namespaces.php
- --- sendy/includes/vendor/composer/autoload_namespaces.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/composer/autoload_namespaces.php 2014-11-19 15:53:58.536099929 +0100
- @@ -0,0 +1,10 @@
- +<?php
- +
- +// autoload_namespaces.php @generated by Composer
- +
- +$vendorDir = dirname(dirname(__FILE__));
- +$baseDir = dirname($vendorDir);
- +
- +return array(
- + 'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'),
- +);
- diff -uNr sendy/includes/vendor/composer/autoload_psr4.php sendy-modified/includes/vendor/composer/autoload_psr4.php
- --- sendy/includes/vendor/composer/autoload_psr4.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/composer/autoload_psr4.php 2014-11-19 15:53:58.380099928 +0100
- @@ -0,0 +1,10 @@
- +<?php
- +
- +// autoload_psr4.php @generated by Composer
- +
- +$vendorDir = dirname(dirname(__FILE__));
- +$baseDir = dirname($vendorDir);
- +
- +return array(
- + 'TijsVerkoyen\\CssToInlineStyles\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'),
- +);
- diff -uNr sendy/includes/vendor/composer/autoload_real.php sendy-modified/includes/vendor/composer/autoload_real.php
- --- sendy/includes/vendor/composer/autoload_real.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/composer/autoload_real.php 2014-11-19 15:53:58.060099926 +0100
- @@ -0,0 +1,50 @@
- +<?php
- +
- +// autoload_real.php @generated by Composer
- +
- +class ComposerAutoloaderInit8df2fcf8c38bde27d6e06ea05b60660d
- +{
- + private static $loader;
- +
- + public static function loadClassLoader($class)
- + {
- + if ('Composer\Autoload\ClassLoader' === $class) {
- + require __DIR__ . '/ClassLoader.php';
- + }
- + }
- +
- + public static function getLoader()
- + {
- + if (null !== self::$loader) {
- + return self::$loader;
- + }
- +
- + spl_autoload_register(array('ComposerAutoloaderInit8df2fcf8c38bde27d6e06ea05b60660d', 'loadClassLoader'), true, true);
- + self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- + spl_autoload_unregister(array('ComposerAutoloaderInit8df2fcf8c38bde27d6e06ea05b60660d', 'loadClassLoader'));
- +
- + $map = require __DIR__ . '/autoload_namespaces.php';
- + foreach ($map as $namespace => $path) {
- + $loader->set($namespace, $path);
- + }
- +
- + $map = require __DIR__ . '/autoload_psr4.php';
- + foreach ($map as $namespace => $path) {
- + $loader->setPsr4($namespace, $path);
- + }
- +
- + $classMap = require __DIR__ . '/autoload_classmap.php';
- + if ($classMap) {
- + $loader->addClassMap($classMap);
- + }
- +
- + $loader->register(true);
- +
- + return $loader;
- + }
- +}
- +
- +function composerRequire8df2fcf8c38bde27d6e06ea05b60660d($file)
- +{
- + require $file;
- +}
- diff -uNr sendy/includes/vendor/composer/ClassLoader.php sendy-modified/includes/vendor/composer/ClassLoader.php
- --- sendy/includes/vendor/composer/ClassLoader.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/composer/ClassLoader.php 2014-11-19 15:53:57.744099924 +0100
- @@ -0,0 +1,383 @@
- +<?php
- +
- +/*
- + * This file is part of Composer.
- + *
- + * (c) Nils Adermann <naderman@naderman.de>
- + * Jordi Boggiano <j.boggiano@seld.be>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Composer\Autoload;
- +
- +/**
- + * ClassLoader implements a PSR-0 class loader
- + *
- + * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
- + *
- + * $loader = new \Composer\Autoload\ClassLoader();
- + *
- + * // register classes with namespaces
- + * $loader->add('Symfony\Component', __DIR__.'/component');
- + * $loader->add('Symfony', __DIR__.'/framework');
- + *
- + * // activate the autoloader
- + * $loader->register();
- + *
- + * // to enable searching the include path (eg. for PEAR packages)
- + * $loader->setUseIncludePath(true);
- + *
- + * In this example, if you try to use a class in the Symfony\Component
- + * namespace or one of its children (Symfony\Component\Console for instance),
- + * the autoloader will first look for the class under the component/
- + * directory, and it will then fallback to the framework/ directory if not
- + * found before giving up.
- + *
- + * This class is loosely based on the Symfony UniversalClassLoader.
- + *
- + * @author Fabien Potencier <fabien@symfony.com>
- + * @author Jordi Boggiano <j.boggiano@seld.be>
- + */
- +class ClassLoader
- +{
- + // PSR-4
- + private $prefixLengthsPsr4 = array();
- + private $prefixDirsPsr4 = array();
- + private $fallbackDirsPsr4 = array();
- +
- + // PSR-0
- + private $prefixesPsr0 = array();
- + private $fallbackDirsPsr0 = array();
- +
- + private $useIncludePath = false;
- + private $classMap = array();
- +
- + public function getPrefixes()
- + {
- + return call_user_func_array('array_merge', $this->prefixesPsr0);
- + }
- +
- + public function getPrefixesPsr4()
- + {
- + return $this->prefixDirsPsr4;
- + }
- +
- + public function getFallbackDirs()
- + {
- + return $this->fallbackDirsPsr0;
- + }
- +
- + public function getFallbackDirsPsr4()
- + {
- + return $this->fallbackDirsPsr4;
- + }
- +
- + public function getClassMap()
- + {
- + return $this->classMap;
- + }
- +
- + /**
- + * @param array $classMap Class to filename map
- + */
- + public function addClassMap(array $classMap)
- + {
- + if ($this->classMap) {
- + $this->classMap = array_merge($this->classMap, $classMap);
- + } else {
- + $this->classMap = $classMap;
- + }
- + }
- +
- + /**
- + * Registers a set of PSR-0 directories for a given prefix, either
- + * appending or prepending to the ones previously set for this prefix.
- + *
- + * @param string $prefix The prefix
- + * @param array|string $paths The PSR-0 root directories
- + * @param bool $prepend Whether to prepend the directories
- + */
- + public function add($prefix, $paths, $prepend = false)
- + {
- + if (!$prefix) {
- + if ($prepend) {
- + $this->fallbackDirsPsr0 = array_merge(
- + (array) $paths,
- + $this->fallbackDirsPsr0
- + );
- + } else {
- + $this->fallbackDirsPsr0 = array_merge(
- + $this->fallbackDirsPsr0,
- + (array) $paths
- + );
- + }
- +
- + return;
- + }
- +
- + $first = $prefix[0];
- + if (!isset($this->prefixesPsr0[$first][$prefix])) {
- + $this->prefixesPsr0[$first][$prefix] = (array) $paths;
- +
- + return;
- + }
- + if ($prepend) {
- + $this->prefixesPsr0[$first][$prefix] = array_merge(
- + (array) $paths,
- + $this->prefixesPsr0[$first][$prefix]
- + );
- + } else {
- + $this->prefixesPsr0[$first][$prefix] = array_merge(
- + $this->prefixesPsr0[$first][$prefix],
- + (array) $paths
- + );
- + }
- + }
- +
- + /**
- + * Registers a set of PSR-4 directories for a given namespace, either
- + * appending or prepending to the ones previously set for this namespace.
- + *
- + * @param string $prefix The prefix/namespace, with trailing '\\'
- + * @param array|string $paths The PSR-0 base directories
- + * @param bool $prepend Whether to prepend the directories
- + *
- + * @throws \InvalidArgumentException
- + */
- + public function addPsr4($prefix, $paths, $prepend = false)
- + {
- + if (!$prefix) {
- + // Register directories for the root namespace.
- + if ($prepend) {
- + $this->fallbackDirsPsr4 = array_merge(
- + (array) $paths,
- + $this->fallbackDirsPsr4
- + );
- + } else {
- + $this->fallbackDirsPsr4 = array_merge(
- + $this->fallbackDirsPsr4,
- + (array) $paths
- + );
- + }
- + } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
- + // Register directories for a new namespace.
- + $length = strlen($prefix);
- + if ('\\' !== $prefix[$length - 1]) {
- + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
- + }
- + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
- + $this->prefixDirsPsr4[$prefix] = (array) $paths;
- + } elseif ($prepend) {
- + // Prepend directories for an already registered namespace.
- + $this->prefixDirsPsr4[$prefix] = array_merge(
- + (array) $paths,
- + $this->prefixDirsPsr4[$prefix]
- + );
- + } else {
- + // Append directories for an already registered namespace.
- + $this->prefixDirsPsr4[$prefix] = array_merge(
- + $this->prefixDirsPsr4[$prefix],
- + (array) $paths
- + );
- + }
- + }
- +
- + /**
- + * Registers a set of PSR-0 directories for a given prefix,
- + * replacing any others previously set for this prefix.
- + *
- + * @param string $prefix The prefix
- + * @param array|string $paths The PSR-0 base directories
- + */
- + public function set($prefix, $paths)
- + {
- + if (!$prefix) {
- + $this->fallbackDirsPsr0 = (array) $paths;
- + } else {
- + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
- + }
- + }
- +
- + /**
- + * Registers a set of PSR-4 directories for a given namespace,
- + * replacing any others previously set for this namespace.
- + *
- + * @param string $prefix The prefix/namespace, with trailing '\\'
- + * @param array|string $paths The PSR-4 base directories
- + *
- + * @throws \InvalidArgumentException
- + */
- + public function setPsr4($prefix, $paths)
- + {
- + if (!$prefix) {
- + $this->fallbackDirsPsr4 = (array) $paths;
- + } else {
- + $length = strlen($prefix);
- + if ('\\' !== $prefix[$length - 1]) {
- + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
- + }
- + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
- + $this->prefixDirsPsr4[$prefix] = (array) $paths;
- + }
- + }
- +
- + /**
- + * Turns on searching the include path for class files.
- + *
- + * @param bool $useIncludePath
- + */
- + public function setUseIncludePath($useIncludePath)
- + {
- + $this->useIncludePath = $useIncludePath;
- + }
- +
- + /**
- + * Can be used to check if the autoloader uses the include path to check
- + * for classes.
- + *
- + * @return bool
- + */
- + public function getUseIncludePath()
- + {
- + return $this->useIncludePath;
- + }
- +
- + /**
- + * Registers this instance as an autoloader.
- + *
- + * @param bool $prepend Whether to prepend the autoloader or not
- + */
- + public function register($prepend = false)
- + {
- + spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- + }
- +
- + /**
- + * Unregisters this instance as an autoloader.
- + */
- + public function unregister()
- + {
- + spl_autoload_unregister(array($this, 'loadClass'));
- + }
- +
- + /**
- + * Loads the given class or interface.
- + *
- + * @param string $class The name of the class
- + * @return bool|null True if loaded, null otherwise
- + */
- + public function loadClass($class)
- + {
- + if ($file = $this->findFile($class)) {
- + includeFile($file);
- +
- + return true;
- + }
- + }
- +
- + /**
- + * Finds the path to the file where the class is defined.
- + *
- + * @param string $class The name of the class
- + *
- + * @return string|false The path if found, false otherwise
- + */
- + public function findFile($class)
- + {
- + // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
- + if ('\\' == $class[0]) {
- + $class = substr($class, 1);
- + }
- +
- + // class map lookup
- + if (isset($this->classMap[$class])) {
- + return $this->classMap[$class];
- + }
- +
- + $file = $this->findFileWithExtension($class, '.php');
- +
- + // Search for Hack files if we are running on HHVM
- + if ($file === null && defined('HHVM_VERSION')) {
- + $file = $this->findFileWithExtension($class, '.hh');
- + }
- +
- + if ($file === null) {
- + // Remember that this class does not exist.
- + return $this->classMap[$class] = false;
- + }
- +
- + return $file;
- + }
- +
- + private function findFileWithExtension($class, $ext)
- + {
- + // PSR-4 lookup
- + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
- +
- + $first = $class[0];
- + if (isset($this->prefixLengthsPsr4[$first])) {
- + foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
- + if (0 === strpos($class, $prefix)) {
- + foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
- + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
- + return $file;
- + }
- + }
- + }
- + }
- + }
- +
- + // PSR-4 fallback dirs
- + foreach ($this->fallbackDirsPsr4 as $dir) {
- + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
- + return $file;
- + }
- + }
- +
- + // PSR-0 lookup
- + if (false !== $pos = strrpos($class, '\\')) {
- + // namespaced class name
- + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
- + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
- + } else {
- + // PEAR-like class name
- + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
- + }
- +
- + if (isset($this->prefixesPsr0[$first])) {
- + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
- + if (0 === strpos($class, $prefix)) {
- + foreach ($dirs as $dir) {
- + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
- + return $file;
- + }
- + }
- + }
- + }
- + }
- +
- + // PSR-0 fallback dirs
- + foreach ($this->fallbackDirsPsr0 as $dir) {
- + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
- + return $file;
- + }
- + }
- +
- + // PSR-0 include paths.
- + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
- + return $file;
- + }
- + }
- +}
- +
- +/**
- + * Scope isolated include.
- + *
- + * Prevents access to $this/self from included files.
- + */
- +function includeFile($file)
- +{
- + include $file;
- +}
- diff -uNr sendy/includes/vendor/composer/installed.json sendy-modified/includes/vendor/composer/installed.json
- --- sendy/includes/vendor/composer/installed.json 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/composer/installed.json 2014-11-19 15:53:58.220099927 +0100
- @@ -0,0 +1,104 @@
- +[
- + {
- + "name": "symfony/css-selector",
- + "version": "v2.5.6",
- + "version_normalized": "2.5.6.0",
- + "target-dir": "Symfony/Component/CssSelector",
- + "source": {
- + "type": "git",
- + "url": "https://github.com/symfony/CssSelector.git",
- + "reference": "7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc"
- + },
- + "dist": {
- + "type": "zip",
- + "url": "https://api.github.com/repos/symfony/CssSelector/zipball/7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc",
- + "reference": "7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc",
- + "shasum": ""
- + },
- + "require": {
- + "php": ">=5.3.3"
- + },
- + "time": "2014-10-09 16:00:03",
- + "type": "library",
- + "extra": {
- + "branch-alias": {
- + "dev-master": "2.5-dev"
- + }
- + },
- + "installation-source": "source",
- + "autoload": {
- + "psr-0": {
- + "Symfony\\Component\\CssSelector\\": ""
- + }
- + },
- + "notification-url": "https://packagist.org/downloads/",
- + "license": [
- + "MIT"
- + ],
- + "authors": [
- + {
- + "name": "Symfony Community",
- + "homepage": "http://symfony.com/contributors"
- + },
- + {
- + "name": "Jean-François Simon",
- + "email": "jeanfrancois.simon@sensiolabs.com"
- + },
- + {
- + "name": "Fabien Potencier",
- + "email": "fabien@symfony.com"
- + }
- + ],
- + "description": "Symfony CssSelector Component",
- + "homepage": "http://symfony.com"
- + },
- + {
- + "name": "tijsverkoyen/css-to-inline-styles",
- + "version": "1.5.2",
- + "version_normalized": "1.5.2.0",
- + "source": {
- + "type": "git",
- + "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git",
- + "reference": "c50e8cd86acb0e528855c59653006e96d094a5b1"
- + },
- + "dist": {
- + "type": "zip",
- + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/c50e8cd86acb0e528855c59653006e96d094a5b1",
- + "reference": "c50e8cd86acb0e528855c59653006e96d094a5b1",
- + "shasum": ""
- + },
- + "require": {
- + "php": ">=5.3.0",
- + "symfony/css-selector": "~2.1"
- + },
- + "require-dev": {
- + "phpunit/phpunit": "~4.0"
- + },
- + "time": "2014-08-01 18:02:04",
- + "type": "library",
- + "extra": {
- + "branch-alias": {
- + "dev-master": "1.5.x-dev"
- + }
- + },
- + "installation-source": "dist",
- + "autoload": {
- + "psr-4": {
- + "TijsVerkoyen\\CssToInlineStyles\\": "src"
- + }
- + },
- + "notification-url": "https://packagist.org/downloads/",
- + "license": [
- + "BSD"
- + ],
- + "authors": [
- + {
- + "name": "Tijs Verkoyen",
- + "email": "css_to_inline_styles@verkoyen.eu",
- + "role": "Developer"
- + }
- + ],
- + "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.",
- + "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles"
- + }
- +]
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CHANGELOG.md sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CHANGELOG.md
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CHANGELOG.md 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CHANGELOG.md 2014-11-19 15:54:29.044100114 +0100
- @@ -0,0 +1,7 @@
- +CHANGELOG
- +=========
- +
- +2.1.0
- +-----
- +
- + * none
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/composer.json sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/composer.json
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/composer.json 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/composer.json 2014-11-19 15:54:07.412099983 +0100
- @@ -0,0 +1,35 @@
- +{
- + "name": "symfony/css-selector",
- + "type": "library",
- + "description": "Symfony CssSelector Component",
- + "keywords": [],
- + "homepage": "http://symfony.com",
- + "license": "MIT",
- + "authors": [
- + {
- + "name": "Fabien Potencier",
- + "email": "fabien@symfony.com"
- + },
- + {
- + "name": "Jean-François Simon",
- + "email": "jeanfrancois.simon@sensiolabs.com"
- + },
- + {
- + "name": "Symfony Community",
- + "homepage": "http://symfony.com/contributors"
- + }
- + ],
- + "require": {
- + "php": ">=5.3.3"
- + },
- + "autoload": {
- + "psr-0": { "Symfony\\Component\\CssSelector\\": "" }
- + },
- + "target-dir": "Symfony/Component/CssSelector",
- + "minimum-stability": "dev",
- + "extra": {
- + "branch-alias": {
- + "dev-master": "2.5-dev"
- + }
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CssSelector.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CssSelector.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CssSelector.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CssSelector.php 2014-11-19 15:54:31.464100129 +0100
- @@ -0,0 +1,83 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector;
- +
- +use Symfony\Component\CssSelector\Parser\Shortcut\ClassParser;
- +use Symfony\Component\CssSelector\Parser\Shortcut\ElementParser;
- +use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser;
- +use Symfony\Component\CssSelector\Parser\Shortcut\HashParser;
- +use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension;
- +use Symfony\Component\CssSelector\XPath\Translator;
- +
- +/**
- + * CssSelector is the main entry point of the component and can convert CSS
- + * selectors to XPath expressions.
- + *
- + * $xpath = CssSelector::toXpath('h1.foo');
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Fabien Potencier <fabien@symfony.com>
- + *
- + * @api
- + */
- +class CssSelector
- +{
- + private static $html = true;
- +
- + /**
- + * Translates a CSS expression to its XPath equivalent.
- + * Optionally, a prefix can be added to the resulting XPath
- + * expression with the $prefix parameter.
- + *
- + * @param mixed $cssExpr The CSS expression.
- + * @param string $prefix An optional prefix for the XPath expression.
- + *
- + * @return string
- + *
- + * @api
- + */
- + public static function toXPath($cssExpr, $prefix = 'descendant-or-self::')
- + {
- + $translator = new Translator();
- +
- + if (self::$html) {
- + $translator->registerExtension(new HtmlExtension($translator));
- + }
- +
- + $translator
- + ->registerParserShortcut(new EmptyStringParser())
- + ->registerParserShortcut(new ElementParser())
- + ->registerParserShortcut(new ClassParser())
- + ->registerParserShortcut(new HashParser())
- + ;
- +
- + return $translator->cssToXPath($cssExpr, $prefix);
- + }
- +
- + /**
- + * Enables the HTML extension.
- + */
- + public static function enableHtmlExtension()
- + {
- + self::$html = true;
- + }
- +
- + /**
- + * Disables the HTML extension.
- + */
- + public static function disableHtmlExtension()
- + {
- + self::$html = false;
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExceptionInterface.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExceptionInterface.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExceptionInterface.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExceptionInterface.php 2014-11-19 15:54:10.772100003 +0100
- @@ -0,0 +1,24 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Exception;
- +
- +/**
- + * Interface for exceptions.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +interface ExceptionInterface
- +{
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExpressionErrorException.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExpressionErrorException.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExpressionErrorException.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExpressionErrorException.php 2014-11-19 15:54:10.932100004 +0100
- @@ -0,0 +1,24 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Exception;
- +
- +/**
- + * ParseException is thrown when a CSS selector syntax is not valid.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class ExpressionErrorException extends ParseException implements ExceptionInterface
- +{
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/InternalErrorException.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/InternalErrorException.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/InternalErrorException.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/InternalErrorException.php 2014-11-19 15:54:11.088100005 +0100
- @@ -0,0 +1,24 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Exception;
- +
- +/**
- + * ParseException is thrown when a CSS selector syntax is not valid.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class InternalErrorException extends ParseException implements ExceptionInterface
- +{
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ParseException.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ParseException.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ParseException.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ParseException.php 2014-11-19 15:54:10.456100001 +0100
- @@ -0,0 +1,24 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Exception;
- +
- +/**
- + * ParseException is thrown when a CSS selector syntax is not valid.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Fabien Potencier <fabien@symfony.com>
- + */
- +class ParseException extends \Exception implements ExceptionInterface
- +{
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php 2014-11-19 15:54:10.616100002 +0100
- @@ -0,0 +1,73 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Exception;
- +
- +use Symfony\Component\CssSelector\Parser\Token;
- +
- +/**
- + * ParseException is thrown when a CSS selector syntax is not valid.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class SyntaxErrorException extends ParseException implements ExceptionInterface
- +{
- + /**
- + * @param string $expectedValue
- + * @param Token $foundToken
- + *
- + * @return SyntaxErrorException
- + */
- + public static function unexpectedToken($expectedValue, Token $foundToken)
- + {
- + return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken));
- + }
- +
- + /**
- + * @param string $pseudoElement
- + * @param string $unexpectedLocation
- + *
- + * @return SyntaxErrorException
- + */
- + public static function pseudoElementFound($pseudoElement, $unexpectedLocation)
- + {
- + return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation));
- + }
- +
- + /**
- + * @param int $position
- + *
- + * @return SyntaxErrorException
- + */
- + public static function unclosedString($position)
- + {
- + return new self(sprintf('Unclosed/invalid string at %s.', $position));
- + }
- +
- + /**
- + * @return SyntaxErrorException
- + */
- + public static function nestedNot()
- + {
- + return new self('Got nested ::not().');
- + }
- +
- + /**
- + * @return SyntaxErrorException
- + */
- + public static function stringAsFunctionArgument()
- + {
- + return new self('String not allowed as function argument.');
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/config sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/config
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/config 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/config 2014-11-19 15:54:25.892100095 +0100
- @@ -0,0 +1,15 @@
- +[core]
- + repositoryformatversion = 0
- + filemode = true
- + bare = false
- + logallrefupdates = true
- +[remote "origin"]
- + url = git://github.com/symfony/CssSelector.git
- + fetch = +refs/heads/*:refs/remotes/origin/*
- + pushurl = git@github.com:symfony/CssSelector.git
- +[branch "master"]
- + remote = origin
- + merge = refs/heads/master
- +[remote "composer"]
- + url = git://github.com/symfony/CssSelector.git
- + fetch = +refs/heads/*:refs/remotes/composer/*
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/description sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/description
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/description 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/description 2014-11-19 15:54:21.932100071 +0100
- @@ -0,0 +1 @@
- +Unnamed repository; edit this file 'description' to name the repository.
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/FETCH_HEAD sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/FETCH_HEAD
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/FETCH_HEAD 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/FETCH_HEAD 2014-11-19 15:54:26.848100101 +0100
- @@ -0,0 +1,9 @@
- +354d622bce93ab079ed0ca16874f5815f2a73323 not-for-merge branch '2.0' of git://github.com/symfony/CssSelector
- +bf7bb82a099dfb26b018daf70ad1985fea4d2997 not-for-merge branch '2.1' of git://github.com/symfony/CssSelector
- +9ff0e208cfccd5a49a233221a645ce60a582f7d0 not-for-merge branch '2.2' of git://github.com/symfony/CssSelector
- +5bb1c69c1e2aa246292792024aeacd75f7e5d26a not-for-merge branch '2.3' of git://github.com/symfony/CssSelector
- +4e9ddc09c13475fb1a52fb578a8899c8303966c5 not-for-merge branch '2.4' of git://github.com/symfony/CssSelector
- +3046789831631e5ccdd0df1a1221380eab343922 not-for-merge branch '2.5' of git://github.com/symfony/CssSelector
- +41953ad30ffc5cd710d106cf01eff79f6effa117 not-for-merge branch '2.6' of git://github.com/symfony/CssSelector
- +301d5705725b4e11c6255e443244642eb3b5dfa1 not-for-merge branch '2.7' of git://github.com/symfony/CssSelector
- +32f70108bf023759e21f80646cca37763a74ea7e not-for-merge branch 'master' of git://github.com/symfony/CssSelector
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/HEAD sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/HEAD
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/HEAD 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/HEAD 2014-11-19 15:54:28.724100112 +0100
- @@ -0,0 +1 @@
- +7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/applypatch-msg.sample sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/applypatch-msg.sample
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/applypatch-msg.sample 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/applypatch-msg.sample 2014-11-19 15:54:17.648100045 +0100
- @@ -0,0 +1,15 @@
- +#!/bin/sh
- +#
- +# An example hook script to check the commit log message taken by
- +# applypatch from an e-mail message.
- +#
- +# The hook should exit with non-zero status after issuing an
- +# appropriate message if it wants to stop the commit. The hook is
- +# allowed to edit the commit message file.
- +#
- +# To enable this hook, rename this file to "applypatch-msg".
- +
- +. git-sh-setup
- +test -x "$GIT_DIR/hooks/commit-msg" &&
- + exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
- +:
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/commit-msg.sample sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/commit-msg.sample
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/commit-msg.sample 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/commit-msg.sample 2014-11-19 15:54:16.840100040 +0100
- @@ -0,0 +1,24 @@
- +#!/bin/sh
- +#
- +# An example hook script to check the commit log message.
- +# Called by "git commit" with one argument, the name of the file
- +# that has the commit message. The hook should exit with non-zero
- +# status after issuing an appropriate message if it wants to stop the
- +# commit. The hook is allowed to edit the commit message file.
- +#
- +# To enable this hook, rename this file to "commit-msg".
- +
- +# Uncomment the below to add a Signed-off-by line to the message.
- +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
- +# hook is more suited to it.
- +#
- +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: /p')
- +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
- +
- +# This example catches duplicate Signed-off-by lines.
- +
- +test "" = "$(grep '^Signed-off-by: ' "$1" |
- + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
- + echo >&2 Duplicate Signed-off-by lines.
- + exit 1
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/post-update.sample sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/post-update.sample
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/post-update.sample 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/post-update.sample 2014-11-19 15:54:17.808100046 +0100
- @@ -0,0 +1,8 @@
- +#!/bin/sh
- +#
- +# An example hook script to prepare a packed repository for use over
- +# dumb transports.
- +#
- +# To enable this hook, rename this file to "post-update".
- +
- +exec git update-server-info
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-applypatch.sample sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-applypatch.sample
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-applypatch.sample 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-applypatch.sample 2014-11-19 15:54:17.164100042 +0100
- @@ -0,0 +1,14 @@
- +#!/bin/sh
- +#
- +# An example hook script to verify what is about to be committed
- +# by applypatch from an e-mail message.
- +#
- +# The hook should exit with non-zero status after issuing an
- +# appropriate message if it wants to stop the commit.
- +#
- +# To enable this hook, rename this file to "pre-applypatch".
- +
- +. git-sh-setup
- +test -x "$GIT_DIR/hooks/pre-commit" &&
- + exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
- +:
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-commit.sample sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-commit.sample
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-commit.sample 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-commit.sample 2014-11-19 15:54:17.968100047 +0100
- @@ -0,0 +1,49 @@
- +#!/bin/sh
- +#
- +# An example hook script to verify what is about to be committed.
- +# Called by "git commit" with no arguments. The hook should
- +# exit with non-zero status after issuing an appropriate message if
- +# it wants to stop the commit.
- +#
- +# To enable this hook, rename this file to "pre-commit".
- +
- +if git rev-parse --verify HEAD >/dev/null 2>&1
- +then
- + against=HEAD
- +else
- + # Initial commit: diff against an empty tree object
- + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
- +fi
- +
- +# If you want to allow non-ASCII filenames set this variable to true.
- +allownonascii=$(git config --bool hooks.allownonascii)
- +
- +# Redirect output to stderr.
- +exec 1>&2
- +
- +# Cross platform projects tend to avoid non-ASCII filenames; prevent
- +# them from being added to the repository. We exploit the fact that the
- +# printable range starts at the space character and ends with tilde.
- +if [ "$allownonascii" != "true" ] &&
- + # Note that the use of brackets around a tr range is ok here, (it's
- + # even required, for portability to Solaris 10's /usr/bin/tr), since
- + # the square bracket bytes happen to fall in the designated range.
- + test $(git diff --cached --name-only --diff-filter=A -z $against |
- + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
- +then
- + cat <<\EOF
- +Error: Attempt to add a non-ASCII file name.
- +
- +This can cause problems if you want to work with people on other platforms.
- +
- +To be portable it is advisable to rename the file.
- +
- +If you know what you are doing you can disable this check using:
- +
- + git config hooks.allownonascii true
- +EOF
- + exit 1
- +fi
- +
- +# If there are whitespace errors, print the offending file names and fail.
- +exec git diff-index --check --cached $against --
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/prepare-commit-msg.sample sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/prepare-commit-msg.sample
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/prepare-commit-msg.sample 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/prepare-commit-msg.sample 2014-11-19 15:54:17.488100044 +0100
- @@ -0,0 +1,36 @@
- +#!/bin/sh
- +#
- +# An example hook script to prepare the commit log message.
- +# Called by "git commit" with the name of the file that has the
- +# commit message, followed by the description of the commit
- +# message's source. The hook's purpose is to edit the commit
- +# message file. If the hook fails with a non-zero status,
- +# the commit is aborted.
- +#
- +# To enable this hook, rename this file to "prepare-commit-msg".
- +
- +# This hook includes three examples. The first comments out the
- +# "Conflicts:" part of a merge commit.
- +#
- +# The second includes the output of "git diff --name-status -r"
- +# into the message, just before the "git status" output. It is
- +# commented because it doesn't cope with --amend or with squashed
- +# commits.
- +#
- +# The third example adds a Signed-off-by line to the message, that can
- +# still be edited. This is rarely a good idea.
- +
- +case "$2,$3" in
- + merge,)
- + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
- +
- +# ,|template,)
- +# /usr/bin/perl -i.bak -pe '
- +# print "\n" . `git diff --cached --name-status -r`
- +# if /^#/ && $first++ == 0' "$1" ;;
- +
- + *) ;;
- +esac
- +
- +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: /p')
- +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-push.sample sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-push.sample
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-push.sample 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-push.sample 2014-11-19 15:54:18.128100048 +0100
- @@ -0,0 +1,54 @@
- +#!/bin/sh
- +
- +# An example hook script to verify what is about to be pushed. Called by "git
- +# push" after it has checked the remote status, but before anything has been
- +# pushed. If this script exits with a non-zero status nothing will be pushed.
- +#
- +# This hook is called with the following parameters:
- +#
- +# $1 -- Name of the remote to which the push is being done
- +# $2 -- URL to which the push is being done
- +#
- +# If pushing without using a named remote those arguments will be equal.
- +#
- +# Information about the commits which are being pushed is supplied as lines to
- +# the standard input in the form:
- +#
- +# <local ref> <local sha1> <remote ref> <remote sha1>
- +#
- +# This sample shows how to prevent push of commits where the log message starts
- +# with "WIP" (work in progress).
- +
- +remote="$1"
- +url="$2"
- +
- +z40=0000000000000000000000000000000000000000
- +
- +IFS=' '
- +while read local_ref local_sha remote_ref remote_sha
- +do
- + if [ "$local_sha" = $z40 ]
- + then
- + # Handle delete
- + :
- + else
- + if [ "$remote_sha" = $z40 ]
- + then
- + # New branch, examine all commits
- + range="$local_sha"
- + else
- + # Update to existing branch, examine new commits
- + range="$remote_sha..$local_sha"
- + fi
- +
- + # Check for WIP commit
- + commit=`git rev-list -n 1 --grep '^WIP' "$range"`
- + if [ -n "$commit" ]
- + then
- + echo "Found WIP commit in $local_ref, not pushing"
- + exit 1
- + fi
- + fi
- +done
- +
- +exit 0
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-rebase.sample sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-rebase.sample
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-rebase.sample 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-rebase.sample 2014-11-19 15:54:17.328100043 +0100
- @@ -0,0 +1,169 @@
- +#!/bin/sh
- +#
- +# Copyright (c) 2006, 2008 Junio C Hamano
- +#
- +# The "pre-rebase" hook is run just before "git rebase" starts doing
- +# its job, and can prevent the command from running by exiting with
- +# non-zero status.
- +#
- +# The hook is called with the following parameters:
- +#
- +# $1 -- the upstream the series was forked from.
- +# $2 -- the branch being rebased (or empty when rebasing the current branch).
- +#
- +# This sample shows how to prevent topic branches that are already
- +# merged to 'next' branch from getting rebased, because allowing it
- +# would result in rebasing already published history.
- +
- +publish=next
- +basebranch="$1"
- +if test "$#" = 2
- +then
- + topic="refs/heads/$2"
- +else
- + topic=`git symbolic-ref HEAD` ||
- + exit 0 ;# we do not interrupt rebasing detached HEAD
- +fi
- +
- +case "$topic" in
- +refs/heads/??/*)
- + ;;
- +*)
- + exit 0 ;# we do not interrupt others.
- + ;;
- +esac
- +
- +# Now we are dealing with a topic branch being rebased
- +# on top of master. Is it OK to rebase it?
- +
- +# Does the topic really exist?
- +git show-ref -q "$topic" || {
- + echo >&2 "No such branch $topic"
- + exit 1
- +}
- +
- +# Is topic fully merged to master?
- +not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
- +if test -z "$not_in_master"
- +then
- + echo >&2 "$topic is fully merged to master; better remove it."
- + exit 1 ;# we could allow it, but there is no point.
- +fi
- +
- +# Is topic ever merged to next? If so you should not be rebasing it.
- +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
- +only_next_2=`git rev-list ^master ${publish} | sort`
- +if test "$only_next_1" = "$only_next_2"
- +then
- + not_in_topic=`git rev-list "^$topic" master`
- + if test -z "$not_in_topic"
- + then
- + echo >&2 "$topic is already up-to-date with master"
- + exit 1 ;# we could allow it, but there is no point.
- + else
- + exit 0
- + fi
- +else
- + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
- + /usr/bin/perl -e '
- + my $topic = $ARGV[0];
- + my $msg = "* $topic has commits already merged to public branch:\n";
- + my (%not_in_next) = map {
- + /^([0-9a-f]+) /;
- + ($1 => 1);
- + } split(/\n/, $ARGV[1]);
- + for my $elem (map {
- + /^([0-9a-f]+) (.*)$/;
- + [$1 => $2];
- + } split(/\n/, $ARGV[2])) {
- + if (!exists $not_in_next{$elem->[0]}) {
- + if ($msg) {
- + print STDERR $msg;
- + undef $msg;
- + }
- + print STDERR " $elem->[1]\n";
- + }
- + }
- + ' "$topic" "$not_in_next" "$not_in_master"
- + exit 1
- +fi
- +
- +<<\DOC_END
- +
- +This sample hook safeguards topic branches that have been
- +published from being rewound.
- +
- +The workflow assumed here is:
- +
- + * Once a topic branch forks from "master", "master" is never
- + merged into it again (either directly or indirectly).
- +
- + * Once a topic branch is fully cooked and merged into "master",
- + it is deleted. If you need to build on top of it to correct
- + earlier mistakes, a new topic branch is created by forking at
- + the tip of the "master". This is not strictly necessary, but
- + it makes it easier to keep your history simple.
- +
- + * Whenever you need to test or publish your changes to topic
- + branches, merge them into "next" branch.
- +
- +The script, being an example, hardcodes the publish branch name
- +to be "next", but it is trivial to make it configurable via
- +$GIT_DIR/config mechanism.
- +
- +With this workflow, you would want to know:
- +
- +(1) ... if a topic branch has ever been merged to "next". Young
- + topic branches can have stupid mistakes you would rather
- + clean up before publishing, and things that have not been
- + merged into other branches can be easily rebased without
- + affecting other people. But once it is published, you would
- + not want to rewind it.
- +
- +(2) ... if a topic branch has been fully merged to "master".
- + Then you can delete it. More importantly, you should not
- + build on top of it -- other people may already want to
- + change things related to the topic as patches against your
- + "master", so if you need further changes, it is better to
- + fork the topic (perhaps with the same name) afresh from the
- + tip of "master".
- +
- +Let's look at this example:
- +
- + o---o---o---o---o---o---o---o---o---o "next"
- + / / / /
- + / a---a---b A / /
- + / / / /
- + / / c---c---c---c B /
- + / / / \ /
- + / / / b---b C \ /
- + / / / / \ /
- + ---o---o---o---o---o---o---o---o---o---o---o "master"
- +
- +
- +A, B and C are topic branches.
- +
- + * A has one fix since it was merged up to "next".
- +
- + * B has finished. It has been fully merged up to "master" and "next",
- + and is ready to be deleted.
- +
- + * C has not merged to "next" at all.
- +
- +We would want to allow C to be rebased, refuse A, and encourage
- +B to be deleted.
- +
- +To compute (1):
- +
- + git rev-list ^master ^topic next
- + git rev-list ^master next
- +
- + if these match, topic has not merged in next at all.
- +
- +To compute (2):
- +
- + git rev-list master..topic
- +
- + if this is empty, it is fully merged to "master".
- +
- +DOC_END
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/update.sample sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/update.sample
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/update.sample 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/update.sample 2014-11-19 15:54:17.004100041 +0100
- @@ -0,0 +1,128 @@
- +#!/bin/sh
- +#
- +# An example hook script to blocks unannotated tags from entering.
- +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
- +#
- +# To enable this hook, rename this file to "update".
- +#
- +# Config
- +# ------
- +# hooks.allowunannotated
- +# This boolean sets whether unannotated tags will be allowed into the
- +# repository. By default they won't be.
- +# hooks.allowdeletetag
- +# This boolean sets whether deleting tags will be allowed in the
- +# repository. By default they won't be.
- +# hooks.allowmodifytag
- +# This boolean sets whether a tag may be modified after creation. By default
- +# it won't be.
- +# hooks.allowdeletebranch
- +# This boolean sets whether deleting branches will be allowed in the
- +# repository. By default they won't be.
- +# hooks.denycreatebranch
- +# This boolean sets whether remotely creating branches will be denied
- +# in the repository. By default this is allowed.
- +#
- +
- +# --- Command line
- +refname="$1"
- +oldrev="$2"
- +newrev="$3"
- +
- +# --- Safety check
- +if [ -z "$GIT_DIR" ]; then
- + echo "Don't run this script from the command line." >&2
- + echo " (if you want, you could supply GIT_DIR then run" >&2
- + echo " $0 <ref> <oldrev> <newrev>)" >&2
- + exit 1
- +fi
- +
- +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
- + echo "usage: $0 <ref> <oldrev> <newrev>" >&2
- + exit 1
- +fi
- +
- +# --- Config
- +allowunannotated=$(git config --bool hooks.allowunannotated)
- +allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
- +denycreatebranch=$(git config --bool hooks.denycreatebranch)
- +allowdeletetag=$(git config --bool hooks.allowdeletetag)
- +allowmodifytag=$(git config --bool hooks.allowmodifytag)
- +
- +# check for no description
- +projectdesc=$(sed -e '1q' "$GIT_DIR/description")
- +case "$projectdesc" in
- +"Unnamed repository"* | "")
- + echo "*** Project description file hasn't been set" >&2
- + exit 1
- + ;;
- +esac
- +
- +# --- Check types
- +# if $newrev is 0000...0000, it's a commit to delete a ref.
- +zero="0000000000000000000000000000000000000000"
- +if [ "$newrev" = "$zero" ]; then
- + newrev_type=delete
- +else
- + newrev_type=$(git cat-file -t $newrev)
- +fi
- +
- +case "$refname","$newrev_type" in
- + refs/tags/*,commit)
- + # un-annotated tag
- + short_refname=${refname##refs/tags/}
- + if [ "$allowunannotated" != "true" ]; then
- + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
- + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
- + exit 1
- + fi
- + ;;
- + refs/tags/*,delete)
- + # delete tag
- + if [ "$allowdeletetag" != "true" ]; then
- + echo "*** Deleting a tag is not allowed in this repository" >&2
- + exit 1
- + fi
- + ;;
- + refs/tags/*,tag)
- + # annotated tag
- + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
- + then
- + echo "*** Tag '$refname' already exists." >&2
- + echo "*** Modifying a tag is not allowed in this repository." >&2
- + exit 1
- + fi
- + ;;
- + refs/heads/*,commit)
- + # branch
- + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
- + echo "*** Creating a branch is not allowed in this repository" >&2
- + exit 1
- + fi
- + ;;
- + refs/heads/*,delete)
- + # delete branch
- + if [ "$allowdeletebranch" != "true" ]; then
- + echo "*** Deleting a branch is not allowed in this repository" >&2
- + exit 1
- + fi
- + ;;
- + refs/remotes/*,commit)
- + # tracking branch
- + ;;
- + refs/remotes/*,delete)
- + # delete tracking branch
- + if [ "$allowdeletebranch" != "true" ]; then
- + echo "*** Deleting a tracking branch is not allowed in this repository" >&2
- + exit 1
- + fi
- + ;;
- + *)
- + # Anything else (is there anything else?)
- + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
- + exit 1
- + ;;
- +esac
- +
- +# --- Finished
- +exit 0
- Binary files sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/index and sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/index differ
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/info/exclude sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/info/exclude
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/info/exclude 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/info/exclude 2014-11-19 15:54:26.364100098 +0100
- @@ -0,0 +1,6 @@
- +# git ls-files --others --exclude-from=.git/info/exclude
- +# Lines that start with '#' are comments.
- +# For a project mostly in C, the following would be a good set of
- +# exclude patterns (uncomment them if you want to use them):
- +# *.[oa]
- +# *~
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/HEAD sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/HEAD
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/HEAD 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/HEAD 2014-11-19 15:54:25.732100094 +0100
- @@ -0,0 +1,2 @@
- +0000000000000000000000000000000000000000 32f70108bf023759e21f80646cca37763a74ea7e Kai Fricke <fricke@elbsilber.de> 1416405098 +0100 clone: from git://github.com/symfony/CssSelector.git
- +32f70108bf023759e21f80646cca37763a74ea7e 7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc Kai Fricke <fricke@elbsilber.de> 1416405099 +0100 checkout: moving from master to v2.5.6
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/heads/master sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/heads/master
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/heads/master 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/heads/master 2014-11-19 15:54:25.572100093 +0100
- @@ -0,0 +1 @@
- +0000000000000000000000000000000000000000 32f70108bf023759e21f80646cca37763a74ea7e Kai Fricke <fricke@elbsilber.de> 1416405098 +0100 clone: from git://github.com/symfony/CssSelector.git
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.0 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.0
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.0 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.0 2014-11-19 15:54:24.460100086 +0100
- @@ -0,0 +1 @@
- +0000000000000000000000000000000000000000 354d622bce93ab079ed0ca16874f5815f2a73323 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100 fetch composer: storing head
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.1 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.1
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.1 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.1 2014-11-19 15:54:24.300100085 +0100
- @@ -0,0 +1 @@
- +0000000000000000000000000000000000000000 bf7bb82a099dfb26b018daf70ad1985fea4d2997 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100 fetch composer: storing head
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.2 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.2
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.2 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.2 2014-11-19 15:54:24.140100084 +0100
- @@ -0,0 +1 @@
- +0000000000000000000000000000000000000000 9ff0e208cfccd5a49a233221a645ce60a582f7d0 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100 fetch composer: storing head
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.3 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.3
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.3 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.3 2014-11-19 15:54:23.984100083 +0100
- @@ -0,0 +1 @@
- +0000000000000000000000000000000000000000 5bb1c69c1e2aa246292792024aeacd75f7e5d26a Kai Fricke <fricke@elbsilber.de> 1416405099 +0100 fetch composer: storing head
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.4 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.4
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.4 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.4 2014-11-19 15:54:23.824100082 +0100
- @@ -0,0 +1 @@
- +0000000000000000000000000000000000000000 4e9ddc09c13475fb1a52fb578a8899c8303966c5 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100 fetch composer: storing head
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.5 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.5
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.5 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.5 2014-11-19 15:54:23.664100081 +0100
- @@ -0,0 +1 @@
- +0000000000000000000000000000000000000000 3046789831631e5ccdd0df1a1221380eab343922 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100 fetch composer: storing head
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.6 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.6
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.6 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.6 2014-11-19 15:54:23.508100080 +0100
- @@ -0,0 +1 @@
- +0000000000000000000000000000000000000000 41953ad30ffc5cd710d106cf01eff79f6effa117 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100 fetch composer: storing head
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.7 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.7
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.7 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.7 2014-11-19 15:54:23.344100079 +0100
- @@ -0,0 +1 @@
- +0000000000000000000000000000000000000000 301d5705725b4e11c6255e443244642eb3b5dfa1 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100 fetch composer: storing head
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/master sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/master
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/master 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/master 2014-11-19 15:54:24.620100087 +0100
- @@ -0,0 +1 @@
- +0000000000000000000000000000000000000000 32f70108bf023759e21f80646cca37763a74ea7e Kai Fricke <fricke@elbsilber.de> 1416405099 +0100 fetch composer: storing head
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/origin/HEAD sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/origin/HEAD
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/origin/HEAD 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/origin/HEAD 2014-11-19 15:54:25.096100090 +0100
- @@ -0,0 +1 @@
- +0000000000000000000000000000000000000000 32f70108bf023759e21f80646cca37763a74ea7e Kai Fricke <fricke@elbsilber.de> 1416405098 +0100 clone: from git://github.com/symfony/CssSelector.git
- Binary files sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/objects/pack/pack-15184241ba10b5603ebc1a9cd3d602ee182fe181.idx and sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/objects/pack/pack-15184241ba10b5603ebc1a9cd3d602ee182fe181.idx differ
- Binary files sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/objects/pack/pack-15184241ba10b5603ebc1a9cd3d602ee182fe181.pack and sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/objects/pack/pack-15184241ba10b5603ebc1a9cd3d602ee182fe181.pack differ
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/ORIG_HEAD sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/ORIG_HEAD
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/ORIG_HEAD 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/ORIG_HEAD 2014-11-19 15:54:26.688100100 +0100
- @@ -0,0 +1 @@
- +7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/packed-refs sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/packed-refs
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/packed-refs 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/packed-refs 2014-11-19 15:54:28.568100111 +0100
- @@ -0,0 +1,200 @@
- +# pack-refs with: peeled fully-peeled
- +354d622bce93ab079ed0ca16874f5815f2a73323 refs/remotes/origin/2.0
- +bf7bb82a099dfb26b018daf70ad1985fea4d2997 refs/remotes/origin/2.1
- +9ff0e208cfccd5a49a233221a645ce60a582f7d0 refs/remotes/origin/2.2
- +5bb1c69c1e2aa246292792024aeacd75f7e5d26a refs/remotes/origin/2.3
- +4e9ddc09c13475fb1a52fb578a8899c8303966c5 refs/remotes/origin/2.4
- +3046789831631e5ccdd0df1a1221380eab343922 refs/remotes/origin/2.5
- +41953ad30ffc5cd710d106cf01eff79f6effa117 refs/remotes/origin/2.6
- +301d5705725b4e11c6255e443244642eb3b5dfa1 refs/remotes/origin/2.7
- +32f70108bf023759e21f80646cca37763a74ea7e refs/remotes/origin/master
- +27e124eff2d95b11c6cead88def6997243f7d859 refs/tags/v2.0.0
- +^7742407893ab5f14266ebe3d48d2308d4779946f
- +3da2a3dfdaf5e735b29ce332d3f9e89bd3a5f7c8 refs/tags/v2.0.1
- +^7742407893ab5f14266ebe3d48d2308d4779946f
- +807a4362ab51b76984f1a17f080f274fc28ee78a refs/tags/v2.0.10
- +^20165ecbb58254c560eb579879b90c3b41510b31
- +08dd9dd1d60f90ca83890dd0634f88a615c20694 refs/tags/v2.0.12
- +^e22ee361ef90283fa48002cec4cc0c018ff4af37
- +753474f045641705fcd2dd4b827ac2f3a411a084 refs/tags/v2.0.13
- +^e22ee361ef90283fa48002cec4cc0c018ff4af37
- +6c90b8d51f170c57ded25bb06ab0f565a422c14f refs/tags/v2.0.14
- +^23fa9f4df262d48e7bd740741ed3903f5b674778
- +86892e6ccfba27c5c756d537f92ae338dd91b656 refs/tags/v2.0.15
- +^76ce6fd53c6ed1bca1b9b7d594e83cefd4748d1f
- +bac7cf63e069fcf71c5724220470258072ee165f refs/tags/v2.0.16
- +^e37dee425f5f3f7e31d30626ec04727e709b9b06
- +5b6c27bbf2d5a92f615ab31ef6b5bb1e9d70ba9c refs/tags/v2.0.17
- +^e37dee425f5f3f7e31d30626ec04727e709b9b06
- +ebeb675e3062599e1f6405b614edeb43dea7b8c6 refs/tags/v2.0.18
- +^e37dee425f5f3f7e31d30626ec04727e709b9b06
- +4091e5feba8b931ac5f3f1f82407b72fa34e9ca7 refs/tags/v2.0.19
- +^e37dee425f5f3f7e31d30626ec04727e709b9b06
- +ed01d136a7de1ce831d1096820d9553118c7fd02 refs/tags/v2.0.20
- +^9f6108e4b181bb9b0b99f0358d80a5d76da4911a
- +2916fb2ec2efe87d888def059ffa057145298eb8 refs/tags/v2.0.21
- +^9f6108e4b181bb9b0b99f0358d80a5d76da4911a
- +6bbf73b6400a9197f1e2342ef3cf6180c4f08144 refs/tags/v2.0.22
- +^354d622bce93ab079ed0ca16874f5815f2a73323
- +15b477ef9c9c07fa74a675531c5bc973c5a9cf2e refs/tags/v2.0.23
- +^354d622bce93ab079ed0ca16874f5815f2a73323
- +211b2621a094742ea7e774c5a41040ea6477f7cd refs/tags/v2.0.24
- +^354d622bce93ab079ed0ca16874f5815f2a73323
- +f72c7935bcc5d3d0e6887315bc50f4058f3473fe refs/tags/v2.0.25
- +^354d622bce93ab079ed0ca16874f5815f2a73323
- +d0afbef6f47a4beb5b5933a7a74ef8d97ac77ffb refs/tags/v2.0.4
- +^8b836c58bbfcd7b9193884ce82c6a6050ec856c6
- +691dce2bf054749f2544f95ee331eaef3faa3383 refs/tags/v2.0.5
- +^7e103001d8888bc7f98d3efd2d2eafae536da8d3
- +b627aefef2cd457fa5da9bc3b349d98e59e3faca refs/tags/v2.0.6
- +^9afb1eed337e8bb70dcdef165a0e83100f28e8f3
- +322062923de75630177370d0f1d20d96b49c5b70 refs/tags/v2.0.7
- +^4b6e5e7fbe86c68eb4b6b75a3b6ff53d6d6c1017
- +d32b982cce948cfc9b93623fc5954cd0201fdeb7 refs/tags/v2.0.9
- +^20165ecbb58254c560eb579879b90c3b41510b31
- +e91dfcad32fa37716791f1dc8dd949e885d40e74 refs/tags/v2.1.0
- +^676a7fd9b5027da85b58dd11db5561fef01c6271
- +4496971d39895d608b0183a92d994c6a2f020b6e refs/tags/v2.1.1
- +^676a7fd9b5027da85b58dd11db5561fef01c6271
- +a91a17be5763e422b1047b7c153ff3b6c4708ed8 refs/tags/v2.1.10
- +^8e8cb053407749391e14c0cae7ac3b7e155c1392
- +6bbecd5f35b3546a08202678bb1b11a810a0e9f3 refs/tags/v2.1.11
- +^bf7bb82a099dfb26b018daf70ad1985fea4d2997
- +7c4efbe9d9f302430f66dc5320e4f884ab285abf refs/tags/v2.1.12
- +^bf7bb82a099dfb26b018daf70ad1985fea4d2997
- +42c8693ef030ea2751f4cf57578416dec11c7821 refs/tags/v2.1.13
- +^bf7bb82a099dfb26b018daf70ad1985fea4d2997
- +0396905c85f2653942817016f3429bdbc8742729 refs/tags/v2.1.2
- +^676a7fd9b5027da85b58dd11db5561fef01c6271
- +a1806f14f34b3abf077a0482a5a38a9d846068c0 refs/tags/v2.1.3
- +^02fa0bf05b6db612e008d04184d6408c0599e73b
- +1457a0ca1f429a8b2356e8569b1e88d5f08ccf49 refs/tags/v2.1.4
- +^abf8279792230c6685234eb0fa95b0a85e9e9c7a
- +663b5137b237c5224f32b5722ead727df6c833eb refs/tags/v2.1.5
- +^3bf44fd37af95e0fd7764040abf9744f189fba05
- +d533f3decb8a490abb1fea5ba6fe31eb9abee9ee refs/tags/v2.1.6
- +^3bf44fd37af95e0fd7764040abf9744f189fba05
- +445e0302ff7f48a70b098b70e85fe01b69fac33a refs/tags/v2.1.7
- +^8e8cb053407749391e14c0cae7ac3b7e155c1392
- +bbdc3f8876893e70cbeee09b184653795ca14324 refs/tags/v2.1.8
- +^8e8cb053407749391e14c0cae7ac3b7e155c1392
- +5a036eba44f16afed55b4ec02148654e8792ea16 refs/tags/v2.1.9
- +^8e8cb053407749391e14c0cae7ac3b7e155c1392
- +02db732e277a984fa5f6d80b01675e3f25ffed75 refs/tags/v2.2.0
- +^931f7fa8b01688f7c839784e9cf2897e118e37d2
- +69b541153d73d357dc7e740d1191b987b054a0ac refs/tags/v2.2.1
- +^931f7fa8b01688f7c839784e9cf2897e118e37d2
- +a30c4a55c97964234c2ff0580a04dfd8fc1a63e9 refs/tags/v2.2.10
- +^9ff0e208cfccd5a49a233221a645ce60a582f7d0
- +0412a5fd652af3aab37d5c25ab574b117f42400a refs/tags/v2.2.11
- +^9ff0e208cfccd5a49a233221a645ce60a582f7d0
- +f8298da5580033f6eb40abf900d599369b023c41 refs/tags/v2.2.2
- +^8b4d745ffad13dbbfb99fcaccd97ae2632048260
- +96aeb89eedf84676c25d844068e41443e8677ab6 refs/tags/v2.2.3
- +^8b4d745ffad13dbbfb99fcaccd97ae2632048260
- +83da53eb47b926892fea2ebbd97ed7050821dc65 refs/tags/v2.2.4
- +^a5deeae9ed56895cff84fd9b9844727eec45a373
- +7b8a720bf11105576e970d524e2eb6a86996dc8e refs/tags/v2.2.5
- +^a5deeae9ed56895cff84fd9b9844727eec45a373
- +1e70dfb454385e4d90c76b7f95518541310c110f refs/tags/v2.2.6
- +^a5deeae9ed56895cff84fd9b9844727eec45a373
- +6221eded8db7ebcaf4eab027d1545936878b4cdf refs/tags/v2.2.7
- +^9ff0e208cfccd5a49a233221a645ce60a582f7d0
- +d043d8071bc9127fab5fc363af3bd0a66dce9208 refs/tags/v2.2.8
- +^9ff0e208cfccd5a49a233221a645ce60a582f7d0
- +9919eb8d9c778cb8bc3f214eb79e55f20205d17e refs/tags/v2.2.9
- +^9ff0e208cfccd5a49a233221a645ce60a582f7d0
- +00bd471b8fe0f4fb4acc10197b3e3c13a3060b3c refs/tags/v2.3.0
- +^6cf5ed69c27ac001d52b448a621f631e4e9b4176
- +77251f45f2696c7eb40a85a428c64cc1eab7c638 refs/tags/v2.3.1
- +^6cf5ed69c27ac001d52b448a621f631e4e9b4176
- +549ae94d03d805f23074b31ac00845fa0a77e160 refs/tags/v2.3.10
- +^a7450fde13926ab5b796f7884a05e91372dcbccc
- +88027ef4ea74c93b6f19b54a8bd1a3f056175056 refs/tags/v2.3.11
- +^a7450fde13926ab5b796f7884a05e91372dcbccc
- +814447d475a965dab549a3ec2a91f03fa2df49f2 refs/tags/v2.3.12
- +^fd008ce53fdbcf315d602921abe6fecad19804d3
- +2ab3e0ba7c999a0fef8f92ac56c74ce9d0f80cbb refs/tags/v2.3.13
- +^0d2ab42d49536760f045069415832c9c604c8cc7
- +89c27221d2b82aa34b53e0d85ab24a3faec98efb refs/tags/v2.3.14
- +^2ff53e8a7870b453836e879b083b971d455e174d
- +1a1bccf5aab8b16951ad2824ca1342f718868d26 refs/tags/v2.3.15
- +^2ff53e8a7870b453836e879b083b971d455e174d
- +a2b11132fffff8f67088647a590ff318918cde53 refs/tags/v2.3.16
- +^2ff53e8a7870b453836e879b083b971d455e174d
- +72624fb8acd766504a0f083a319986592f15ca8b refs/tags/v2.3.17
- +^f31e5ef34bc16fd08c63992b50cfd4e47c5edf8f
- +fb45079894e474ac3eb9b108ddcc8d288c82c845 refs/tags/v2.3.18
- +^84460a630f5e61486c2641a1a9b9f30df091ad49
- +34ee6af76b9d91349bb69e9dd8ffb749b03e609a refs/tags/v2.3.19
- +^8953d325d3341c246abadb79be172de95ef80664
- +2f8d38f042a862a98949eb0313fbafdc5ae07139 refs/tags/v2.3.2
- +^e3aa2495604a483b58f318ad6de845b88ec410d6
- +d29f6421ffe0013740269d380e2889a4f13b499b refs/tags/v2.3.20
- +^9b320f7b6baa094032996e3e7170ced7405f64f3
- +5fa7ac2209187d40e9979f9cdac7c80b5996c746 refs/tags/v2.3.21
- +^d9943386b648d21746bed25cc24f61fab1387943
- +7e5af359c3ef3178cf526b40e64be3e2e4af2240 refs/tags/v2.3.3
- +^885544201cb24e79754da1dbd61bd779c2e4353e
- +ad96da4ed3df875c108ca01ba9a8270f9cba5389 refs/tags/v2.3.4
- +^885544201cb24e79754da1dbd61bd779c2e4353e
- +38e7f0c2f316fd62039a606a7884144839d219c9 refs/tags/v2.3.5
- +^4e01c74f19ea049773fa3ee9fb2bb5bf5e14f7eb
- +7940c5c10db22f079a6c8ac1b26f851184c91fd2 refs/tags/v2.3.6
- +^4e01c74f19ea049773fa3ee9fb2bb5bf5e14f7eb
- +f7f1438097dfba47c2a836b5d53fb47f11e0ffb2 refs/tags/v2.3.7
- +^8df20c54ffa650df860a3e42dbcd1fbd25a24977
- +b57a05f709f2d66eadf50c4cb5d37ff4e5efa207 refs/tags/v2.3.8
- +^8df20c54ffa650df860a3e42dbcd1fbd25a24977
- +15f7928bcc61f9e2b2f4d3ba0af622f64b5a64ae refs/tags/v2.3.9
- +^48851624cb5808d16af98651aed59e5188f7277c
- +7da4f8ddf582bd1fb3dbd90ee8282a7428e2cc19 refs/tags/v2.4.0
- +^d7524797f1a6b20a8c7c31fbdd64f38fbfce1797
- +090b508f94ccb63fdc526141030e58c16e1fbfbd refs/tags/v2.4.0-BETA1
- +^2fd5d92f08774b0c9605e1a8a77273b16364ff20
- +41e1f17c47254b2b775bcff9f325e13451e9d3ca refs/tags/v2.4.0-BETA2
- +^13032e63b946d6e3f1ee0f60035298a175ae5088
- +2c78bb192bd9c4144727d8cf15f2873d86cde9fa refs/tags/v2.4.0-RC1
- +^d7524797f1a6b20a8c7c31fbdd64f38fbfce1797
- +c4268f4e5969770a31cfe56ed05d9cfb7e005488 refs/tags/v2.4.1
- +^352552da1f50a79f6a6fa427e4a85ee2ea1945f6
- +58b9dbbd13aaf1cfea5e73766242a763ca2e9ff5 refs/tags/v2.4.10
- +^4e9ddc09c13475fb1a52fb578a8899c8303966c5
- +cfd65186d56650be66c65a680ae16d58804ec29c refs/tags/v2.4.2
- +^ed1d61b2e23a0fd5dba0b20651258c4633d3e3a7
- +1617fffead2d34dc51dcaaf9ee0354349c7edc9c refs/tags/v2.4.3
- +^c0ca90adac5b581dbd346df23c3e3355ac823238
- +45fb66847ca8d71e0e9a6265a8f76f276301eb3a refs/tags/v2.4.4
- +^479a5b409723f596ffc3b5178034e4d76ce615b3
- +1052f59248bff65276b3aab5b804763520fe84b6 refs/tags/v2.4.5
- +^268d0a51166edaf84dfcf043c57f273685cb7c93
- +49cc858dcfaa04226fd97c1a0173965e76b32dd7 refs/tags/v2.4.6
- +^268d0a51166edaf84dfcf043c57f273685cb7c93
- +f4d3f6378b0ccdbd41a35ae22898c3af7fa47ee6 refs/tags/v2.4.7
- +^256a9363b26594b92bf6b5b136c49f806458abaa
- +e69282998b4c0ec359745d78b0a1404dcccd6587 refs/tags/v2.4.8
- +^52c35be379ec341c15d2edc7f798f7fd69708645
- +e141cbf12a7845d7a6f237bb2ead3fe160b4686e refs/tags/v2.4.9
- +^2014a6e253d29ded3b8dd179a8d96ac52f2dfba5
- +88d65ee501e0cc87430fa34ac35f35bcd44a1aad refs/tags/v2.5.0
- +^bcdd62af59bd3137ede467946a06d41f8644048c
- +bcf5790a2ec7d16a32ca70f2132b7acad0ba36b4 refs/tags/v2.5.0-BETA1
- +^39df955c4456b62c65e272dea2d5fd320d034ce3
- +f20eff7e36f86aa0936190ccce33103270dae94b refs/tags/v2.5.0-BETA2
- +^339e53ea57506b2532b15545cd9242f09cc48ad4
- +8441ba4a3c8a989ce9d3ba78830890d6b9be37bb refs/tags/v2.5.0-RC1
- +^bcdd62af59bd3137ede467946a06d41f8644048c
- +cdd6b38e089bb7223e2cbcdddfb3dcafc8311be4 refs/tags/v2.5.1
- +^8679e89e6cc9cd415120625071c3cbb3c70311b5
- +5dd9b7c96705cbe04abe0f4e6295898add5cf126 refs/tags/v2.5.2
- +^e24b8215bf39a6a2ce0c262bc5b000724077afa9
- +37864e8b59320b35c9d43bab0dfa7830201dc382 refs/tags/v2.5.3
- +^e24b8215bf39a6a2ce0c262bc5b000724077afa9
- +57157e3da54355f28b32fd570e8fa124be5dff1b refs/tags/v2.5.4
- +^143abf51b91e4517cde67d416bdf67a90cffa32d
- +707d1f6445c474b0bec0320d8e32077a89d9ba01 refs/tags/v2.5.5
- +^caf5ecc3face1f22884fb74b8edab65ac5ba9976
- +df39e89e37cb0445eaa5ca4b036bdcca73d2a740 refs/tags/v2.5.6
- +^7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc
- +8995817f0a50fbdefc9d5ed5048d6cea5c62c76a refs/tags/v2.6.0-BETA1
- +^41953ad30ffc5cd710d106cf01eff79f6effa117
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/heads/master sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/heads/master
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/heads/master 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/heads/master 2014-11-19 15:54:21.764100070 +0100
- @@ -0,0 +1 @@
- +32f70108bf023759e21f80646cca37763a74ea7e
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.0 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.0
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.0 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.0 2014-11-19 15:54:20.496100062 +0100
- @@ -0,0 +1 @@
- +354d622bce93ab079ed0ca16874f5815f2a73323
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.1 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.1
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.1 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.1 2014-11-19 15:54:20.336100061 +0100
- @@ -0,0 +1 @@
- +bf7bb82a099dfb26b018daf70ad1985fea4d2997
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.2 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.2
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.2 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.2 2014-11-19 15:54:20.180100060 +0100
- @@ -0,0 +1 @@
- +9ff0e208cfccd5a49a233221a645ce60a582f7d0
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.3 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.3
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.3 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.3 2014-11-19 15:54:20.020100059 +0100
- @@ -0,0 +1 @@
- +5bb1c69c1e2aa246292792024aeacd75f7e5d26a
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.4 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.4
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.4 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.4 2014-11-19 15:54:19.860100058 +0100
- @@ -0,0 +1 @@
- +4e9ddc09c13475fb1a52fb578a8899c8303966c5
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.5 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.5
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.5 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.5 2014-11-19 15:54:19.704100057 +0100
- @@ -0,0 +1 @@
- +3046789831631e5ccdd0df1a1221380eab343922
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.6 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.6
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.6 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.6 2014-11-19 15:54:20.972100065 +0100
- @@ -0,0 +1 @@
- +41953ad30ffc5cd710d106cf01eff79f6effa117
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.7 sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.7
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.7 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.7 2014-11-19 15:54:20.812100064 +0100
- @@ -0,0 +1 @@
- +301d5705725b4e11c6255e443244642eb3b5dfa1
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/master sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/master
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/master 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/master 2014-11-19 15:54:20.656100063 +0100
- @@ -0,0 +1 @@
- +32f70108bf023759e21f80646cca37763a74ea7e
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/origin/HEAD sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/origin/HEAD
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/origin/HEAD 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/origin/HEAD 2014-11-19 15:54:19.228100055 +0100
- @@ -0,0 +1 @@
- +ref: refs/remotes/origin/master
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.gitignore sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.gitignore
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.gitignore 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.gitignore 2014-11-19 15:54:09.988099999 +0100
- @@ -0,0 +1,3 @@
- +vendor/
- +composer.lock
- +phpunit.xml
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/LICENSE sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/LICENSE
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/LICENSE 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/LICENSE 2014-11-19 15:54:28.884100113 +0100
- @@ -0,0 +1,19 @@
- +Copyright (c) 2004-2014 Fabien Potencier
- +
- +Permission is hereby granted, free of charge, to any person obtaining a copy
- +of this software and associated documentation files (the "Software"), to deal
- +in the Software without restriction, including without limitation the rights
- +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- +copies of the Software, and to permit persons to whom the Software is furnished
- +to do so, subject to the following conditions:
- +
- +The above copyright notice and this permission notice shall be included in all
- +copies or substantial portions of the Software.
- +
- +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- +THE SOFTWARE.
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AbstractNode.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AbstractNode.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AbstractNode.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AbstractNode.php 2014-11-19 15:54:31.280100127 +0100
- @@ -0,0 +1,40 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +/**
- + * Abstract base node class.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +abstract class AbstractNode implements NodeInterface
- +{
- + /**
- + * @var string
- + */
- + private $nodeName;
- +
- + /**
- + * @return string
- + */
- + public function getNodeName()
- + {
- + if (null === $this->nodeName) {
- + $this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', get_called_class());
- + }
- +
- + return $this->nodeName;
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AttributeNode.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AttributeNode.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AttributeNode.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AttributeNode.php 2014-11-19 15:54:29.840100119 +0100
- @@ -0,0 +1,124 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +/**
- + * Represents a "<selector>[<namespace>|<attribute> <operator> <value>]" node.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class AttributeNode extends AbstractNode
- +{
- + /**
- + * @var NodeInterface
- + */
- + private $selector;
- +
- + /**
- + * @var string
- + */
- + private $namespace;
- +
- + /**
- + * @var string
- + */
- + private $attribute;
- +
- + /**
- + * @var string
- + */
- + private $operator;
- +
- + /**
- + * @var string
- + */
- + private $value;
- +
- + /**
- + * @param NodeInterface $selector
- + * @param string $namespace
- + * @param string $attribute
- + * @param string $operator
- + * @param string $value
- + */
- + public function __construct(NodeInterface $selector, $namespace, $attribute, $operator, $value)
- + {
- + $this->selector = $selector;
- + $this->namespace = $namespace;
- + $this->attribute = $attribute;
- + $this->operator = $operator;
- + $this->value = $value;
- + }
- +
- + /**
- + * @return NodeInterface
- + */
- + public function getSelector()
- + {
- + return $this->selector;
- + }
- +
- + /**
- + * @return string
- + */
- + public function getNamespace()
- + {
- + return $this->namespace;
- + }
- +
- + /**
- + * @return string
- + */
- + public function getAttribute()
- + {
- + return $this->attribute;
- + }
- +
- + /**
- + * @return string
- + */
- + public function getOperator()
- + {
- + return $this->operator;
- + }
- +
- + /**
- + * @return string
- + */
- + public function getValue()
- + {
- + return $this->value;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getSpecificity()
- + {
- + return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function __toString()
- + {
- + $attribute = $this->namespace ? $this->namespace.'|'.$this->attribute : $this->attribute;
- +
- + return 'exists' === $this->operator
- + ? sprintf('%s[%s[%s]]', $this->getNodeName(), $this->selector, $attribute)
- + : sprintf("%s[%s[%s %s '%s']]", $this->getNodeName(), $this->selector, $attribute, $this->operator, $this->value);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ClassNode.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ClassNode.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ClassNode.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ClassNode.php 2014-11-19 15:54:30.800100125 +0100
- @@ -0,0 +1,75 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +/**
- + * Represents a "<selector>.<name>" node.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class ClassNode extends AbstractNode
- +{
- + /**
- + * @var NodeInterface
- + */
- + private $selector;
- +
- + /**
- + * @var string
- + */
- + private $name;
- +
- + /**
- + * @param NodeInterface $selector
- + * @param string $name
- + */
- + public function __construct(NodeInterface $selector, $name)
- + {
- + $this->selector = $selector;
- + $this->name = $name;
- + }
- +
- + /**
- + * @return NodeInterface
- + */
- + public function getSelector()
- + {
- + return $this->selector;
- + }
- +
- + /**
- + * @return string
- + */
- + public function getName()
- + {
- + return $this->name;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getSpecificity()
- + {
- + return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function __toString()
- + {
- + return sprintf('%s[%s.%s]', $this->getNodeName(), $this->selector, $this->name);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php 2014-11-19 15:54:30.640100124 +0100
- @@ -0,0 +1,92 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +/**
- + * Represents a combined node.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class CombinedSelectorNode extends AbstractNode
- +{
- + /**
- + * @var NodeInterface
- + */
- + private $selector;
- +
- + /**
- + * @var string
- + */
- + private $combinator;
- +
- + /**
- + * @var NodeInterface
- + */
- + private $subSelector;
- +
- + /**
- + * @param NodeInterface $selector
- + * @param string $combinator
- + * @param NodeInterface $subSelector
- + */
- + public function __construct(NodeInterface $selector, $combinator, NodeInterface $subSelector)
- + {
- + $this->selector = $selector;
- + $this->combinator = $combinator;
- + $this->subSelector = $subSelector;
- + }
- +
- + /**
- + * @return NodeInterface
- + */
- + public function getSelector()
- + {
- + return $this->selector;
- + }
- +
- + /**
- + * @return string
- + */
- + public function getCombinator()
- + {
- + return $this->combinator;
- + }
- +
- + /**
- + * @return NodeInterface
- + */
- + public function getSubSelector()
- + {
- + return $this->subSelector;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getSpecificity()
- + {
- + return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function __toString()
- + {
- + $combinator = ' ' === $this->combinator ? '<followed>' : $this->combinator;
- +
- + return sprintf('%s[%s %s %s]', $this->getNodeName(), $this->selector, $combinator, $this->subSelector);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ElementNode.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ElementNode.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ElementNode.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ElementNode.php 2014-11-19 15:54:29.520100117 +0100
- @@ -0,0 +1,77 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +/**
- + * Represents a "<namespace>|<element>" node.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class ElementNode extends AbstractNode
- +{
- + /**
- + * @var string|null
- + */
- + private $namespace;
- +
- + /**
- + * @var string|null
- + */
- + private $element;
- +
- + /**
- + * @param string|null $namespace
- + * @param string|null $element
- + */
- + public function __construct($namespace = null, $element = null)
- + {
- + $this->namespace = $namespace;
- + $this->element = $element;
- + }
- +
- + /**
- + * @return null|string
- + */
- + public function getNamespace()
- + {
- + return $this->namespace;
- + }
- +
- + /**
- + * @return null|string
- + */
- + public function getElement()
- + {
- + return $this->element;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getSpecificity()
- + {
- + return new Specificity(0, 0, $this->element ? 1 : 0);
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function __toString()
- + {
- + $element = $this->element ?: '*';
- +
- + return sprintf('%s[%s]', $this->getNodeName(), $this->namespace ? $this->namespace.'|'.$element : $element);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/FunctionNode.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/FunctionNode.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/FunctionNode.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/FunctionNode.php 2014-11-19 15:54:30.160100121 +0100
- @@ -0,0 +1,96 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +use Symfony\Component\CssSelector\Parser\Token;
- +
- +/**
- + * Represents a "<selector>:<name>(<arguments>)" node.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class FunctionNode extends AbstractNode
- +{
- + /**
- + * @var NodeInterface
- + */
- + private $selector;
- +
- + /**
- + * @var string
- + */
- + private $name;
- +
- + /**
- + * @var Token[]
- + */
- + private $arguments;
- +
- + /**
- + * @param NodeInterface $selector
- + * @param string $name
- + * @param Token[] $arguments
- + */
- + public function __construct(NodeInterface $selector, $name, array $arguments = array())
- + {
- + $this->selector = $selector;
- + $this->name = strtolower($name);
- + $this->arguments = $arguments;
- + }
- +
- + /**
- + * @return NodeInterface
- + */
- + public function getSelector()
- + {
- + return $this->selector;
- + }
- +
- + /**
- + * @return string
- + */
- + public function getName()
- + {
- + return $this->name;
- + }
- +
- + /**
- + * @return Token[]
- + */
- + public function getArguments()
- + {
- + return $this->arguments;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getSpecificity()
- + {
- + return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function __toString()
- + {
- + $arguments = implode(', ', array_map(function (Token $token) {
- + return "'".$token->getValue()."'";
- + }, $this->arguments));
- +
- + return sprintf('%s[%s:%s(%s)]', $this->getNodeName(), $this->selector, $this->name, $arguments ? '['.$arguments.']' : '');
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/HashNode.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/HashNode.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/HashNode.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/HashNode.php 2014-11-19 15:54:30.480100123 +0100
- @@ -0,0 +1,75 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +/**
- + * Represents a "<selector>#<id>" node.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class HashNode extends AbstractNode
- +{
- + /**
- + * @var NodeInterface
- + */
- + private $selector;
- +
- + /**
- + * @var string
- + */
- + private $id;
- +
- + /**
- + * @param NodeInterface $selector
- + * @param string $id
- + */
- + public function __construct(NodeInterface $selector, $id)
- + {
- + $this->selector = $selector;
- + $this->id = $id;
- + }
- +
- + /**
- + * @return NodeInterface
- + */
- + public function getSelector()
- + {
- + return $this->selector;
- + }
- +
- + /**
- + * @return string
- + */
- + public function getId()
- + {
- + return $this->id;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getSpecificity()
- + {
- + return $this->selector->getSpecificity()->plus(new Specificity(1, 0, 0));
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function __toString()
- + {
- + return sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NegationNode.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NegationNode.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NegationNode.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NegationNode.php 2014-11-19 15:54:30.320100122 +0100
- @@ -0,0 +1,75 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +/**
- + * Represents a "<selector>:not(<identifier>)" node.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class NegationNode extends AbstractNode
- +{
- + /**
- + * @var NodeInterface
- + */
- + private $selector;
- +
- + /**
- + * @var NodeInterface
- + */
- + private $subSelector;
- +
- + /**
- + * @param NodeInterface $selector
- + * @param NodeInterface $subSelector
- + */
- + public function __construct(NodeInterface $selector, NodeInterface $subSelector)
- + {
- + $this->selector = $selector;
- + $this->subSelector = $subSelector;
- + }
- +
- + /**
- + * @return NodeInterface
- + */
- + public function getSelector()
- + {
- + return $this->selector;
- + }
- +
- + /**
- + * @return NodeInterface
- + */
- + public function getSubSelector()
- + {
- + return $this->subSelector;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getSpecificity()
- + {
- + return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function __toString()
- + {
- + return sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NodeInterface.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NodeInterface.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NodeInterface.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NodeInterface.php 2014-11-19 15:54:30.000100120 +0100
- @@ -0,0 +1,44 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +/**
- + * Interface for nodes.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +interface NodeInterface
- +{
- + /**
- + * Returns node's name.
- + *
- + * @return string
- + */
- + public function getNodeName();
- +
- + /**
- + * Returns node's specificity.
- + *
- + * @return Specificity
- + */
- + public function getSpecificity();
- +
- + /**
- + * Returns node's string representation.
- + *
- + * @return string
- + */
- + public function __toString();
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/PseudoNode.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/PseudoNode.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/PseudoNode.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/PseudoNode.php 2014-11-19 15:54:29.680100118 +0100
- @@ -0,0 +1,75 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +/**
- + * Represents a "<selector>:<identifier>" node.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class PseudoNode extends AbstractNode
- +{
- + /**
- + * @var NodeInterface
- + */
- + private $selector;
- +
- + /**
- + * @var string
- + */
- + private $identifier;
- +
- + /**
- + * @param NodeInterface $selector
- + * @param string $identifier
- + */
- + public function __construct(NodeInterface $selector, $identifier)
- + {
- + $this->selector = $selector;
- + $this->identifier = strtolower($identifier);
- + }
- +
- + /**
- + * @return NodeInterface
- + */
- + public function getSelector()
- + {
- + return $this->selector;
- + }
- +
- + /**
- + * @return string
- + */
- + public function getIdentifier()
- + {
- + return $this->identifier;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getSpecificity()
- + {
- + return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function __toString()
- + {
- + return sprintf('%s[%s:%s]', $this->getNodeName(), $this->selector, $this->identifier);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/SelectorNode.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/SelectorNode.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/SelectorNode.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/SelectorNode.php 2014-11-19 15:54:31.120100126 +0100
- @@ -0,0 +1,75 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +/**
- + * Represents a "<selector>(::|:)<pseudoElement>" node.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class SelectorNode extends AbstractNode
- +{
- + /**
- + * @var NodeInterface
- + */
- + private $tree;
- +
- + /**
- + * @var null|string
- + */
- + private $pseudoElement;
- +
- + /**
- + * @param NodeInterface $tree
- + * @param null|string $pseudoElement
- + */
- + public function __construct(NodeInterface $tree, $pseudoElement = null)
- + {
- + $this->tree = $tree;
- + $this->pseudoElement = $pseudoElement ? strtolower($pseudoElement) : null;
- + }
- +
- + /**
- + * @return NodeInterface
- + */
- + public function getTree()
- + {
- + return $this->tree;
- + }
- +
- + /**
- + * @return null|string
- + */
- + public function getPseudoElement()
- + {
- + return $this->pseudoElement;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getSpecificity()
- + {
- + return $this->tree->getSpecificity()->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0));
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function __toString()
- + {
- + return sprintf('%s[%s%s]', $this->getNodeName(), $this->tree, $this->pseudoElement ? '::'.$this->pseudoElement : '');
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/Specificity.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/Specificity.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/Specificity.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/Specificity.php 2014-11-19 15:54:30.960100126 +0100
- @@ -0,0 +1,78 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Node;
- +
- +/**
- + * Represents a node specificity.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @see http://www.w3.org/TR/selectors/#specificity
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class Specificity
- +{
- + const A_FACTOR = 100;
- + const B_FACTOR = 10;
- + const C_FACTOR = 1;
- +
- + /**
- + * @var int
- + */
- + private $a;
- +
- + /**
- + * @var int
- + */
- + private $b;
- +
- + /**
- + * @var int
- + */
- + private $c;
- +
- + /**
- + * Constructor.
- + *
- + * @param int $a
- + * @param int $b
- + * @param int $c
- + */
- + public function __construct($a, $b, $c)
- + {
- + $this->a = $a;
- + $this->b = $b;
- + $this->c = $c;
- + }
- +
- + /**
- + * @param Specificity $specificity
- + *
- + * @return Specificity
- + */
- + public function plus(Specificity $specificity)
- + {
- + return new self($this->a + $specificity->a, $this->b + $specificity->b, $this->c + $specificity->c);
- + }
- +
- + /**
- + * Returns global specificity value.
- + *
- + * @return int
- + */
- + public function getValue()
- + {
- + return $this->a * self::A_FACTOR + $this->b * self::B_FACTOR + $this->c * self::C_FACTOR;
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php 2014-11-19 15:54:12.840100016 +0100
- @@ -0,0 +1,46 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Reader;
- +use Symfony\Component\CssSelector\Parser\TokenStream;
- +
- +/**
- + * CSS selector comment handler.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class CommentHandler implements HandlerInterface
- +{
- + /**
- + * {@inheritdoc}
- + */
- + public function handle(Reader $reader, TokenStream $stream)
- + {
- + if ('/*' !== $reader->getSubstring(2)) {
- + return false;
- + }
- +
- + $offset = $reader->getOffset('*/');
- +
- + if (false === $offset) {
- + $reader->moveToEnd();
- + } else {
- + $reader->moveForward($offset + 2);
- + }
- +
- + return true;
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php 2014-11-19 15:54:12.364100013 +0100
- @@ -0,0 +1,34 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Reader;
- +use Symfony\Component\CssSelector\Parser\TokenStream;
- +
- +/**
- + * CSS selector handler interface.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +interface HandlerInterface
- +{
- + /**
- + * @param Reader $reader
- + * @param TokenStream $stream
- + *
- + * @return bool
- + */
- + public function handle(Reader $reader, TokenStream $stream);
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php 2014-11-19 15:54:12.520100014 +0100
- @@ -0,0 +1,67 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Reader;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\TokenStream;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
- +
- +/**
- + * CSS selector comment handler.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class HashHandler implements HandlerInterface
- +{
- + /**
- + * @var TokenizerPatterns
- + */
- + private $patterns;
- +
- + /**
- + * @var TokenizerEscaping
- + */
- + private $escaping;
- +
- + /**
- + * @param TokenizerPatterns $patterns
- + * @param TokenizerEscaping $escaping
- + */
- + public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping)
- + {
- + $this->patterns = $patterns;
- + $this->escaping = $escaping;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function handle(Reader $reader, TokenStream $stream)
- + {
- + $match = $reader->findPattern($this->patterns->getHashPattern());
- +
- + if (!$match) {
- + return false;
- + }
- +
- + $value = $this->escaping->escapeUnicode($match[1]);
- + $stream->push(new Token(Token::TYPE_HASH, $value, $reader->getPosition()));
- + $reader->moveForward(strlen($match[0]));
- +
- + return true;
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php 2014-11-19 15:54:12.044100011 +0100
- @@ -0,0 +1,67 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Reader;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\TokenStream;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
- +
- +/**
- + * CSS selector comment handler.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class IdentifierHandler implements HandlerInterface
- +{
- + /**
- + * @var TokenizerPatterns
- + */
- + private $patterns;
- +
- + /**
- + * @var TokenizerEscaping
- + */
- + private $escaping;
- +
- + /**
- + * @param TokenizerPatterns $patterns
- + * @param TokenizerEscaping $escaping
- + */
- + public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping)
- + {
- + $this->patterns = $patterns;
- + $this->escaping = $escaping;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function handle(Reader $reader, TokenStream $stream)
- + {
- + $match = $reader->findPattern($this->patterns->getIdentifierPattern());
- +
- + if (!$match) {
- + return false;
- + }
- +
- + $value = $this->escaping->escapeUnicode($match[0]);
- + $stream->push(new Token(Token::TYPE_IDENTIFIER, $value, $reader->getPosition()));
- + $reader->moveForward(strlen($match[0]));
- +
- + return true;
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php 2014-11-19 15:54:12.204100012 +0100
- @@ -0,0 +1,58 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Reader;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\TokenStream;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
- +
- +/**
- + * CSS selector comment handler.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class NumberHandler implements HandlerInterface
- +{
- + /**
- + * @var TokenizerPatterns
- + */
- + private $patterns;
- +
- + /**
- + * @param TokenizerPatterns $patterns
- + */
- + public function __construct(TokenizerPatterns $patterns)
- + {
- + $this->patterns = $patterns;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function handle(Reader $reader, TokenStream $stream)
- + {
- + $match = $reader->findPattern($this->patterns->getNumberPattern());
- +
- + if (!$match) {
- + return false;
- + }
- +
- + $stream->push(new Token(Token::TYPE_NUMBER, $match[0], $reader->getPosition()));
- + $reader->moveForward(strlen($match[0]));
- +
- + return true;
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php 2014-11-19 15:54:12.680100015 +0100
- @@ -0,0 +1,86 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Exception\InternalErrorException;
- +use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
- +use Symfony\Component\CssSelector\Parser\Reader;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\TokenStream;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
- +
- +/**
- + * CSS selector comment handler.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class StringHandler implements HandlerInterface
- +{
- + /**
- + * @var TokenizerPatterns
- + */
- + private $patterns;
- +
- + /**
- + * @var TokenizerEscaping
- + */
- + private $escaping;
- +
- + /**
- + * @param TokenizerPatterns $patterns
- + * @param TokenizerEscaping $escaping
- + */
- + public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping)
- + {
- + $this->patterns = $patterns;
- + $this->escaping = $escaping;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function handle(Reader $reader, TokenStream $stream)
- + {
- + $quote = $reader->getSubstring(1);
- +
- + if (!in_array($quote, array("'", '"'))) {
- + return false;
- + }
- +
- + $reader->moveForward(1);
- + $match = $reader->findPattern($this->patterns->getQuotedStringPattern($quote));
- +
- + if (!$match) {
- + throw new InternalErrorException(sprintf('Should have found at least an empty match at %s.', $reader->getPosition()));
- + }
- +
- + // check unclosed strings
- + if (strlen($match[0]) === $reader->getRemainingLength()) {
- + throw SyntaxErrorException::unclosedString($reader->getPosition() - 1);
- + }
- +
- + // check quotes pairs validity
- + if ($quote !== $reader->getSubstring(1, strlen($match[0]))) {
- + throw SyntaxErrorException::unclosedString($reader->getPosition() - 1);
- + }
- +
- + $string = $this->escaping->escapeUnicodeAndNewLine($match[0]);
- + $stream->push(new Token(Token::TYPE_STRING, $string, $reader->getPosition()));
- + $reader->moveForward(strlen($match[0]) + 1);
- +
- + return true;
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php 2014-11-19 15:54:13.000100017 +0100
- @@ -0,0 +1,44 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Reader;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\TokenStream;
- +
- +/**
- + * CSS selector whitespace handler.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class WhitespaceHandler implements HandlerInterface
- +{
- + /**
- + * {@inheritdoc}
- + */
- + public function handle(Reader $reader, TokenStream $stream)
- + {
- + $match = $reader->findPattern('~^[ \t\r\n\f]+~');
- +
- + if (false === $match) {
- + return false;
- + }
- +
- + $stream->push(new Token(Token::TYPE_WHITESPACE, $match[0], $reader->getPosition()));
- + $reader->moveForward(strlen($match[0]));
- +
- + return true;
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/ParserInterface.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/ParserInterface.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/ParserInterface.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/ParserInterface.php 2014-11-19 15:54:13.324100019 +0100
- @@ -0,0 +1,34 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser;
- +
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +
- +/**
- + * CSS selector parser interface.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +interface ParserInterface
- +{
- + /**
- + * Parses given selector source into an array of tokens.
- + *
- + * @param string $source
- + *
- + * @return SelectorNode[]
- + */
- + public function parse($source);
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Parser.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Parser.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Parser.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Parser.php 2014-11-19 15:54:13.496100020 +0100
- @@ -0,0 +1,399 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser;
- +
- +use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
- +use Symfony\Component\CssSelector\Node;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer;
- +
- +/**
- + * CSS selector parser.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class Parser implements ParserInterface
- +{
- + /**
- + * @var Tokenizer
- + */
- + private $tokenizer;
- +
- + /**
- + * Constructor.
- + *
- + * @param null|Tokenizer $tokenizer
- + */
- + public function __construct(Tokenizer $tokenizer = null)
- + {
- + $this->tokenizer = $tokenizer ?: new Tokenizer();
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function parse($source)
- + {
- + $reader = new Reader($source);
- + $stream = $this->tokenizer->tokenize($reader);
- +
- + return $this->parseSelectorList($stream);
- + }
- +
- + /**
- + * Parses the arguments for ":nth-child()" and friends.
- + *
- + * @param Token[] $tokens
- + *
- + * @throws SyntaxErrorException
- + *
- + * @return array
- + */
- + public static function parseSeries(array $tokens)
- + {
- + foreach ($tokens as $token) {
- + if ($token->isString()) {
- + throw SyntaxErrorException::stringAsFunctionArgument();
- + }
- + }
- +
- + $joined = trim(implode('', array_map(function (Token $token) {
- + return $token->getValue();
- + }, $tokens)));
- +
- + $int = function ($string) {
- + if (!is_numeric($string)) {
- + throw SyntaxErrorException::stringAsFunctionArgument();
- + }
- +
- + return (int) $string;
- + };
- +
- + switch (true) {
- + case 'odd' === $joined:
- + return array(2, 1);
- + case 'even' === $joined:
- + return array(2, 0);
- + case 'n' === $joined:
- + return array(1, 0);
- + case false === strpos($joined, 'n'):
- + return array(0, $int($joined));
- + }
- +
- + $split = explode('n', $joined);
- + $first = isset($split[0]) ? $split[0] : null;
- +
- + return array(
- + $first ? ('-' === $first || '+' === $first ? $int($first.'1') : $int($first)) : 1,
- + isset($split[1]) && $split[1] ? $int($split[1]) : 0,
- + );
- + }
- +
- + /**
- + * Parses selector nodes.
- + *
- + * @param TokenStream $stream
- + *
- + * @return array
- + */
- + private function parseSelectorList(TokenStream $stream)
- + {
- + $stream->skipWhitespace();
- + $selectors = array();
- +
- + while (true) {
- + $selectors[] = $this->parserSelectorNode($stream);
- +
- + if ($stream->getPeek()->isDelimiter(array(','))) {
- + $stream->getNext();
- + $stream->skipWhitespace();
- + } else {
- + break;
- + }
- + }
- +
- + return $selectors;
- + }
- +
- + /**
- + * Parses next selector or combined node.
- + *
- + * @param TokenStream $stream
- + *
- + * @throws SyntaxErrorException
- + *
- + * @return Node\SelectorNode
- + */
- + private function parserSelectorNode(TokenStream $stream)
- + {
- + list($result, $pseudoElement) = $this->parseSimpleSelector($stream);
- +
- + while (true) {
- + $stream->skipWhitespace();
- + $peek = $stream->getPeek();
- +
- + if ($peek->isFileEnd() || $peek->isDelimiter(array(','))) {
- + break;
- + }
- +
- + if (null !== $pseudoElement) {
- + throw SyntaxErrorException::pseudoElementFound($pseudoElement, 'not at the end of a selector');
- + }
- +
- + if ($peek->isDelimiter(array('+', '>', '~'))) {
- + $combinator = $stream->getNext()->getValue();
- + $stream->skipWhitespace();
- + } else {
- + $combinator = ' ';
- + }
- +
- + list($nextSelector, $pseudoElement) = $this->parseSimpleSelector($stream);
- + $result = new Node\CombinedSelectorNode($result, $combinator, $nextSelector);
- + }
- +
- + return new Node\SelectorNode($result, $pseudoElement);
- + }
- +
- + /**
- + * Parses next simple node (hash, class, pseudo, negation).
- + *
- + * @param TokenStream $stream
- + * @param bool $insideNegation
- + *
- + * @throws SyntaxErrorException
- + *
- + * @return array
- + */
- + private function parseSimpleSelector(TokenStream $stream, $insideNegation = false)
- + {
- + $stream->skipWhitespace();
- +
- + $selectorStart = count($stream->getUsed());
- + $result = $this->parseElementNode($stream);
- + $pseudoElement = null;
- +
- + while (true) {
- + $peek = $stream->getPeek();
- + if ($peek->isWhitespace()
- + || $peek->isFileEnd()
- + || $peek->isDelimiter(array(',', '+', '>', '~'))
- + || ($insideNegation && $peek->isDelimiter(array(')')))
- + ) {
- + break;
- + }
- +
- + if (null !== $pseudoElement) {
- + throw SyntaxErrorException::pseudoElementFound($pseudoElement, 'not at the end of a selector');
- + }
- +
- + if ($peek->isHash()) {
- + $result = new Node\HashNode($result, $stream->getNext()->getValue());
- + } elseif ($peek->isDelimiter(array('.'))) {
- + $stream->getNext();
- + $result = new Node\ClassNode($result, $stream->getNextIdentifier());
- + } elseif ($peek->isDelimiter(array('['))) {
- + $stream->getNext();
- + $result = $this->parseAttributeNode($result, $stream);
- + } elseif ($peek->isDelimiter(array(':'))) {
- + $stream->getNext();
- +
- + if ($stream->getPeek()->isDelimiter(array(':'))) {
- + $stream->getNext();
- + $pseudoElement = $stream->getNextIdentifier();
- +
- + continue;
- + }
- +
- + $identifier = $stream->getNextIdentifier();
- + if (in_array(strtolower($identifier), array('first-line', 'first-letter', 'before', 'after'))) {
- + // Special case: CSS 2.1 pseudo-elements can have a single ':'.
- + // Any new pseudo-element must have two.
- + $pseudoElement = $identifier;
- +
- + continue;
- + }
- +
- + if (!$stream->getPeek()->isDelimiter(array('('))) {
- + $result = new Node\PseudoNode($result, $identifier);
- +
- + continue;
- + }
- +
- + $stream->getNext();
- + $stream->skipWhitespace();
- +
- + if ('not' === strtolower($identifier)) {
- + if ($insideNegation) {
- + throw SyntaxErrorException::nestedNot();
- + }
- +
- + list($argument, $argumentPseudoElement) = $this->parseSimpleSelector($stream, true);
- + $next = $stream->getNext();
- +
- + if (null !== $argumentPseudoElement) {
- + throw SyntaxErrorException::pseudoElementFound($argumentPseudoElement, 'inside ::not()');
- + }
- +
- + if (!$next->isDelimiter(array(')'))) {
- + throw SyntaxErrorException::unexpectedToken('")"', $next);
- + }
- +
- + $result = new Node\NegationNode($result, $argument);
- + } else {
- + $arguments = array();
- + $next = null;
- +
- + while (true) {
- + $stream->skipWhitespace();
- + $next = $stream->getNext();
- +
- + if ($next->isIdentifier()
- + || $next->isString()
- + || $next->isNumber()
- + || $next->isDelimiter(array('+', '-'))
- + ) {
- + $arguments[] = $next;
- + } elseif ($next->isDelimiter(array(')'))) {
- + break;
- + } else {
- + throw SyntaxErrorException::unexpectedToken('an argument', $next);
- + }
- + }
- +
- + if (empty($arguments)) {
- + throw SyntaxErrorException::unexpectedToken('at least one argument', $next);
- + }
- +
- + $result = new Node\FunctionNode($result, $identifier, $arguments);
- + }
- + } else {
- + throw SyntaxErrorException::unexpectedToken('selector', $peek);
- + }
- + }
- +
- + if (count($stream->getUsed()) === $selectorStart) {
- + throw SyntaxErrorException::unexpectedToken('selector', $stream->getPeek());
- + }
- +
- + return array($result, $pseudoElement);
- + }
- +
- + /**
- + * Parses next element node.
- + *
- + * @param TokenStream $stream
- + *
- + * @return Node\ElementNode
- + */
- + private function parseElementNode(TokenStream $stream)
- + {
- + $peek = $stream->getPeek();
- +
- + if ($peek->isIdentifier() || $peek->isDelimiter(array('*'))) {
- + if ($peek->isIdentifier()) {
- + $namespace = $stream->getNext()->getValue();
- + } else {
- + $stream->getNext();
- + $namespace = null;
- + }
- +
- + if ($stream->getPeek()->isDelimiter(array('|'))) {
- + $stream->getNext();
- + $element = $stream->getNextIdentifierOrStar();
- + } else {
- + $element = $namespace;
- + $namespace = null;
- + }
- + } else {
- + $element = $namespace = null;
- + }
- +
- + return new Node\ElementNode($namespace, $element);
- + }
- +
- + /**
- + * Parses next attribute node.
- + *
- + * @param Node\NodeInterface $selector
- + * @param TokenStream $stream
- + *
- + * @throws SyntaxErrorException
- + *
- + * @return Node\AttributeNode
- + */
- + private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream)
- + {
- + $stream->skipWhitespace();
- + $attribute = $stream->getNextIdentifierOrStar();
- +
- + if (null === $attribute && !$stream->getPeek()->isDelimiter(array('|'))) {
- + throw SyntaxErrorException::unexpectedToken('"|"', $stream->getPeek());
- + }
- +
- + if ($stream->getPeek()->isDelimiter(array('|'))) {
- + $stream->getNext();
- +
- + if ($stream->getPeek()->isDelimiter(array('='))) {
- + $namespace = null;
- + $stream->getNext();
- + $operator = '|=';
- + } else {
- + $namespace = $attribute;
- + $attribute = $stream->getNextIdentifier();
- + $operator = null;
- + }
- + } else {
- + $namespace = $operator = null;
- + }
- +
- + if (null === $operator) {
- + $stream->skipWhitespace();
- + $next = $stream->getNext();
- +
- + if ($next->isDelimiter(array(']'))) {
- + return new Node\AttributeNode($selector, $namespace, $attribute, 'exists', null);
- + } elseif ($next->isDelimiter(array('='))) {
- + $operator = '=';
- + } elseif ($next->isDelimiter(array('^', '$', '*', '~', '|', '!'))
- + && $stream->getPeek()->isDelimiter(array('='))
- + ) {
- + $operator = $next->getValue().'=';
- + $stream->getNext();
- + } else {
- + throw SyntaxErrorException::unexpectedToken('operator', $next);
- + }
- + }
- +
- + $stream->skipWhitespace();
- + $value = $stream->getNext();
- +
- + if ($value->isNumber()) {
- + // if the value is a number, it's casted into a string
- + $value = new Token(Token::TYPE_STRING, (string) $value->getValue(), $value->getPosition());
- + }
- +
- + if (!($value->isIdentifier() || $value->isString())) {
- + throw SyntaxErrorException::unexpectedToken('string or identifier', $value);
- + }
- +
- + $stream->skipWhitespace();
- + $next = $stream->getNext();
- +
- + if (!$next->isDelimiter(array(']'))) {
- + throw SyntaxErrorException::unexpectedToken('"]"', $next);
- + }
- +
- + return new Node\AttributeNode($selector, $namespace, $attribute, $operator, $value->getValue());
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Reader.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Reader.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Reader.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Reader.php 2014-11-19 15:54:15.408100031 +0100
- @@ -0,0 +1,125 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser;
- +
- +/**
- + * CSS selector reader.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class Reader
- +{
- + /**
- + * @var string
- + */
- + private $source;
- +
- + /**
- + * @var int
- + */
- + private $length;
- +
- + /**
- + * @var int
- + */
- + private $position = 0;
- +
- + /**
- + * @param string $source
- + */
- + public function __construct($source)
- + {
- + $this->source = $source;
- + $this->length = strlen($source);
- + }
- +
- + /**
- + * @return bool
- + */
- + public function isEOF()
- + {
- + return $this->position >= $this->length;
- + }
- +
- + /**
- + * @return int
- + */
- + public function getPosition()
- + {
- + return $this->position;
- + }
- +
- + /**
- + * @return int
- + */
- + public function getRemainingLength()
- + {
- + return $this->length - $this->position;
- + }
- +
- + /**
- + * @param int $length
- + * @param int $offset
- + *
- + * @return string
- + */
- + public function getSubstring($length, $offset = 0)
- + {
- + return substr($this->source, $this->position + $offset, $length);
- + }
- +
- + /**
- + * @param string $string
- + *
- + * @return int
- + */
- + public function getOffset($string)
- + {
- + $position = strpos($this->source, $string, $this->position);
- +
- + return false === $position ? false : $position - $this->position;
- + }
- +
- + /**
- + * @param string $pattern
- + *
- + * @return bool
- + */
- + public function findPattern($pattern)
- + {
- + $source = substr($this->source, $this->position);
- +
- + if (preg_match($pattern, $source, $matches)) {
- + return $matches;
- + }
- +
- + return false;
- + }
- +
- + /**
- + * @param int $length
- + */
- + public function moveForward($length)
- + {
- + $this->position += $length;
- + }
- +
- + /**
- + */
- + public function moveToEnd()
- + {
- + $this->position = $this->length;
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php 2014-11-19 15:54:15.088100029 +0100
- @@ -0,0 +1,50 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Shortcut;
- +
- +use Symfony\Component\CssSelector\Node\ClassNode;
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +use Symfony\Component\CssSelector\Parser\ParserInterface;
- +
- +/**
- + * CSS selector class parser shortcut.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class ClassParser implements ParserInterface
- +{
- + /**
- + * {@inheritdoc}
- + */
- + public function parse($source)
- + {
- + // Matches an optional namespace, optional element, and required class
- + // $source = 'test|input.ab6bd_field';
- + // $matches = array (size=5)
- + // 0 => string 'test:input.ab6bd_field' (length=22)
- + // 1 => string 'test:' (length=5)
- + // 2 => string 'test' (length=4)
- + // 3 => string 'input' (length=5)
- + // 4 => string 'ab6bd_field' (length=11)
- + if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?\.([\w-]+)$/i', trim($source), $matches)) {
- + return array(
- + new SelectorNode(new ClassNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])),
- + );
- + }
- +
- + return array();
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php 2014-11-19 15:54:15.248100030 +0100
- @@ -0,0 +1,46 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Shortcut;
- +
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +use Symfony\Component\CssSelector\Parser\ParserInterface;
- +
- +/**
- + * CSS selector element parser shortcut.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class ElementParser implements ParserInterface
- +{
- + /**
- + * {@inheritdoc}
- + */
- + public function parse($source)
- + {
- + // Matches an optional namespace, required element or `*`
- + // $source = 'testns|testel';
- + // $matches = array (size=4)
- + // 0 => string 'testns:testel' (length=13)
- + // 1 => string 'testns:' (length=7)
- + // 2 => string 'testns' (length=6)
- + // 3 => string 'testel' (length=6)
- + if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)$/i', trim($source), $matches)) {
- + return array(new SelectorNode(new ElementNode($matches[2] ?: null, $matches[3])));
- + }
- +
- + return array();
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php 2014-11-19 15:54:14.768100028 +0100
- @@ -0,0 +1,44 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Shortcut;
- +
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +use Symfony\Component\CssSelector\Parser\ParserInterface;
- +
- +/**
- + * CSS selector class parser shortcut.
- + *
- + * This shortcut ensure compatibility with previous version.
- + * - The parser fails to parse an empty string.
- + * - In the previous version, an empty string matches each tags.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class EmptyStringParser implements ParserInterface
- +{
- + /**
- + * {@inheritdoc}
- + */
- + public function parse($source)
- + {
- + // Matches an empty string
- + if ($source == '') {
- + return array(new SelectorNode(new ElementNode(null, '*')));
- + }
- +
- + return array();
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php 2014-11-19 15:54:14.928100028 +0100
- @@ -0,0 +1,50 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Shortcut;
- +
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +use Symfony\Component\CssSelector\Node\HashNode;
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +use Symfony\Component\CssSelector\Parser\ParserInterface;
- +
- +/**
- + * CSS selector hash parser shortcut.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class HashParser implements ParserInterface
- +{
- + /**
- + * {@inheritdoc}
- + */
- + public function parse($source)
- + {
- + // Matches an optional namespace, optional element, and required id
- + // $source = 'test|input#ab6bd_field';
- + // $matches = array (size=5)
- + // 0 => string 'test:input#ab6bd_field' (length=22)
- + // 1 => string 'test:' (length=5)
- + // 2 => string 'test' (length=4)
- + // 3 => string 'input' (length=5)
- + // 4 => string 'ab6bd_field' (length=11)
- + if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?#([\w-]+)$/i', trim($source), $matches)) {
- + return array(
- + new SelectorNode(new HashNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])),
- + );
- + }
- +
- + return array();
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php 2014-11-19 15:54:14.124100024 +0100
- @@ -0,0 +1,82 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Tokenizer;
- +
- +/**
- + * CSS selector tokenizer escaping applier.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class TokenizerEscaping
- +{
- + /**
- + * @var TokenizerPatterns
- + */
- + private $patterns;
- +
- + /**
- + * @param TokenizerPatterns $patterns
- + */
- + public function __construct(TokenizerPatterns $patterns)
- + {
- + $this->patterns = $patterns;
- + }
- +
- + /**
- + * @param string $value
- + *
- + * @return string
- + */
- + public function escapeUnicode($value)
- + {
- + $value = $this->replaceUnicodeSequences($value);
- +
- + return preg_replace($this->patterns->getSimpleEscapePattern(), '$1', $value);
- + }
- +
- + /**
- + * @param string $value
- + *
- + * @return string
- + */
- + public function escapeUnicodeAndNewLine($value)
- + {
- + $value = preg_replace($this->patterns->getNewLineEscapePattern(), '', $value);
- +
- + return $this->escapeUnicode($value);
- + }
- +
- + /**
- + * @param string $value
- + *
- + * @return string
- + */
- + private function replaceUnicodeSequences($value)
- + {
- + return preg_replace_callback($this->patterns->getUnicodeEscapePattern(), function ($match) {
- + $c = hexdec($match[1]);
- +
- + if (0x80 > $c %= 0x200000) {
- + return chr($c);
- + }
- + if (0x800 > $c) {
- + return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F);
- + }
- + if (0x10000 > $c) {
- + return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);
- + }
- + }, $value);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php 2014-11-19 15:54:14.288100025 +0100
- @@ -0,0 +1,160 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Tokenizer;
- +
- +/**
- + * CSS selector tokenizer patterns builder.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class TokenizerPatterns
- +{
- + /**
- + * @var string
- + */
- + private $unicodeEscapePattern;
- +
- + /**
- + * @var string
- + */
- + private $simpleEscapePattern;
- +
- + /**
- + * @var string
- + */
- + private $newLineEscapePattern;
- +
- + /**
- + * @var string
- + */
- + private $escapePattern;
- +
- + /**
- + * @var string
- + */
- + private $stringEscapePattern;
- +
- + /**
- + * @var string
- + */
- + private $nonAsciiPattern;
- +
- + /**
- + * @var string
- + */
- + private $nmCharPattern;
- +
- + /**
- + * @var string
- + */
- + private $nmStartPattern;
- +
- + /**
- + * @var string
- + */
- + private $identifierPattern;
- +
- + /**
- + * @var string
- + */
- + private $hashPattern;
- +
- + /**
- + * @var string
- + */
- + private $numberPattern;
- +
- + /**
- + * @var string
- + */
- + private $quotedStringPattern;
- +
- + /**
- + * Constructor.
- + */
- + public function __construct()
- + {
- + $this->unicodeEscapePattern = '\\\\([0-9a-f]{1,6})(?:\r\n|[ \n\r\t\f])?';
- + $this->simpleEscapePattern = '\\\\(.)';
- + $this->newLineEscapePattern = '\\\\(?:\n|\r\n|\r|\f)';
- + $this->escapePattern = $this->unicodeEscapePattern.'|\\\\[^\n\r\f0-9a-f]';
- + $this->stringEscapePattern = $this->newLineEscapePattern.'|'.$this->escapePattern;
- + $this->nonAsciiPattern = '[^\x00-\x7F]';
- + $this->nmCharPattern = '[_a-z0-9-]|'.$this->escapePattern.'|'.$this->nonAsciiPattern;
- + $this->nmStartPattern = '[_a-z]|'.$this->escapePattern.'|'.$this->nonAsciiPattern;
- + $this->identifierPattern = '(?:'.$this->nmStartPattern.')(?:'.$this->nmCharPattern.')*';
- + $this->hashPattern = '#((?:'.$this->nmCharPattern.')+)';
- + $this->numberPattern = '[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)';
- + $this->quotedStringPattern = '([^\n\r\f%s]|'.$this->stringEscapePattern.')*';
- + }
- +
- + /**
- + * @return string
- + */
- + public function getNewLineEscapePattern()
- + {
- + return '~^'.$this->newLineEscapePattern.'~';
- + }
- +
- + /**
- + * @return string
- + */
- + public function getSimpleEscapePattern()
- + {
- + return '~^'.$this->simpleEscapePattern.'~';
- + }
- +
- + /**
- + * @return string
- + */
- + public function getUnicodeEscapePattern()
- + {
- + return '~^'.$this->unicodeEscapePattern.'~i';
- + }
- +
- + /**
- + * @return string
- + */
- + public function getIdentifierPattern()
- + {
- + return '~^'.$this->identifierPattern.'~i';
- + }
- +
- + /**
- + * @return string
- + */
- + public function getHashPattern()
- + {
- + return '~^'.$this->hashPattern.'~i';
- + }
- +
- + /**
- + * @return string
- + */
- + public function getNumberPattern()
- + {
- + return '~^'.$this->numberPattern.'~';
- + }
- +
- + /**
- + * @param string $quote
- + *
- + * @return string
- + */
- + public function getQuotedStringPattern($quote)
- + {
- + return '~^'.sprintf($this->quotedStringPattern, $quote).'~i';
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php 2014-11-19 15:54:13.968100023 +0100
- @@ -0,0 +1,78 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser\Tokenizer;
- +
- +use Symfony\Component\CssSelector\Parser\Handler;
- +use Symfony\Component\CssSelector\Parser\Reader;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\TokenStream;
- +
- +/**
- + * CSS selector tokenizer.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class Tokenizer
- +{
- + /**
- + * @var Handler\HandlerInterface[]
- + */
- + private $handlers;
- +
- + /**
- + * Constructor.
- + */
- + public function __construct()
- + {
- + $patterns = new TokenizerPatterns();
- + $escaping = new TokenizerEscaping($patterns);
- +
- + $this->handlers = array(
- + new Handler\WhitespaceHandler(),
- + new Handler\IdentifierHandler($patterns, $escaping),
- + new Handler\HashHandler($patterns, $escaping),
- + new Handler\StringHandler($patterns, $escaping),
- + new Handler\NumberHandler($patterns),
- + new Handler\CommentHandler(),
- + );
- + }
- +
- + /**
- + * Tokenize selector source code.
- + *
- + * @param Reader $reader
- + *
- + * @return TokenStream
- + */
- + public function tokenize(Reader $reader)
- + {
- + $stream = new TokenStream();
- +
- + while (!$reader->isEOF()) {
- + foreach ($this->handlers as $handler) {
- + if ($handler->handle($reader, $stream)) {
- + continue 2;
- + }
- + }
- +
- + $stream->push(new Token(Token::TYPE_DELIMITER, $reader->getSubstring(1), $reader->getPosition()));
- + $reader->moveForward(1);
- + }
- +
- + return $stream
- + ->push(new Token(Token::TYPE_FILE_END, null, $reader->getPosition()))
- + ->freeze();
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Token.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Token.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Token.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Token.php 2014-11-19 15:54:11.568100008 +0100
- @@ -0,0 +1,160 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser;
- +
- +/**
- + * CSS selector token.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class Token
- +{
- + const TYPE_FILE_END = 'eof';
- + const TYPE_DELIMITER = 'delimiter';
- + const TYPE_WHITESPACE = 'whitespace';
- + const TYPE_IDENTIFIER = 'identifier';
- + const TYPE_HASH = 'hash';
- + const TYPE_NUMBER = 'number';
- + const TYPE_STRING = 'string';
- +
- + /**
- + * @var int
- + */
- + private $type;
- +
- + /**
- + * @var string
- + */
- + private $value;
- +
- + /**
- + * @var int
- + */
- + private $position;
- +
- + /**
- + * @param int $type
- + * @param string $value
- + * @param int $position
- + */
- + public function __construct($type, $value, $position)
- + {
- + $this->type = $type;
- + $this->value = $value;
- + $this->position = $position;
- + }
- +
- + /**
- + * @return int
- + */
- + public function getType()
- + {
- + return $this->type;
- + }
- +
- + /**
- + * @return string
- + */
- + public function getValue()
- + {
- + return $this->value;
- + }
- +
- + /**
- + * @return int
- + */
- + public function getPosition()
- + {
- + return $this->position;
- + }
- +
- + /**
- + * @return bool
- + */
- + public function isFileEnd()
- + {
- + return self::TYPE_FILE_END === $this->type;
- + }
- +
- + /**
- + * @param array $values
- + *
- + * @return bool
- + */
- + public function isDelimiter(array $values = array())
- + {
- + if (self::TYPE_DELIMITER !== $this->type) {
- + return false;
- + }
- +
- + if (empty($values)) {
- + return true;
- + }
- +
- + return in_array($this->value, $values);
- + }
- +
- + /**
- + * @return bool
- + */
- + public function isWhitespace()
- + {
- + return self::TYPE_WHITESPACE === $this->type;
- + }
- +
- + /**
- + * @return bool
- + */
- + public function isIdentifier()
- + {
- + return self::TYPE_IDENTIFIER === $this->type;
- + }
- +
- + /**
- + * @return bool
- + */
- + public function isHash()
- + {
- + return self::TYPE_HASH === $this->type;
- + }
- +
- + /**
- + * @return bool
- + */
- + public function isNumber()
- + {
- + return self::TYPE_NUMBER === $this->type;
- + }
- +
- + /**
- + * @return bool
- + */
- + public function isString()
- + {
- + return self::TYPE_STRING === $this->type;
- + }
- +
- + /**
- + * @return string
- + */
- + public function __toString()
- + {
- + if ($this->value) {
- + return sprintf('<%s "%s" at %s>', $this->type, $this->value, $this->position);
- + }
- +
- + return sprintf('<%s at %s>', $this->type, $this->position);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/TokenStream.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/TokenStream.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/TokenStream.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/TokenStream.php 2014-11-19 15:54:13.164100018 +0100
- @@ -0,0 +1,182 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Parser;
- +
- +use Symfony\Component\CssSelector\Exception\InternalErrorException;
- +use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
- +
- +/**
- + * CSS selector token stream.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class TokenStream
- +{
- + /**
- + * @var Token[]
- + */
- + private $tokens = array();
- +
- + /**
- + * @var bool
- + */
- + private $frozen = false;
- +
- + /**
- + * @var Token[]
- + */
- + private $used = array();
- +
- + /**
- + * @var int
- + */
- + private $cursor = 0;
- +
- + /**
- + * @var Token|null
- + */
- + private $peeked = null;
- +
- + /**
- + * @var bool
- + */
- + private $peeking = false;
- +
- + /**
- + * Pushes a token.
- + *
- + * @param Token $token
- + *
- + * @return TokenStream
- + */
- + public function push(Token $token)
- + {
- + $this->tokens[] = $token;
- +
- + return $this;
- + }
- +
- + /**
- + * Freezes stream.
- + *
- + * @return TokenStream
- + */
- + public function freeze()
- + {
- + $this->frozen = true;
- +
- + return $this;
- + }
- +
- + /**
- + * Returns next token.
- + *
- + * @throws InternalErrorException If there is no more token
- + *
- + * @return Token
- + */
- + public function getNext()
- + {
- + if ($this->peeking) {
- + $this->peeking = false;
- + $this->used[] = $this->peeked;
- +
- + return $this->peeked;
- + }
- +
- + if (!isset($this->tokens[$this->cursor])) {
- + throw new InternalErrorException('Unexpected token stream end.');
- + }
- +
- + return $this->tokens[$this->cursor ++];
- + }
- +
- + /**
- + * Returns peeked token.
- + *
- + * @return Token
- + */
- + public function getPeek()
- + {
- + if (!$this->peeking) {
- + $this->peeked = $this->getNext();
- + $this->peeking = true;
- + }
- +
- + return $this->peeked;
- + }
- +
- + /**
- + * Returns used tokens.
- + *
- + * @return Token[]
- + */
- + public function getUsed()
- + {
- + return $this->used;
- + }
- +
- + /**
- + * Returns nex identifier token.
- + *
- + * @throws SyntaxErrorException If next token is not an identifier
- + *
- + * @return string The identifier token value
- + */
- + public function getNextIdentifier()
- + {
- + $next = $this->getNext();
- +
- + if (!$next->isIdentifier()) {
- + throw SyntaxErrorException::unexpectedToken('identifier', $next);
- + }
- +
- + return $next->getValue();
- + }
- +
- + /**
- + * Returns nex identifier or star delimiter token.
- + *
- + * @throws SyntaxErrorException If next token is not an identifier or a star delimiter
- + *
- + * @return null|string The identifier token value or null if star found
- + */
- + public function getNextIdentifierOrStar()
- + {
- + $next = $this->getNext();
- +
- + if ($next->isIdentifier()) {
- + return $next->getValue();
- + }
- +
- + if ($next->isDelimiter(array('*'))) {
- + return;
- + }
- +
- + throw SyntaxErrorException::unexpectedToken('identifier or "*"', $next);
- + }
- +
- + /**
- + * Skips next whitespace if any.
- + */
- + public function skipWhitespace()
- + {
- + $peek = $this->getPeek();
- +
- + if ($peek->isWhitespace()) {
- + $this->getNext();
- + }
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/phpunit.xml.dist sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/phpunit.xml.dist
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/phpunit.xml.dist 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/phpunit.xml.dist 2014-11-19 15:54:15.572100032 +0100
- @@ -0,0 +1,25 @@
- +<?xml version="1.0" encoding="UTF-8"?>
- +
- +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- + xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
- + backupGlobals="false"
- + colors="true"
- + bootstrap="vendor/autoload.php"
- +>
- + <testsuites>
- + <testsuite name="Symfony CssSelector Component Test Suite">
- + <directory>./Tests/</directory>
- + </testsuite>
- + </testsuites>
- +
- + <filter>
- + <whitelist>
- + <directory>./</directory>
- + <exclude>
- + <directory>./Resources</directory>
- + <directory>./Tests</directory>
- + <directory>./vendor</directory>
- + </exclude>
- + </whitelist>
- + </filter>
- +</phpunit>
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/README.md sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/README.md
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/README.md 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/README.md 2014-11-19 15:54:15.732100033 +0100
- @@ -0,0 +1,48 @@
- +CssSelector Component
- +=====================
- +
- +CssSelector converts CSS selectors to XPath expressions.
- +
- +The component only goal is to convert CSS selectors to their XPath
- +equivalents:
- +
- +```php
- +use Symfony\Component\CssSelector\CssSelector;
- +
- +print CssSelector::toXPath('div.item > h4 > a');
- +```
- +
- +HTML and XML are different
- +--------------------------
- +
- +The `CssSelector` component comes with an `HTML` extension which is enabled by
- +default. If you need to use this component with `XML` documents, you have to
- +disable this `HTML` extension. That's because, `HTML` tag & attribute names
- +are always lower-cased, but case-sensitive in `XML`:
- +
- +```php
- +// disable `HTML` extension:
- +CssSelector::disableHtmlExtension();
- +
- +// re-enable `HTML` extension:
- +CssSelector::enableHtmlExtension();
- +```
- +
- +When the `HTML` extension is enabled, tag names are lower-cased, attribute
- +names are lower-cased, the following extra pseudo-classes are supported:
- +`checked`, `link`, `disabled`, `enabled`, `selected`, `invalid`, `hover`,
- +`visited`, and the `lang()` function is also added.
- +
- +Resources
- +---------
- +
- +This component is a port of the Python lxml library, which is copyright Infrae
- +and distributed under the BSD license.
- +
- +Current code is a port of https://github.com/SimonSapin/cssselect/releases/tag/v0.7.1
- +
- +You can run the unit tests with the following command:
- +
- + $ cd path/to/Symfony/Component/CssSelector/
- + $ composer.phar install
- + $ phpunit
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/CssSelectorTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/CssSelectorTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/CssSelectorTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/CssSelectorTest.php 2014-11-19 15:54:07.256099982 +0100
- @@ -0,0 +1,64 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests;
- +
- +use Symfony\Component\CssSelector\CssSelector;
- +
- +class CssSelectorTest extends \PHPUnit_Framework_TestCase
- +{
- + public function testCssToXPath()
- + {
- + $this->assertEquals('descendant-or-self::*', CssSelector::toXPath(''));
- + $this->assertEquals('descendant-or-self::h1', CssSelector::toXPath('h1'));
- + $this->assertEquals("descendant-or-self::h1[@id = 'foo']", CssSelector::toXPath('h1#foo'));
- + $this->assertEquals("descendant-or-self::h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", CssSelector::toXPath('h1.foo'));
- + $this->assertEquals('descendant-or-self::foo:h1', CssSelector::toXPath('foo|h1'));
- + }
- +
- + /** @dataProvider getCssToXPathWithoutPrefixTestData */
- + public function testCssToXPathWithoutPrefix($css, $xpath)
- + {
- + $this->assertEquals($xpath, CssSelector::toXPath($css, ''), '->parse() parses an input string and returns a node');
- + }
- +
- + public function testParseExceptions()
- + {
- + try {
- + CssSelector::toXPath('h1:');
- + $this->fail('->parse() throws an Exception if the css selector is not valid');
- + } catch (\Exception $e) {
- + $this->assertInstanceOf('\Symfony\Component\CssSelector\Exception\ParseException', $e, '->parse() throws an Exception if the css selector is not valid');
- + $this->assertEquals("Expected identifier, but <eof at 3> found.", $e->getMessage(), '->parse() throws an Exception if the css selector is not valid');
- + }
- + }
- +
- + public function getCssToXPathWithoutPrefixTestData()
- + {
- + return array(
- + array('h1', "h1"),
- + array('foo|h1', "foo:h1"),
- + array('h1, h2, h3', "h1 | h2 | h3"),
- + array('h1:nth-child(3n+1)', "*/*[name() = 'h1' and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"),
- + array('h1 > p', "h1/p"),
- + array('h1#foo', "h1[@id = 'foo']"),
- + array('h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
- + array('h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"),
- + array('h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"),
- + array('h1[class]', "h1[@class]"),
- + array('h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
- + array('h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"),
- + array('h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"),
- + array('div>.foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
- + array('div > .foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php 2014-11-19 15:54:05.656099972 +0100
- @@ -0,0 +1,32 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Node;
- +
- +use Symfony\Component\CssSelector\Node\NodeInterface;
- +
- +abstract class AbstractNodeTest extends \PHPUnit_Framework_TestCase
- +{
- + /** @dataProvider getToStringConversionTestData */
- + public function testToStringConversion(NodeInterface $node, $representation)
- + {
- + $this->assertEquals($representation, (string) $node);
- + }
- +
- + /** @dataProvider getSpecificityValueTestData */
- + public function testSpecificityValue(NodeInterface $node, $value)
- + {
- + $this->assertEquals($value, $node->getSpecificity()->getValue());
- + }
- +
- + abstract public function getToStringConversionTestData();
- + abstract public function getSpecificityValueTestData();
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php 2014-11-19 15:54:06.132099975 +0100
- @@ -0,0 +1,37 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Node;
- +
- +use Symfony\Component\CssSelector\Node\AttributeNode;
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +
- +class AttributeNodeTest extends AbstractNodeTest
- +{
- + public function getToStringConversionTestData()
- + {
- + return array(
- + array(new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 'Attribute[Element[*][attribute]]'),
- + array(new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), "Attribute[Element[*][attribute $= 'value']]"),
- + array(new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), "Attribute[Element[*][namespace|attribute $= 'value']]"),
- + );
- + }
- +
- + public function getSpecificityValueTestData()
- + {
- + return array(
- + array(new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 10),
- + array(new AttributeNode(new ElementNode(null, 'element'), null, 'attribute', 'exists', null), 11),
- + array(new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), 10),
- + array(new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), 10),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php 2014-11-19 15:54:05.812099973 +0100
- @@ -0,0 +1,33 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Node;
- +
- +use Symfony\Component\CssSelector\Node\ClassNode;
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +
- +class ClassNodeTest extends AbstractNodeTest
- +{
- + public function getToStringConversionTestData()
- + {
- + return array(
- + array(new ClassNode(new ElementNode(), 'class'), 'Class[Element[*].class]'),
- + );
- + }
- +
- + public function getSpecificityValueTestData()
- + {
- + return array(
- + array(new ClassNode(new ElementNode(), 'class'), 10),
- + array(new ClassNode(new ElementNode(null, 'element'), 'class'), 11),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php 2014-11-19 15:54:06.780099979 +0100
- @@ -0,0 +1,35 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Node;
- +
- +use Symfony\Component\CssSelector\Node\CombinedSelectorNode;
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +
- +class CombinedSelectorNodeTest extends AbstractNodeTest
- +{
- + public function getToStringConversionTestData()
- + {
- + return array(
- + array(new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 'CombinedSelector[Element[*] > Element[*]]'),
- + array(new CombinedSelectorNode(new ElementNode(), ' ', new ElementNode()), 'CombinedSelector[Element[*] <followed> Element[*]]'),
- + );
- + }
- +
- + public function getSpecificityValueTestData()
- + {
- + return array(
- + array(new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 0),
- + array(new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode()), 1),
- + array(new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode(null, 'element')), 2),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php 2014-11-19 15:54:07.096099981 +0100
- @@ -0,0 +1,35 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Node;
- +
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +
- +class ElementNodeTest extends AbstractNodeTest
- +{
- + public function getToStringConversionTestData()
- + {
- + return array(
- + array(new ElementNode(), 'Element[*]'),
- + array(new ElementNode(null, 'element'), 'Element[element]'),
- + array(new ElementNode('namespace', 'element'), 'Element[namespace|element]'),
- + );
- + }
- +
- + public function getSpecificityValueTestData()
- + {
- + return array(
- + array(new ElementNode(), 0),
- + array(new ElementNode(null, 'element'), 1),
- + array(new ElementNode('namespace', 'element'),1),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php 2014-11-19 15:54:06.620099978 +0100
- @@ -0,0 +1,47 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Node;
- +
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +use Symfony\Component\CssSelector\Node\FunctionNode;
- +use Symfony\Component\CssSelector\Parser\Token;
- +
- +class FunctionNodeTest extends AbstractNodeTest
- +{
- + public function getToStringConversionTestData()
- + {
- + return array(
- + array(new FunctionNode(new ElementNode(), 'function'), 'Function[Element[*]:function()]'),
- + array(new FunctionNode(new ElementNode(), 'function', array(
- + new Token(Token::TYPE_IDENTIFIER, 'value', 0),
- + )), "Function[Element[*]:function(['value'])]"),
- + array(new FunctionNode(new ElementNode(), 'function', array(
- + new Token(Token::TYPE_STRING, 'value1', 0),
- + new Token(Token::TYPE_NUMBER, 'value2', 0),
- + )), "Function[Element[*]:function(['value1', 'value2'])]"),
- + );
- + }
- +
- + public function getSpecificityValueTestData()
- + {
- + return array(
- + array(new FunctionNode(new ElementNode(), 'function'), 10),
- + array(new FunctionNode(new ElementNode(), 'function', array(
- + new Token(Token::TYPE_IDENTIFIER, 'value', 0),
- + )), 10),
- + array(new FunctionNode(new ElementNode(), 'function', array(
- + new Token(Token::TYPE_STRING, 'value1', 0),
- + new Token(Token::TYPE_NUMBER, 'value2', 0),
- + )), 10),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php 2014-11-19 15:54:05.972099974 +0100
- @@ -0,0 +1,33 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Node;
- +
- +use Symfony\Component\CssSelector\Node\HashNode;
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +
- +class HashNodeTest extends AbstractNodeTest
- +{
- + public function getToStringConversionTestData()
- + {
- + return array(
- + array(new HashNode(new ElementNode(), 'id'), 'Hash[Element[*]#id]'),
- + );
- + }
- +
- + public function getSpecificityValueTestData()
- + {
- + return array(
- + array(new HashNode(new ElementNode(), 'id'), 100),
- + array(new HashNode(new ElementNode(null, 'id'), 'class'), 101),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php 2014-11-19 15:54:05.496099971 +0100
- @@ -0,0 +1,33 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Node;
- +
- +use Symfony\Component\CssSelector\Node\ClassNode;
- +use Symfony\Component\CssSelector\Node\NegationNode;
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +
- +class NegationNodeTest extends AbstractNodeTest
- +{
- + public function getToStringConversionTestData()
- + {
- + return array(
- + array(new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 'Negation[Element[*]:not(Class[Element[*].class])]'),
- + );
- + }
- +
- + public function getSpecificityValueTestData()
- + {
- + return array(
- + array(new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 10),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php 2014-11-19 15:54:06.464099977 +0100
- @@ -0,0 +1,32 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Node;
- +
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +use Symfony\Component\CssSelector\Node\PseudoNode;
- +
- +class PseudoNodeTest extends AbstractNodeTest
- +{
- + public function getToStringConversionTestData()
- + {
- + return array(
- + array(new PseudoNode(new ElementNode(), 'pseudo'), 'Pseudo[Element[*]:pseudo]'),
- + );
- + }
- +
- + public function getSpecificityValueTestData()
- + {
- + return array(
- + array(new PseudoNode(new ElementNode(), 'pseudo'), 10),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php 2014-11-19 15:54:06.940099980 +0100
- @@ -0,0 +1,34 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Node;
- +
- +use Symfony\Component\CssSelector\Node\ElementNode;
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +
- +class SelectorNodeTest extends AbstractNodeTest
- +{
- + public function getToStringConversionTestData()
- + {
- + return array(
- + array(new SelectorNode(new ElementNode()), 'Selector[Element[*]]'),
- + array(new SelectorNode(new ElementNode(), 'pseudo'), 'Selector[Element[*]::pseudo]'),
- + );
- + }
- +
- + public function getSpecificityValueTestData()
- + {
- + return array(
- + array(new SelectorNode(new ElementNode()), 0),
- + array(new SelectorNode(new ElementNode(), 'pseudo'), 1),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php 2014-11-19 15:54:06.292099976 +0100
- @@ -0,0 +1,40 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Node;
- +
- +use Symfony\Component\CssSelector\Node\Specificity;
- +
- +class SpecificityTest extends \PHPUnit_Framework_TestCase
- +{
- + /** @dataProvider getValueTestData */
- + public function testValue(Specificity $specificity, $value)
- + {
- + $this->assertEquals($value, $specificity->getValue());
- + }
- +
- + /** @dataProvider getValueTestData */
- + public function testPlusValue(Specificity $specificity, $value)
- + {
- + $this->assertEquals($value + 123, $specificity->plus(new Specificity(1, 2, 3))->getValue());
- + }
- +
- + public function getValueTestData()
- + {
- + return array(
- + array(new Specificity(0, 0, 0), 0),
- + array(new Specificity(0, 0, 2), 2),
- + array(new Specificity(0, 3, 0), 30),
- + array(new Specificity(4, 0, 0), 400),
- + array(new Specificity(4, 3, 2), 432),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php 2014-11-19 15:54:03.416099959 +0100
- @@ -0,0 +1,67 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Reader;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\TokenStream;
- +
- +/**
- + * @author Jean-François Simon <contact@jfsimon.fr>
- + */
- +abstract class AbstractHandlerTest extends \PHPUnit_Framework_TestCase
- +{
- + /** @dataProvider getHandleValueTestData */
- + public function testHandleValue($value, Token $expectedToken, $remainingContent)
- + {
- + $reader = new Reader($value);
- + $stream = new TokenStream();
- +
- + $this->assertTrue($this->generateHandler()->handle($reader, $stream));
- + $this->assertEquals($expectedToken, $stream->getNext());
- + $this->assertRemainingContent($reader, $remainingContent);
- + }
- +
- + /** @dataProvider getDontHandleValueTestData */
- + public function testDontHandleValue($value)
- + {
- + $reader = new Reader($value);
- + $stream = new TokenStream();
- +
- + $this->assertFalse($this->generateHandler()->handle($reader, $stream));
- + $this->assertStreamEmpty($stream);
- + $this->assertRemainingContent($reader, $value);
- + }
- +
- + abstract public function getHandleValueTestData();
- + abstract public function getDontHandleValueTestData();
- + abstract protected function generateHandler();
- +
- + protected function assertStreamEmpty(TokenStream $stream)
- + {
- + $property = new \ReflectionProperty($stream, 'tokens');
- + $property->setAccessible(true);
- +
- + $this->assertEquals(array(), $property->getValue($stream));
- + }
- +
- + protected function assertRemainingContent(Reader $reader, $remainingContent)
- + {
- + if ('' === $remainingContent) {
- + $this->assertEquals(0, $reader->getRemainingLength());
- + $this->assertTrue($reader->isEOF());
- + } else {
- + $this->assertEquals(strlen($remainingContent), $reader->getRemainingLength());
- + $this->assertEquals(0, $reader->getOffset($remainingContent));
- + }
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php 2014-11-19 15:54:03.252099958 +0100
- @@ -0,0 +1,55 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Handler\CommentHandler;
- +use Symfony\Component\CssSelector\Parser\Reader;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\TokenStream;
- +
- +class CommentHandlerTest extends AbstractHandlerTest
- +{
- + /** @dataProvider getHandleValueTestData */
- + public function testHandleValue($value, Token $unusedArgument, $remainingContent)
- + {
- + $reader = new Reader($value);
- + $stream = new TokenStream();
- +
- + $this->assertTrue($this->generateHandler()->handle($reader, $stream));
- + // comments are ignored (not pushed as token in stream)
- + $this->assertStreamEmpty($stream);
- + $this->assertRemainingContent($reader, $remainingContent);
- + }
- +
- + public function getHandleValueTestData()
- + {
- + return array(
- + // 2nd argument only exists for inherited method compatibility
- + array('/* comment */', new Token(null, null, null), ''),
- + array('/* comment */foo', new Token(null, null, null), 'foo'),
- + );
- + }
- +
- + public function getDontHandleValueTestData()
- + {
- + return array(
- + array('>'),
- + array('+'),
- + array(' '),
- + );
- + }
- +
- + protected function generateHandler()
- + {
- + return new CommentHandler();
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php 2014-11-19 15:54:03.736099961 +0100
- @@ -0,0 +1,49 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Handler\HashHandler;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
- +
- +class HashHandlerTest extends AbstractHandlerTest
- +{
- + public function getHandleValueTestData()
- + {
- + return array(
- + array('#id', new Token(Token::TYPE_HASH, 'id', 0), ''),
- + array('#123', new Token(Token::TYPE_HASH, '123', 0), ''),
- +
- + array('#id.class', new Token(Token::TYPE_HASH, 'id', 0), '.class'),
- + array('#id element', new Token(Token::TYPE_HASH, 'id', 0), ' element'),
- + );
- + }
- +
- + public function getDontHandleValueTestData()
- + {
- + return array(
- + array('id'),
- + array('123'),
- + array('<'),
- + array('<'),
- + array('#'),
- + );
- + }
- +
- + protected function generateHandler()
- + {
- + $patterns = new TokenizerPatterns();
- +
- + return new HashHandler($patterns, new TokenizerEscaping($patterns));
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php 2014-11-19 15:54:03.092099957 +0100
- @@ -0,0 +1,49 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Handler\IdentifierHandler;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
- +
- +class IdentifierHandlerTest extends AbstractHandlerTest
- +{
- + public function getHandleValueTestData()
- + {
- + return array(
- + array('foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''),
- + array('foo|bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '|bar'),
- + array('foo.class', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '.class'),
- + array('foo[attr]', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '[attr]'),
- + array('foo bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ' bar'),
- + );
- + }
- +
- + public function getDontHandleValueTestData()
- + {
- + return array(
- + array('>'),
- + array('+'),
- + array(' '),
- + array('*|foo'),
- + array('/* comment */'),
- + );
- + }
- +
- + protected function generateHandler()
- + {
- + $patterns = new TokenizerPatterns();
- +
- + return new IdentifierHandler($patterns, new TokenizerEscaping($patterns));
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php 2014-11-19 15:54:03.576099960 +0100
- @@ -0,0 +1,50 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Handler\NumberHandler;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
- +
- +class NumberHandlerTest extends AbstractHandlerTest
- +{
- + public function getHandleValueTestData()
- + {
- + return array(
- + array('12', new Token(Token::TYPE_NUMBER, '12', 0), ''),
- + array('12.34', new Token(Token::TYPE_NUMBER, '12.34', 0), ''),
- + array('+12.34', new Token(Token::TYPE_NUMBER, '+12.34', 0), ''),
- + array('-12.34', new Token(Token::TYPE_NUMBER, '-12.34', 0), ''),
- +
- + array('12 arg', new Token(Token::TYPE_NUMBER, '12', 0), ' arg'),
- + array('12]', new Token(Token::TYPE_NUMBER, '12', 0), ']'),
- + );
- + }
- +
- + public function getDontHandleValueTestData()
- + {
- + return array(
- + array('hello'),
- + array('>'),
- + array('+'),
- + array(' '),
- + array('/* comment */'),
- + );
- + }
- +
- + protected function generateHandler()
- + {
- + $patterns = new TokenizerPatterns();
- +
- + return new NumberHandler($patterns);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php 2014-11-19 15:54:02.928099956 +0100
- @@ -0,0 +1,50 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Handler\StringHandler;
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
- +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
- +
- +class StringHandlerTest extends AbstractHandlerTest
- +{
- + public function getHandleValueTestData()
- + {
- + return array(
- + array('"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''),
- + array('"1"', new Token(Token::TYPE_STRING, '1', 1), ''),
- + array('" "', new Token(Token::TYPE_STRING, ' ', 1), ''),
- + array('""', new Token(Token::TYPE_STRING, '', 1), ''),
- + array("'hello'", new Token(Token::TYPE_STRING, 'hello', 1), ''),
- +
- + array("'foo'bar", new Token(Token::TYPE_STRING, 'foo', 1), 'bar'),
- + );
- + }
- +
- + public function getDontHandleValueTestData()
- + {
- + return array(
- + array('hello'),
- + array('>'),
- + array('1'),
- + array(' '),
- + );
- + }
- +
- + protected function generateHandler()
- + {
- + $patterns = new TokenizerPatterns();
- +
- + return new StringHandler($patterns, new TokenizerEscaping($patterns));
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php 2014-11-19 15:54:02.768099955 +0100
- @@ -0,0 +1,44 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
- +
- +use Symfony\Component\CssSelector\Parser\Handler\WhitespaceHandler;
- +use Symfony\Component\CssSelector\Parser\Token;
- +
- +class WhitespaceHandlerTest extends AbstractHandlerTest
- +{
- + public function getHandleValueTestData()
- + {
- + return array(
- + array(' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''),
- + array("\n", new Token(Token::TYPE_WHITESPACE, "\n", 0), ''),
- + array("\t", new Token(Token::TYPE_WHITESPACE, "\t", 0), ''),
- +
- + array(' foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), 'foo'),
- + array(' .foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), '.foo'),
- + );
- + }
- +
- + public function getDontHandleValueTestData()
- + {
- + return array(
- + array('>'),
- + array('1'),
- + array('a'),
- + );
- + }
- +
- + protected function generateHandler()
- + {
- + return new WhitespaceHandler();
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php 2014-11-19 15:54:02.292099952 +0100
- @@ -0,0 +1,248 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser;
- +
- +use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
- +use Symfony\Component\CssSelector\Node\FunctionNode;
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +use Symfony\Component\CssSelector\Parser\Parser;
- +use Symfony\Component\CssSelector\Parser\Token;
- +
- +class ParserTest extends \PHPUnit_Framework_TestCase
- +{
- + /** @dataProvider getParserTestData */
- + public function testParser($source, $representation)
- + {
- + $parser = new Parser();
- +
- + $this->assertEquals($representation, array_map(function (SelectorNode $node) {
- + return (string) $node->getTree();
- + }, $parser->parse($source)));
- + }
- +
- + /** @dataProvider getParserExceptionTestData */
- + public function testParserException($source, $message)
- + {
- + $parser = new Parser();
- +
- + try {
- + $parser->parse($source);
- + $this->fail('Parser should throw a SyntaxErrorException.');
- + } catch (SyntaxErrorException $e) {
- + $this->assertEquals($message, $e->getMessage());
- + }
- + }
- +
- + /** @dataProvider getPseudoElementsTestData */
- + public function testPseudoElements($source, $element, $pseudo)
- + {
- + $parser = new Parser();
- + $selectors = $parser->parse($source);
- + $this->assertCount(1, $selectors);
- +
- + /** @var SelectorNode $selector */
- + $selector = $selectors[0];
- + $this->assertEquals($element, (string) $selector->getTree());
- + $this->assertEquals($pseudo, (string) $selector->getPseudoElement());
- + }
- +
- + /** @dataProvider getSpecificityTestData */
- + public function testSpecificity($source, $value)
- + {
- + $parser = new Parser();
- + $selectors = $parser->parse($source);
- + $this->assertCount(1, $selectors);
- +
- + /** @var SelectorNode $selector */
- + $selector = $selectors[0];
- + $this->assertEquals($value, $selector->getSpecificity()->getValue());
- + }
- +
- + /** @dataProvider getParseSeriesTestData */
- + public function testParseSeries($series, $a, $b)
- + {
- + $parser = new Parser();
- + $selectors = $parser->parse(sprintf(':nth-child(%s)', $series));
- + $this->assertCount(1, $selectors);
- +
- + /** @var FunctionNode $function */
- + $function = $selectors[0]->getTree();
- + $this->assertEquals(array($a, $b), Parser::parseSeries($function->getArguments()));
- + }
- +
- + /** @dataProvider getParseSeriesExceptionTestData */
- + public function testParseSeriesException($series)
- + {
- + $parser = new Parser();
- + $selectors = $parser->parse(sprintf(':nth-child(%s)', $series));
- + $this->assertCount(1, $selectors);
- +
- + /** @var FunctionNode $function */
- + $function = $selectors[0]->getTree();
- + $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
- + Parser::parseSeries($function->getArguments());
- + }
- +
- + public function getParserTestData()
- + {
- + return array(
- + array('*', array('Element[*]')),
- + array('*|*', array('Element[*]')),
- + array('*|foo', array('Element[foo]')),
- + array('foo|*', array('Element[foo|*]')),
- + array('foo|bar', array('Element[foo|bar]')),
- + array('#foo#bar', array('Hash[Hash[Element[*]#foo]#bar]')),
- + array('div>.foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')),
- + array('div> .foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')),
- + array('div >.foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')),
- + array('div > .foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')),
- + array("div \n> \t \t .foo", array('CombinedSelector[Element[div] > Class[Element[*].foo]]')),
- + array('td.foo,.bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
- + array('td.foo, .bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
- + array("td.foo\t\r\n\f ,\t\r\n\f .bar", array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
- + array('td.foo,.bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
- + array('td.foo, .bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
- + array("td.foo\t\r\n\f ,\t\r\n\f .bar", array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
- + array('div, td.foo, div.bar span', array('Element[div]', 'Class[Element[td].foo]', 'CombinedSelector[Class[Element[div].bar] <followed> Element[span]]')),
- + array('div > p', array('CombinedSelector[Element[div] > Element[p]]')),
- + array('td:first', array('Pseudo[Element[td]:first]')),
- + array('td :first', array('CombinedSelector[Element[td] <followed> Pseudo[Element[*]:first]]')),
- + array('a[name]', array('Attribute[Element[a][name]]')),
- + array("a[ name\t]", array('Attribute[Element[a][name]]')),
- + array('a [name]', array('CombinedSelector[Element[a] <followed> Attribute[Element[*][name]]]')),
- + array('a[rel="include"]', array("Attribute[Element[a][rel = 'include']]")),
- + array('a[rel = include]', array("Attribute[Element[a][rel = 'include']]")),
- + array("a[hreflang |= 'en']", array("Attribute[Element[a][hreflang |= 'en']]")),
- + array('a[hreflang|=en]', array("Attribute[Element[a][hreflang |= 'en']]")),
- + array('div:nth-child(10)', array("Function[Element[div]:nth-child(['10'])]")),
- + array(':nth-child(2n+2)', array("Function[Element[*]:nth-child(['2', 'n', '+2'])]")),
- + array('div:nth-of-type(10)', array("Function[Element[div]:nth-of-type(['10'])]")),
- + array('div div:nth-of-type(10) .aclass', array("CombinedSelector[CombinedSelector[Element[div] <followed> Function[Element[div]:nth-of-type(['10'])]] <followed> Class[Element[*].aclass]]")),
- + array('label:only', array('Pseudo[Element[label]:only]')),
- + array('a:lang(fr)', array("Function[Element[a]:lang(['fr'])]")),
- + array('div:contains("foo")', array("Function[Element[div]:contains(['foo'])]")),
- + array('div#foobar', array('Hash[Element[div]#foobar]')),
- + array('div:not(div.foo)', array('Negation[Element[div]:not(Class[Element[div].foo])]')),
- + array('td ~ th', array('CombinedSelector[Element[td] ~ Element[th]]')),
- + array('.foo[data-bar][data-baz=0]', array("Attribute[Attribute[Class[Element[*].foo][data-bar]][data-baz = '0']]")),
- + );
- + }
- +
- + public function getParserExceptionTestData()
- + {
- + return array(
- + array('attributes(href)/html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()),
- + array('attributes(href)', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()),
- + array('html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '/', 4))->getMessage()),
- + array(' ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 1))->getMessage()),
- + array('div, ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 5))->getMessage()),
- + array(' , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 1))->getMessage()),
- + array('p, , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 3))->getMessage()),
- + array('div > ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 6))->getMessage()),
- + array(' > div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '>', 2))->getMessage()),
- + array('foo|#bar', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_HASH, 'bar', 4))->getMessage()),
- + array('#.foo', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '#', 0))->getMessage()),
- + array('.#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()),
- + array(':#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()),
- + array('[*]', SyntaxErrorException::unexpectedToken('"|"', new Token(Token::TYPE_DELIMITER, ']', 2))->getMessage()),
- + array('[foo|]', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_DELIMITER, ']', 5))->getMessage()),
- + array('[#]', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_DELIMITER, '#', 1))->getMessage()),
- + array('[foo=#]', SyntaxErrorException::unexpectedToken('string or identifier', new Token(Token::TYPE_DELIMITER, '#', 5))->getMessage()),
- + array(':nth-child()', SyntaxErrorException::unexpectedToken('at least one argument', new Token(Token::TYPE_DELIMITER, ')', 11))->getMessage()),
- + array('[href]a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_IDENTIFIER, 'a', 6))->getMessage()),
- + array('[rel:stylesheet]', SyntaxErrorException::unexpectedToken('operator', new Token(Token::TYPE_DELIMITER, ':', 4))->getMessage()),
- + array('[rel=stylesheet', SyntaxErrorException::unexpectedToken('"]"', new Token(Token::TYPE_FILE_END, '', 15))->getMessage()),
- + array(':lang(fr', SyntaxErrorException::unexpectedToken('an argument', new Token(Token::TYPE_FILE_END, '', 8))->getMessage()),
- + array(':contains("foo', SyntaxErrorException::unclosedString(10)->getMessage()),
- + array('foo!', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '!', 3))->getMessage()),
- + );
- + }
- +
- + public function getPseudoElementsTestData()
- + {
- + return array(
- + array('foo', 'Element[foo]', ''),
- + array('*', 'Element[*]', ''),
- + array(':empty', 'Pseudo[Element[*]:empty]', ''),
- + array(':BEfore', 'Element[*]', 'before'),
- + array(':aftER', 'Element[*]', 'after'),
- + array(':First-Line', 'Element[*]', 'first-line'),
- + array(':First-Letter', 'Element[*]', 'first-letter'),
- + array('::befoRE', 'Element[*]', 'before'),
- + array('::AFter', 'Element[*]', 'after'),
- + array('::firsT-linE', 'Element[*]', 'first-line'),
- + array('::firsT-letteR', 'Element[*]', 'first-letter'),
- + array('::Selection', 'Element[*]', 'selection'),
- + array('foo:after', 'Element[foo]', 'after'),
- + array('foo::selection', 'Element[foo]', 'selection'),
- + array('lorem#ipsum ~ a#b.c[href]:empty::selection', 'CombinedSelector[Hash[Element[lorem]#ipsum] ~ Pseudo[Attribute[Class[Hash[Element[a]#b].c][href]]:empty]]', 'selection'),
- + );
- + }
- +
- + public function getSpecificityTestData()
- + {
- + return array(
- + array('*', 0),
- + array(' foo', 1),
- + array(':empty ', 10),
- + array(':before', 1),
- + array('*:before', 1),
- + array(':nth-child(2)', 10),
- + array('.bar', 10),
- + array('[baz]', 10),
- + array('[baz="4"]', 10),
- + array('[baz^="4"]', 10),
- + array('#lipsum', 100),
- + array(':not(*)', 0),
- + array(':not(foo)', 1),
- + array(':not(.foo)', 10),
- + array(':not([foo])', 10),
- + array(':not(:empty)', 10),
- + array(':not(#foo)', 100),
- + array('foo:empty', 11),
- + array('foo:before', 2),
- + array('foo::before', 2),
- + array('foo:empty::before', 12),
- + array('#lorem + foo#ipsum:first-child > bar:first-line', 213),
- + );
- + }
- +
- + public function getParseSeriesTestData()
- + {
- + return array(
- + array('1n+3', 1, 3),
- + array('1n +3', 1, 3),
- + array('1n + 3', 1, 3),
- + array('1n+ 3', 1, 3),
- + array('1n-3', 1, -3),
- + array('1n -3', 1, -3),
- + array('1n - 3', 1, -3),
- + array('1n- 3', 1, -3),
- + array('n-5', 1, -5),
- + array('odd', 2, 1),
- + array('even', 2, 0),
- + array('3n', 3, 0),
- + array('n', 1, 0),
- + array('+n', 1, 0),
- + array('-n', -1, 0),
- + array('5', 0, 5),
- + );
- + }
- +
- + public function getParseSeriesExceptionTestData()
- + {
- + return array(
- + array('foo'),
- + array('n+'),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php 2014-11-19 15:54:04.860099968 +0100
- @@ -0,0 +1,101 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser;
- +
- +use Symfony\Component\CssSelector\Parser\Reader;
- +
- +class ReaderTest extends \PHPUnit_Framework_TestCase
- +{
- + public function testIsEOF()
- + {
- + $reader = new Reader('');
- + $this->assertTrue($reader->isEOF());
- +
- + $reader = new Reader('hello');
- + $this->assertFalse($reader->isEOF());
- +
- + $this->assignPosition($reader, 2);
- + $this->assertFalse($reader->isEOF());
- +
- + $this->assignPosition($reader, 5);
- + $this->assertTrue($reader->isEOF());
- + }
- +
- + public function testGetRemainingLength()
- + {
- + $reader = new Reader('hello');
- + $this->assertEquals(5, $reader->getRemainingLength());
- +
- + $this->assignPosition($reader, 2);
- + $this->assertEquals(3, $reader->getRemainingLength());
- +
- + $this->assignPosition($reader, 5);
- + $this->assertEquals(0, $reader->getRemainingLength());
- + }
- +
- + public function testGetSubstring()
- + {
- + $reader = new Reader('hello');
- + $this->assertEquals('he', $reader->getSubstring(2));
- + $this->assertEquals('el', $reader->getSubstring(2, 1));
- +
- + $this->assignPosition($reader, 2);
- + $this->assertEquals('ll', $reader->getSubstring(2));
- + $this->assertEquals('lo', $reader->getSubstring(2, 1));
- + }
- +
- + public function testGetOffset()
- + {
- + $reader = new Reader('hello');
- + $this->assertEquals(2, $reader->getOffset('ll'));
- + $this->assertFalse($reader->getOffset('w'));
- +
- + $this->assignPosition($reader, 2);
- + $this->assertEquals(0, $reader->getOffset('ll'));
- + $this->assertFalse($reader->getOffset('he'));
- + }
- +
- + public function testFindPattern()
- + {
- + $reader = new Reader('hello');
- +
- + $this->assertFalse($reader->findPattern('/world/'));
- + $this->assertEquals(array('hello', 'h'), $reader->findPattern('/^([a-z]).*/'));
- +
- + $this->assignPosition($reader, 2);
- + $this->assertFalse($reader->findPattern('/^h.*/'));
- + $this->assertEquals(array('llo'), $reader->findPattern('/^llo$/'));
- + }
- +
- + public function testMoveForward()
- + {
- + $reader = new Reader('hello');
- + $this->assertEquals(0, $reader->getPosition());
- +
- + $reader->moveForward(2);
- + $this->assertEquals(2, $reader->getPosition());
- + }
- +
- + public function testToEnd()
- + {
- + $reader = new Reader('hello');
- + $reader->moveToEnd();
- + $this->assertTrue($reader->isEOF());
- + }
- +
- + private function assignPosition(Reader $reader, $value)
- + {
- + $position = new \ReflectionProperty($reader, 'position');
- + $position->setAccessible(true);
- + $position->setValue($reader, $value);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php 2014-11-19 15:54:04.696099967 +0100
- @@ -0,0 +1,44 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
- +
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +use Symfony\Component\CssSelector\Parser\Shortcut\ClassParser;
- +
- +/**
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class ClassParserTest extends \PHPUnit_Framework_TestCase
- +{
- + /** @dataProvider getParseTestData */
- + public function testParse($source, $representation)
- + {
- + $parser = new ClassParser();
- + $selectors = $parser->parse($source);
- + $this->assertCount(1, $selectors);
- +
- + /** @var SelectorNode $selector */
- + $selector = $selectors[0];
- + $this->assertEquals($representation, (string) $selector->getTree());
- + }
- +
- + public function getParseTestData()
- + {
- + return array(
- + array('.testclass', 'Class[Element[*].testclass]'),
- + array('testel.testclass', 'Class[Element[testel].testclass]'),
- + array('testns|.testclass', 'Class[Element[testns|*].testclass]'),
- + array('testns|*.testclass', 'Class[Element[testns|*].testclass]'),
- + array('testns|testel.testclass', 'Class[Element[testns|testel].testclass]'),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php 2014-11-19 15:54:04.216099964 +0100
- @@ -0,0 +1,43 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
- +
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +use Symfony\Component\CssSelector\Parser\Shortcut\ElementParser;
- +
- +/**
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class ElementParserTest extends \PHPUnit_Framework_TestCase
- +{
- + /** @dataProvider getParseTestData */
- + public function testParse($source, $representation)
- + {
- + $parser = new ElementParser();
- + $selectors = $parser->parse($source);
- + $this->assertCount(1, $selectors);
- +
- + /** @var SelectorNode $selector */
- + $selector = $selectors[0];
- + $this->assertEquals($representation, (string) $selector->getTree());
- + }
- +
- + public function getParseTestData()
- + {
- + return array(
- + array('*', 'Element[*]'),
- + array('testel', 'Element[testel]'),
- + array('testns|*', 'Element[testns|*]'),
- + array('testns|testel', 'Element[testns|testel]'),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php 2014-11-19 15:54:04.536099966 +0100
- @@ -0,0 +1,35 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
- +
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser;
- +
- +/**
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class EmptyStringParserTest extends \PHPUnit_Framework_TestCase
- +{
- + public function testParse()
- + {
- + $parser = new EmptyStringParser();
- + $selectors = $parser->parse('');
- + $this->assertCount(1, $selectors);
- +
- + /** @var SelectorNode $selector */
- + $selector = $selectors[0];
- + $this->assertEquals('Element[*]', (string) $selector->getTree());
- +
- + $selectors = $parser->parse('this will produce an empty array');
- + $this->assertCount(0, $selectors);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php 2014-11-19 15:54:04.376099965 +0100
- @@ -0,0 +1,44 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
- +
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +use Symfony\Component\CssSelector\Parser\Shortcut\HashParser;
- +
- +/**
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class HashParserTest extends \PHPUnit_Framework_TestCase
- +{
- + /** @dataProvider getParseTestData */
- + public function testParse($source, $representation)
- + {
- + $parser = new HashParser();
- + $selectors = $parser->parse($source);
- + $this->assertCount(1, $selectors);
- +
- + /** @var SelectorNode $selector */
- + $selector = $selectors[0];
- + $this->assertEquals($representation, (string) $selector->getTree());
- + }
- +
- + public function getParseTestData()
- + {
- + return array(
- + array('#testid', 'Hash[Element[*]#testid]'),
- + array('testel#testid', 'Hash[Element[testel]#testid]'),
- + array('testns|#testid', 'Hash[Element[testns|*]#testid]'),
- + array('testns|*#testid', 'Hash[Element[testns|*]#testid]'),
- + array('testns|testel#testid', 'Hash[Element[testns|testel]#testid]'),
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php 2014-11-19 15:54:05.020099969 +0100
- @@ -0,0 +1,95 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\Parser;
- +
- +use Symfony\Component\CssSelector\Parser\Token;
- +use Symfony\Component\CssSelector\Parser\TokenStream;
- +
- +class TokenStreamTest extends \PHPUnit_Framework_TestCase
- +{
- + public function testGetNext()
- + {
- + $stream = new TokenStream();
- + $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
- + $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2));
- + $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3));
- +
- + $this->assertSame($t1, $stream->getNext());
- + $this->assertSame($t2, $stream->getNext());
- + $this->assertSame($t3, $stream->getNext());
- + }
- +
- + public function testGetPeek()
- + {
- + $stream = new TokenStream();
- + $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
- + $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2));
- + $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3));
- +
- + $this->assertSame($t1, $stream->getPeek());
- + $this->assertSame($t1, $stream->getNext());
- + $this->assertSame($t2, $stream->getPeek());
- + $this->assertSame($t2, $stream->getPeek());
- + $this->assertSame($t2, $stream->getNext());
- + }
- +
- + public function testGetNextIdentifier()
- + {
- + $stream = new TokenStream();
- + $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
- +
- + $this->assertEquals('h1', $stream->getNextIdentifier());
- + }
- +
- + public function testFailToGetNextIdentifier()
- + {
- + $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
- +
- + $stream = new TokenStream();
- + $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2));
- + $stream->getNextIdentifier();
- + }
- +
- + public function testGetNextIdentifierOrStar()
- + {
- + $stream = new TokenStream();
- +
- + $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
- + $this->assertEquals('h1', $stream->getNextIdentifierOrStar());
- +
- + $stream->push(new Token(Token::TYPE_DELIMITER, '*', 0));
- + $this->assertNull($stream->getNextIdentifierOrStar());
- + }
- +
- + public function testFailToGetNextIdentifierOrStar()
- + {
- + $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
- +
- + $stream = new TokenStream();
- + $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2));
- + $stream->getNextIdentifierOrStar();
- + }
- +
- + public function testSkipWhitespace()
- + {
- + $stream = new TokenStream();
- + $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
- + $stream->push($t2 = new Token(Token::TYPE_WHITESPACE, ' ', 2));
- + $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'h1', 3));
- +
- + $stream->skipWhitespace();
- + $this->assertSame($t1, $stream->getNext());
- +
- + $stream->skipWhitespace();
- + $this->assertSame($t3, $stream->getNext());
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html 2014-11-19 15:54:01.220099946 +0100
- @@ -0,0 +1,48 @@
- +<html id="html"><head>
- + <link id="link-href" href="foo" />
- + <link id="link-nohref" />
- +</head><body>
- +<div id="outer-div">
- + <a id="name-anchor" name="foo"></a>
- + <a id="tag-anchor" rel="tag" href="http://localhost/foo">link</a>
- + <a id="nofollow-anchor" rel="nofollow" href="https://example.org">
- + link</a>
- + <ol id="first-ol" class="a b c">
- + <li id="first-li">content</li>
- + <li id="second-li" lang="En-us">
- + <div id="li-div">
- + </div>
- + </li>
- + <li id="third-li" class="ab c"></li>
- + <li id="fourth-li" class="ab
- +c"></li>
- + <li id="fifth-li"></li>
- + <li id="sixth-li"></li>
- + <li id="seventh-li"> </li>
- + </ol>
- + <p id="paragraph">
- + <b id="p-b">hi</b> <em id="p-em">there</em>
- + <b id="p-b2">guy</b>
- + <input type="checkbox" id="checkbox-unchecked" />
- + <input type="checkbox" id="checkbox-disabled" disabled="" />
- + <input type="text" id="text-checked" checked="checked" />
- + <input type="hidden" />
- + <input type="hidden" disabled="disabled" />
- + <input type="checkbox" id="checkbox-checked" checked="checked" />
- + <input type="checkbox" id="checkbox-disabled-checked"
- + disabled="disabled" checked="checked" />
- + <fieldset id="fieldset" disabled="disabled">
- + <input type="checkbox" id="checkbox-fieldset-disabled" />
- + <input type="hidden" />
- + </fieldset>
- + </p>
- + <ol id="second-ol">
- + </ol>
- + <map name="dummymap">
- + <area shape="circle" coords="200,250,25" href="foo.html" id="area-href" />
- + <area shape="default" id="area-nohref" />
- + </map>
- +</div>
- +<div id="foobar-div" foobar="ab bc
- +cde"><span id="foobar-span"></span></div>
- +</body></html>
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml 2014-11-19 15:54:01.384099947 +0100
- @@ -0,0 +1,11 @@
- +<test>
- + <a id="first" xml:lang="en">a</a>
- + <b id="second" xml:lang="en-US">b</b>
- + <c id="third" xml:lang="en-Nz">c</c>
- + <d id="fourth" xml:lang="En-us">d</d>
- + <e id="fifth" xml:lang="fr">e</e>
- + <f id="sixth" xml:lang="ru">f</f>
- + <g id="seventh" xml:lang="de">
- + <h id="eighth" xml:lang="zh"/>
- + </g>
- +</test>
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html 2014-11-19 15:54:01.604099948 +0100
- @@ -0,0 +1,308 @@
- +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" debug="true">
- +<head>
- + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- +</head>
- +<body>
- + <div id="test">
- + <div class="dialog">
- + <h2>As You Like It</h2>
- + <div id="playwright">
- + by William Shakespeare
- + </div>
- + <div class="dialog scene thirdClass" id="scene1">
- + <h3>ACT I, SCENE III. A room in the palace.</h3>
- + <div class="dialog">
- + <div class="direction">Enter CELIA and ROSALIND</div>
- + </div>
- + <div id="speech1" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.1">Why, cousin! why, Rosalind! Cupid have mercy! not a word?</div>
- + </div>
- + <div id="speech2" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.2">Not one to throw at a dog.</div>
- + </div>
- + <div id="speech3" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.3">No, thy words are too precious to be cast away upon</div>
- + <div id="scene1.3.4">curs; throw some of them at me; come, lame me with reasons.</div>
- + </div>
- + <div id="speech4" class="character">ROSALIND</div>
- + <div id="speech5" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.8">But is all this for your father?</div>
- + </div>
- + <div class="dialog">
- + <div id="scene1.3.5">Then there were two cousins laid up; when the one</div>
- + <div id="scene1.3.6">should be lamed with reasons and the other mad</div>
- + <div id="scene1.3.7">without any.</div>
- + </div>
- + <div id="speech6" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.9">No, some of it is for my child's father. O, how</div>
- + <div id="scene1.3.10">full of briers is this working-day world!</div>
- + </div>
- + <div id="speech7" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.11">They are but burs, cousin, thrown upon thee in</div>
- + <div id="scene1.3.12">holiday foolery: if we walk not in the trodden</div>
- + <div id="scene1.3.13">paths our very petticoats will catch them.</div>
- + </div>
- + <div id="speech8" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.14">I could shake them off my coat: these burs are in my heart.</div>
- + </div>
- + <div id="speech9" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.15">Hem them away.</div>
- + </div>
- + <div id="speech10" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.16">I would try, if I could cry 'hem' and have him.</div>
- + </div>
- + <div id="speech11" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.17">Come, come, wrestle with thy affections.</div>
- + </div>
- + <div id="speech12" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.18">O, they take the part of a better wrestler than myself!</div>
- + </div>
- + <div id="speech13" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.19">O, a good wish upon you! you will try in time, in</div>
- + <div id="scene1.3.20">despite of a fall. But, turning these jests out of</div>
- + <div id="scene1.3.21">service, let us talk in good earnest: is it</div>
- + <div id="scene1.3.22">possible, on such a sudden, you should fall into so</div>
- + <div id="scene1.3.23">strong a liking with old Sir Rowland's youngest son?</div>
- + </div>
- + <div id="speech14" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.24">The duke my father loved his father dearly.</div>
- + </div>
- + <div id="speech15" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.25">Doth it therefore ensue that you should love his son</div>
- + <div id="scene1.3.26">dearly? By this kind of chase, I should hate him,</div>
- + <div id="scene1.3.27">for my father hated his father dearly; yet I hate</div>
- + <div id="scene1.3.28">not Orlando.</div>
- + </div>
- + <div id="speech16" class="character">ROSALIND</div>
- + <div title="wtf" class="dialog">
- + <div id="scene1.3.29">No, faith, hate him not, for my sake.</div>
- + </div>
- + <div id="speech17" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.30">Why should I not? doth he not deserve well?</div>
- + </div>
- + <div id="speech18" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.31">Let me love him for that, and do you love him</div>
- + <div id="scene1.3.32">because I do. Look, here comes the duke.</div>
- + </div>
- + <div id="speech19" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.33">With his eyes full of anger.</div>
- + <div class="direction">Enter DUKE FREDERICK, with Lords</div>
- + </div>
- + <div id="speech20" class="character">DUKE FREDERICK</div>
- + <div class="dialog">
- + <div id="scene1.3.34">Mistress, dispatch you with your safest haste</div>
- + <div id="scene1.3.35">And get you from our court.</div>
- + </div>
- + <div id="speech21" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.36">Me, uncle?</div>
- + </div>
- + <div id="speech22" class="character">DUKE FREDERICK</div>
- + <div class="dialog">
- + <div id="scene1.3.37">You, cousin</div>
- + <div id="scene1.3.38">Within these ten days if that thou be'st found</div>
- + <div id="scene1.3.39">So near our public court as twenty miles,</div>
- + <div id="scene1.3.40">Thou diest for it.</div>
- + </div>
- + <div id="speech23" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.41"> I do beseech your grace,</div>
- + <div id="scene1.3.42">Let me the knowledge of my fault bear with me:</div>
- + <div id="scene1.3.43">If with myself I hold intelligence</div>
- + <div id="scene1.3.44">Or have acquaintance with mine own desires,</div>
- + <div id="scene1.3.45">If that I do not dream or be not frantic,--</div>
- + <div id="scene1.3.46">As I do trust I am not--then, dear uncle,</div>
- + <div id="scene1.3.47">Never so much as in a thought unborn</div>
- + <div id="scene1.3.48">Did I offend your highness.</div>
- + </div>
- + <div id="speech24" class="character">DUKE FREDERICK</div>
- + <div class="dialog">
- + <div id="scene1.3.49">Thus do all traitors:</div>
- + <div id="scene1.3.50">If their purgation did consist in words,</div>
- + <div id="scene1.3.51">They are as innocent as grace itself:</div>
- + <div id="scene1.3.52">Let it suffice thee that I trust thee not.</div>
- + </div>
- + <div id="speech25" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.53">Yet your mistrust cannot make me a traitor:</div>
- + <div id="scene1.3.54">Tell me whereon the likelihood depends.</div>
- + </div>
- + <div id="speech26" class="character">DUKE FREDERICK</div>
- + <div class="dialog">
- + <div id="scene1.3.55">Thou art thy father's daughter; there's enough.</div>
- + </div>
- + <div id="speech27" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.56">So was I when your highness took his dukedom;</div>
- + <div id="scene1.3.57">So was I when your highness banish'd him:</div>
- + <div id="scene1.3.58">Treason is not inherited, my lord;</div>
- + <div id="scene1.3.59">Or, if we did derive it from our friends,</div>
- + <div id="scene1.3.60">What's that to me? my father was no traitor:</div>
- + <div id="scene1.3.61">Then, good my liege, mistake me not so much</div>
- + <div id="scene1.3.62">To think my poverty is treacherous.</div>
- + </div>
- + <div id="speech28" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.63">Dear sovereign, hear me speak.</div>
- + </div>
- + <div id="speech29" class="character">DUKE FREDERICK</div>
- + <div class="dialog">
- + <div id="scene1.3.64">Ay, Celia; we stay'd her for your sake,</div>
- + <div id="scene1.3.65">Else had she with her father ranged along.</div>
- + </div>
- + <div id="speech30" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.66">I did not then entreat to have her stay;</div>
- + <div id="scene1.3.67">It was your pleasure and your own remorse:</div>
- + <div id="scene1.3.68">I was too young that time to value her;</div>
- + <div id="scene1.3.69">But now I know her: if she be a traitor,</div>
- + <div id="scene1.3.70">Why so am I; we still have slept together,</div>
- + <div id="scene1.3.71">Rose at an instant, learn'd, play'd, eat together,</div>
- + <div id="scene1.3.72">And wheresoever we went, like Juno's swans,</div>
- + <div id="scene1.3.73">Still we went coupled and inseparable.</div>
- + </div>
- + <div id="speech31" class="character">DUKE FREDERICK</div>
- + <div class="dialog">
- + <div id="scene1.3.74">She is too subtle for thee; and her smoothness,</div>
- + <div id="scene1.3.75">Her very silence and her patience</div>
- + <div id="scene1.3.76">Speak to the people, and they pity her.</div>
- + <div id="scene1.3.77">Thou art a fool: she robs thee of thy name;</div>
- + <div id="scene1.3.78">And thou wilt show more bright and seem more virtuous</div>
- + <div id="scene1.3.79">When she is gone. Then open not thy lips:</div>
- + <div id="scene1.3.80">Firm and irrevocable is my doom</div>
- + <div id="scene1.3.81">Which I have pass'd upon her; she is banish'd.</div>
- + </div>
- + <div id="speech32" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.82">Pronounce that sentence then on me, my liege:</div>
- + <div id="scene1.3.83">I cannot live out of her company.</div>
- + </div>
- + <div id="speech33" class="character">DUKE FREDERICK</div>
- + <div class="dialog">
- + <div id="scene1.3.84">You are a fool. You, niece, provide yourself:</div>
- + <div id="scene1.3.85">If you outstay the time, upon mine honour,</div>
- + <div id="scene1.3.86">And in the greatness of my word, you die.</div>
- + <div class="direction">Exeunt DUKE FREDERICK and Lords</div>
- + </div>
- + <div id="speech34" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.87">O my poor Rosalind, whither wilt thou go?</div>
- + <div id="scene1.3.88">Wilt thou change fathers? I will give thee mine.</div>
- + <div id="scene1.3.89">I charge thee, be not thou more grieved than I am.</div>
- + </div>
- + <div id="speech35" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.90">I have more cause.</div>
- + </div>
- + <div id="speech36" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.91"> Thou hast not, cousin;</div>
- + <div id="scene1.3.92">Prithee be cheerful: know'st thou not, the duke</div>
- + <div id="scene1.3.93">Hath banish'd me, his daughter?</div>
- + </div>
- + <div id="speech37" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.94">That he hath not.</div>
- + </div>
- + <div id="speech38" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.95">No, hath not? Rosalind lacks then the love</div>
- + <div id="scene1.3.96">Which teacheth thee that thou and I am one:</div>
- + <div id="scene1.3.97">Shall we be sunder'd? shall we part, sweet girl?</div>
- + <div id="scene1.3.98">No: let my father seek another heir.</div>
- + <div id="scene1.3.99">Therefore devise with me how we may fly,</div>
- + <div id="scene1.3.100">Whither to go and what to bear with us;</div>
- + <div id="scene1.3.101">And do not seek to take your change upon you,</div>
- + <div id="scene1.3.102">To bear your griefs yourself and leave me out;</div>
- + <div id="scene1.3.103">For, by this heaven, now at our sorrows pale,</div>
- + <div id="scene1.3.104">Say what thou canst, I'll go along with thee.</div>
- + </div>
- + <div id="speech39" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.105">Why, whither shall we go?</div>
- + </div>
- + <div id="speech40" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.106">To seek my uncle in the forest of Arden.</div>
- + </div>
- + <div id="speech41" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.107">Alas, what danger will it be to us,</div>
- + <div id="scene1.3.108">Maids as we are, to travel forth so far!</div>
- + <div id="scene1.3.109">Beauty provoketh thieves sooner than gold.</div>
- + </div>
- + <div id="speech42" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.110">I'll put myself in poor and mean attire</div>
- + <div id="scene1.3.111">And with a kind of umber smirch my face;</div>
- + <div id="scene1.3.112">The like do you: so shall we pass along</div>
- + <div id="scene1.3.113">And never stir assailants.</div>
- + </div>
- + <div id="speech43" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.114">Were it not better,</div>
- + <div id="scene1.3.115">Because that I am more than common tall,</div>
- + <div id="scene1.3.116">That I did suit me all points like a man?</div>
- + <div id="scene1.3.117">A gallant curtle-axe upon my thigh,</div>
- + <div id="scene1.3.118">A boar-spear in my hand; and--in my heart</div>
- + <div id="scene1.3.119">Lie there what hidden woman's fear there will--</div>
- + <div id="scene1.3.120">We'll have a swashing and a martial outside,</div>
- + <div id="scene1.3.121">As many other mannish cowards have</div>
- + <div id="scene1.3.122">That do outface it with their semblances.</div>
- + </div>
- + <div id="speech44" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.123">What shall I call thee when thou art a man?</div>
- + </div>
- + <div id="speech45" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.124">I'll have no worse a name than Jove's own page;</div>
- + <div id="scene1.3.125">And therefore look you call me Ganymede.</div>
- + <div id="scene1.3.126">But what will you be call'd?</div>
- + </div>
- + <div id="speech46" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.127">Something that hath a reference to my state</div>
- + <div id="scene1.3.128">No longer Celia, but Aliena.</div>
- + </div>
- + <div id="speech47" class="character">ROSALIND</div>
- + <div class="dialog">
- + <div id="scene1.3.129">But, cousin, what if we assay'd to steal</div>
- + <div id="scene1.3.130">The clownish fool out of your father's court?</div>
- + <div id="scene1.3.131">Would he not be a comfort to our travel?</div>
- + </div>
- + <div id="speech48" class="character">CELIA</div>
- + <div class="dialog">
- + <div id="scene1.3.132">He'll go along o'er the wide world with me;</div>
- + <div id="scene1.3.133">Leave me alone to woo him. Let's away,</div>
- + <div id="scene1.3.134">And get our jewels and our wealth together,</div>
- + <div id="scene1.3.135">Devise the fittest time and safest way</div>
- + <div id="scene1.3.136">To hide us from pursuit that will be made</div>
- + <div id="scene1.3.137">After my flight. Now go we in content</div>
- + <div id="scene1.3.138">To liberty and not to banishment.</div>
- + <div class="direction">Exeunt</div>
- + </div>
- + </div>
- + </div>
- +</div>
- +</body>
- +</html>
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php 2014-11-19 15:54:01.808099949 +0100
- @@ -0,0 +1,324 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\Tests\XPath;
- +
- +use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension;
- +use Symfony\Component\CssSelector\XPath\Translator;
- +
- +class TranslatorTest extends \PHPUnit_Framework_TestCase
- +{
- + /** @dataProvider getXpathLiteralTestData */
- + public function testXpathLiteral($value, $literal)
- + {
- + $this->assertEquals($literal, Translator::getXpathLiteral($value));
- + }
- +
- + /** @dataProvider getCssToXPathTestData */
- + public function testCssToXPath($css, $xpath)
- + {
- + $translator = new Translator();
- + $translator->registerExtension(new HtmlExtension($translator));
- + $this->assertEquals($xpath, $translator->cssToXPath($css, ''));
- + }
- +
- + /** @dataProvider getXmlLangTestData */
- + public function testXmlLang($css, array $elementsId)
- + {
- + $translator = new Translator();
- + $document = new \SimpleXMLElement(file_get_contents(__DIR__.'/Fixtures/lang.xml'));
- + $elements = $document->xpath($translator->cssToXPath($css));
- + $this->assertEquals(count($elementsId), count($elements));
- + foreach ($elements as $element) {
- + $this->assertTrue(in_array($element->attributes()->id, $elementsId));
- + }
- + }
- +
- + /** @dataProvider getHtmlIdsTestData */
- + public function testHtmlIds($css, array $elementsId)
- + {
- + $translator = new Translator();
- + $translator->registerExtension(new HtmlExtension($translator));
- + $document = new \DOMDocument();
- + $document->strictErrorChecking = false;
- + $internalErrors = libxml_use_internal_errors(true);
- + $document->loadHTMLFile(__DIR__.'/Fixtures/ids.html');
- + $document = simplexml_import_dom($document);
- + $elements = $document->xpath($translator->cssToXPath($css));
- + $this->assertCount(count($elementsId), $elementsId);
- + foreach ($elements as $element) {
- + if (null !== $element->attributes()->id) {
- + $this->assertTrue(in_array($element->attributes()->id, $elementsId));
- + }
- + }
- + libxml_clear_errors();
- + libxml_use_internal_errors($internalErrors);
- + }
- +
- + /** @dataProvider getHtmlShakespearTestData */
- + public function testHtmlShakespear($css, $count)
- + {
- + $translator = new Translator();
- + $translator->registerExtension(new HtmlExtension($translator));
- + $document = new \DOMDocument();
- + $document->strictErrorChecking = false;
- + $document->loadHTMLFile(__DIR__.'/Fixtures/shakespear.html');
- + $document = simplexml_import_dom($document);
- + $bodies = $document->xpath('//body');
- + $elements = $bodies[0]->xpath($translator->cssToXPath($css));
- + $this->assertEquals($count, count($elements));
- + }
- +
- + public function getXpathLiteralTestData()
- + {
- + return array(
- + array('foo', "'foo'"),
- + array("foo's bar", '"foo\'s bar"'),
- + array("foo's \"middle\" bar", 'concat(\'foo\', "\'", \'s "middle" bar\')'),
- + array("foo's 'middle' \"bar\"", 'concat(\'foo\', "\'", \'s \', "\'", \'middle\', "\'", \' "bar"\')'),
- + );
- + }
- +
- + public function getCssToXPathTestData()
- + {
- + return array(
- + array('*', "*"),
- + array('e', "e"),
- + array('*|e', "e"),
- + array('e|f', "e:f"),
- + array('e[foo]', "e[@foo]"),
- + array('e[foo|bar]', "e[@foo:bar]"),
- + array('e[foo="bar"]', "e[@foo = 'bar']"),
- + array('e[foo~="bar"]', "e[@foo and contains(concat(' ', normalize-space(@foo), ' '), ' bar ')]"),
- + array('e[foo^="bar"]', "e[@foo and starts-with(@foo, 'bar')]"),
- + array('e[foo$="bar"]', "e[@foo and substring(@foo, string-length(@foo)-2) = 'bar']"),
- + array('e[foo*="bar"]', "e[@foo and contains(@foo, 'bar')]"),
- + array('e[hreflang|="en"]', "e[@hreflang and (@hreflang = 'en' or starts-with(@hreflang, 'en-'))]"),
- + array('e:nth-child(1)', "*/*[name() = 'e' and (position() = 1)]"),
- + array('e:nth-last-child(1)', "*/*[name() = 'e' and (position() = last() - 0)]"),
- + array('e:nth-last-child(2n+2)', "*/*[name() = 'e' and (last() - position() - 1 >= 0 and (last() - position() - 1) mod 2 = 0)]"),
- + array('e:nth-of-type(1)', "*/e[position() = 1]"),
- + array('e:nth-last-of-type(1)', "*/e[position() = last() - 0]"),
- + array('div e:nth-last-of-type(1) .aclass', "div/descendant-or-self::*/e[position() = last() - 0]/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' aclass ')]"),
- + array('e:first-child', "*/*[name() = 'e' and (position() = 1)]"),
- + array('e:last-child', "*/*[name() = 'e' and (position() = last())]"),
- + array('e:first-of-type', "*/e[position() = 1]"),
- + array('e:last-of-type', "*/e[position() = last()]"),
- + array('e:only-child', "*/*[name() = 'e' and (last() = 1)]"),
- + array('e:only-of-type', "e[last() = 1]"),
- + array('e:empty', "e[not(*) and not(string-length())]"),
- + array('e:EmPTY', "e[not(*) and not(string-length())]"),
- + array('e:root', "e[not(parent::*)]"),
- + array('e:hover', "e[0]"),
- + array('e:contains("foo")', "e[contains(string(.), 'foo')]"),
- + array('e:ConTains(foo)', "e[contains(string(.), 'foo')]"),
- + array('e.warning', "e[@class and contains(concat(' ', normalize-space(@class), ' '), ' warning ')]"),
- + array('e#myid', "e[@id = 'myid']"),
- + array('e:not(:nth-child(odd))', "e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]"),
- + array('e:nOT(*)', "e[0]"),
- + array('e f', "e/descendant-or-self::*/f"),
- + array('e > f', "e/f"),
- + array('e + f', "e/following-sibling::*[name() = 'f' and (position() = 1)]"),
- + array('e ~ f', "e/following-sibling::f"),
- + array('div#container p', "div[@id = 'container']/descendant-or-self::*/p"),
- + );
- + }
- +
- + public function getXmlLangTestData()
- + {
- + return array(
- + array(':lang("EN")', array('first', 'second', 'third', 'fourth')),
- + array(':lang("en-us")', array('second', 'fourth')),
- + array(':lang(en-nz)', array('third')),
- + array(':lang(fr)', array('fifth')),
- + array(':lang(ru)', array('sixth')),
- + array(":lang('ZH')", array('eighth')),
- + array(':lang(de) :lang(zh)', array('eighth')),
- + array(':lang(en), :lang(zh)', array('first', 'second', 'third', 'fourth', 'eighth')),
- + array(':lang(es)', array()),
- + );
- + }
- +
- + public function getHtmlIdsTestData()
- + {
- + return array(
- + array('div', array('outer-div', 'li-div', 'foobar-div')),
- + array('DIV', array('outer-div', 'li-div', 'foobar-div')), // case-insensitive in HTML
- + array('div div', array('li-div')),
- + array('div, div div', array('outer-div', 'li-div', 'foobar-div')),
- + array('a[name]', array('name-anchor')),
- + array('a[NAme]', array('name-anchor')), // case-insensitive in HTML:
- + array('a[rel]', array('tag-anchor', 'nofollow-anchor')),
- + array('a[rel="tag"]', array('tag-anchor')),
- + array('a[href*="localhost"]', array('tag-anchor')),
- + array('a[href*=""]', array()),
- + array('a[href^="http"]', array('tag-anchor', 'nofollow-anchor')),
- + array('a[href^="http:"]', array('tag-anchor')),
- + array('a[href^=""]', array()),
- + array('a[href$="org"]', array('nofollow-anchor')),
- + array('a[href$=""]', array()),
- + array('div[foobar~="bc"]', array('foobar-div')),
- + array('div[foobar~="cde"]', array('foobar-div')),
- + array('[foobar~="ab bc"]', array('foobar-div')),
- + array('[foobar~=""]', array()),
- + array('[foobar~=" \t"]', array()),
- + array('div[foobar~="cd"]', array()),
- + array('*[lang|="En"]', array('second-li')),
- + array('[lang|="En-us"]', array('second-li')),
- + // Attribute values are case sensitive
- + array('*[lang|="en"]', array()),
- + array('[lang|="en-US"]', array()),
- + array('*[lang|="e"]', array()),
- + // ... :lang() is not.
- + array(':lang("EN")', array('second-li', 'li-div')),
- + array('*:lang(en-US)', array('second-li', 'li-div')),
- + array(':lang("e")', array()),
- + array('li:nth-child(3)', array('third-li')),
- + array('li:nth-child(10)', array()),
- + array('li:nth-child(2n)', array('second-li', 'fourth-li', 'sixth-li')),
- + array('li:nth-child(even)', array('second-li', 'fourth-li', 'sixth-li')),
- + array('li:nth-child(2n+0)', array('second-li', 'fourth-li', 'sixth-li')),
- + array('li:nth-child(+2n+1)', array('first-li', 'third-li', 'fifth-li', 'seventh-li')),
- + array('li:nth-child(odd)', array('first-li', 'third-li', 'fifth-li', 'seventh-li')),
- + array('li:nth-child(2n+4)', array('fourth-li', 'sixth-li')),
- + array('li:nth-child(3n+1)', array('first-li', 'fourth-li', 'seventh-li')),
- + array('li:nth-child(n)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
- + array('li:nth-child(n-1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
- + array('li:nth-child(n+1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
- + array('li:nth-child(n+3)', array('third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
- + array('li:nth-child(-n)', array()),
- + array('li:nth-child(-n-1)', array()),
- + array('li:nth-child(-n+1)', array('first-li')),
- + array('li:nth-child(-n+3)', array('first-li', 'second-li', 'third-li')),
- + array('li:nth-last-child(0)', array()),
- + array('li:nth-last-child(2n)', array('second-li', 'fourth-li', 'sixth-li')),
- + array('li:nth-last-child(even)', array('second-li', 'fourth-li', 'sixth-li')),
- + array('li:nth-last-child(2n+2)', array('second-li', 'fourth-li', 'sixth-li')),
- + array('li:nth-last-child(n)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
- + array('li:nth-last-child(n-1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
- + array('li:nth-last-child(n-3)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
- + array('li:nth-last-child(n+1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
- + array('li:nth-last-child(n+3)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li')),
- + array('li:nth-last-child(-n)', array()),
- + array('li:nth-last-child(-n-1)', array()),
- + array('li:nth-last-child(-n+1)', array('seventh-li')),
- + array('li:nth-last-child(-n+3)', array('fifth-li', 'sixth-li', 'seventh-li')),
- + array('ol:first-of-type', array('first-ol')),
- + array('ol:nth-child(1)', array('first-ol')),
- + array('ol:nth-of-type(2)', array('second-ol')),
- + array('ol:nth-last-of-type(1)', array('second-ol')),
- + array('span:only-child', array('foobar-span')),
- + array('li div:only-child', array('li-div')),
- + array('div *:only-child', array('li-div', 'foobar-span')),
- + array('p:only-of-type', array('paragraph')),
- + array('a:empty', array('name-anchor')),
- + array('a:EMpty', array('name-anchor')),
- + array('li:empty', array('third-li', 'fourth-li', 'fifth-li', 'sixth-li')),
- + array(':root', array('html')),
- + array('html:root', array('html')),
- + array('li:root', array()),
- + array('* :root', array()),
- + array('*:contains("link")', array('html', 'outer-div', 'tag-anchor', 'nofollow-anchor')),
- + array(':CONtains("link")', array('html', 'outer-div', 'tag-anchor', 'nofollow-anchor')),
- + array('*:contains("LInk")', array()), // case sensitive
- + array('*:contains("e")', array('html', 'nil', 'outer-div', 'first-ol', 'first-li', 'paragraph', 'p-em')),
- + array('*:contains("E")', array()), // case-sensitive
- + array('.a', array('first-ol')),
- + array('.b', array('first-ol')),
- + array('*.a', array('first-ol')),
- + array('ol.a', array('first-ol')),
- + array('.c', array('first-ol', 'third-li', 'fourth-li')),
- + array('*.c', array('first-ol', 'third-li', 'fourth-li')),
- + array('ol *.c', array('third-li', 'fourth-li')),
- + array('ol li.c', array('third-li', 'fourth-li')),
- + array('li ~ li.c', array('third-li', 'fourth-li')),
- + array('ol > li.c', array('third-li', 'fourth-li')),
- + array('#first-li', array('first-li')),
- + array('li#first-li', array('first-li')),
- + array('*#first-li', array('first-li')),
- + array('li div', array('li-div')),
- + array('li > div', array('li-div')),
- + array('div div', array('li-div')),
- + array('div > div', array()),
- + array('div>.c', array('first-ol')),
- + array('div > .c', array('first-ol')),
- + array('div + div', array('foobar-div')),
- + array('a ~ a', array('tag-anchor', 'nofollow-anchor')),
- + array('a[rel="tag"] ~ a', array('nofollow-anchor')),
- + array('ol#first-ol li:last-child', array('seventh-li')),
- + array('ol#first-ol *:last-child', array('li-div', 'seventh-li')),
- + array('#outer-div:first-child', array('outer-div')),
- + array('#outer-div :first-child', array('name-anchor', 'first-li', 'li-div', 'p-b', 'checkbox-fieldset-disabled', 'area-href')),
- + array('a[href]', array('tag-anchor', 'nofollow-anchor')),
- + array(':not(*)', array()),
- + array('a:not([href])', array('name-anchor')),
- + array('ol :Not(li[class])', array('first-li', 'second-li', 'li-div', 'fifth-li', 'sixth-li', 'seventh-li')),
- + // HTML-specific
- + array(':link', array('link-href', 'tag-anchor', 'nofollow-anchor', 'area-href')),
- + array(':visited', array()),
- + array(':enabled', array('link-href', 'tag-anchor', 'nofollow-anchor', 'checkbox-unchecked', 'text-checked', 'checkbox-checked', 'area-href')),
- + array(':disabled', array('checkbox-disabled', 'checkbox-disabled-checked', 'fieldset', 'checkbox-fieldset-disabled')),
- + array(':checked', array('checkbox-checked', 'checkbox-disabled-checked')),
- + );
- + }
- +
- + public function getHtmlShakespearTestData()
- + {
- + return array(
- + array('*', 246),
- + array('div:contains(CELIA)', 26),
- + array('div:only-child', 22), // ?
- + array('div:nth-child(even)', 106),
- + array('div:nth-child(2n)', 106),
- + array('div:nth-child(odd)', 137),
- + array('div:nth-child(2n+1)', 137),
- + array('div:nth-child(n)', 243),
- + array('div:last-child', 53),
- + array('div:first-child', 51),
- + array('div > div', 242),
- + array('div + div', 190),
- + array('div ~ div', 190),
- + array('body', 1),
- + array('body div', 243),
- + array('div', 243),
- + array('div div', 242),
- + array('div div div', 241),
- + array('div, div, div', 243),
- + array('div, a, span', 243),
- + array('.dialog', 51),
- + array('div.dialog', 51),
- + array('div .dialog', 51),
- + array('div.character, div.dialog', 99),
- + array('div.direction.dialog', 0),
- + array('div.dialog.direction', 0),
- + array('div.dialog.scene', 1),
- + array('div.scene.scene', 1),
- + array('div.scene .scene', 0),
- + array('div.direction .dialog ', 0),
- + array('div .dialog .direction', 4),
- + array('div.dialog .dialog .direction', 4),
- + array('#speech5', 1),
- + array('div#speech5', 1),
- + array('div #speech5', 1),
- + array('div.scene div.dialog', 49),
- + array('div#scene1 div.dialog div', 142),
- + array('#scene1 #speech1', 1),
- + array('div[class]', 103),
- + array('div[class=dialog]', 50),
- + array('div[class^=dia]', 51),
- + array('div[class$=log]', 50),
- + array('div[class*=sce]', 1),
- + array('div[class|=dialog]', 50), // ? Seems right
- + array('div[class!=madeup]', 243), // ? Seems right
- + array('div[class~=dialog]', 51), // ? Seems right
- + );
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php 2014-11-19 15:54:09.496099996 +0100
- @@ -0,0 +1,63 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\XPath\Extension;
- +
- +/**
- + * XPath expression translator abstract extension.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +abstract class AbstractExtension implements ExtensionInterface
- +{
- + /**
- + * {@inheritdoc}
- + */
- + public function getNodeTranslators()
- + {
- + return array();
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getCombinationTranslators()
- + {
- + return array();
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getFunctionTranslators()
- + {
- + return array();
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getPseudoClassTranslators()
- + {
- + return array();
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getAttributeMatchingTranslators()
- + {
- + return array();
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php 2014-11-19 15:54:09.820099998 +0100
- @@ -0,0 +1,173 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\XPath\Extension;
- +
- +use Symfony\Component\CssSelector\XPath\Translator;
- +use Symfony\Component\CssSelector\XPath\XPathExpr;
- +
- +/**
- + * XPath expression translator attribute extension.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class AttributeMatchingExtension extends AbstractExtension
- +{
- + /**
- + * {@inheritdoc}
- + */
- + public function getAttributeMatchingTranslators()
- + {
- + return array(
- + 'exists' => array($this, 'translateExists'),
- + '=' => array($this, 'translateEquals'),
- + '~=' => array($this, 'translateIncludes'),
- + '|=' => array($this, 'translateDashMatch'),
- + '^=' => array($this, 'translatePrefixMatch'),
- + '$=' => array($this, 'translateSuffixMatch'),
- + '*=' => array($this, 'translateSubstringMatch'),
- + '!=' => array($this, 'translateDifferent'),
- + );
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param string $attribute
- + * @param string $value
- + *
- + * @return XPathExpr
- + */
- + public function translateExists(XPathExpr $xpath, $attribute, $value)
- + {
- + return $xpath->addCondition($attribute);
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param string $attribute
- + * @param string $value
- + *
- + * @return XPathExpr
- + */
- + public function translateEquals(XPathExpr $xpath, $attribute, $value)
- + {
- + return $xpath->addCondition(sprintf('%s = %s', $attribute, Translator::getXpathLiteral($value)));
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param string $attribute
- + * @param string $value
- + *
- + * @return XPathExpr
- + */
- + public function translateIncludes(XPathExpr $xpath, $attribute, $value)
- + {
- + return $xpath->addCondition($value ? sprintf(
- + '%1$s and contains(concat(\' \', normalize-space(%1$s), \' \'), %2$s)',
- + $attribute,
- + Translator::getXpathLiteral(' '.$value.' ')
- + ) : '0');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param string $attribute
- + * @param string $value
- + *
- + * @return XPathExpr
- + */
- + public function translateDashMatch(XPathExpr $xpath, $attribute, $value)
- + {
- + return $xpath->addCondition(sprintf(
- + '%1$s and (%1$s = %2$s or starts-with(%1$s, %3$s))',
- + $attribute,
- + Translator::getXpathLiteral($value),
- + Translator::getXpathLiteral($value.'-')
- + ));
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param string $attribute
- + * @param string $value
- + *
- + * @return XPathExpr
- + */
- + public function translatePrefixMatch(XPathExpr $xpath, $attribute, $value)
- + {
- + return $xpath->addCondition($value ? sprintf(
- + '%1$s and starts-with(%1$s, %2$s)',
- + $attribute,
- + Translator::getXpathLiteral($value)
- + ) : '0');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param string $attribute
- + * @param string $value
- + *
- + * @return XPathExpr
- + */
- + public function translateSuffixMatch(XPathExpr $xpath, $attribute, $value)
- + {
- + return $xpath->addCondition($value ? sprintf(
- + '%1$s and substring(%1$s, string-length(%1$s)-%2$s) = %3$s',
- + $attribute,
- + strlen($value) - 1,
- + Translator::getXpathLiteral($value)
- + ) : '0');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param string $attribute
- + * @param string $value
- + *
- + * @return XPathExpr
- + */
- + public function translateSubstringMatch(XPathExpr $xpath, $attribute, $value)
- + {
- + return $xpath->addCondition($value ? sprintf(
- + '%1$s and contains(%1$s, %2$s)',
- + $attribute,
- + Translator::getXpathLiteral($value)
- + ) : '0');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param string $attribute
- + * @param string $value
- + *
- + * @return XPathExpr
- + */
- + public function translateDifferent(XPathExpr $xpath, $attribute, $value)
- + {
- + return $xpath->addCondition(sprintf(
- + $value ? 'not(%1$s) or %1$s != %2$s' : '%s != %s',
- + $attribute,
- + Translator::getXpathLiteral($value)
- + ));
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getName()
- + {
- + return 'attribute-matching';
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php 2014-11-19 15:54:08.852099992 +0100
- @@ -0,0 +1,93 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\XPath\Extension;
- +
- +use Symfony\Component\CssSelector\XPath\XPathExpr;
- +
- +/**
- + * XPath expression translator combination extension.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class CombinationExtension extends AbstractExtension
- +{
- + /**
- + * {@inheritdoc}
- + */
- + public function getCombinationTranslators()
- + {
- + return array(
- + ' ' => array($this, 'translateDescendant'),
- + '>' => array($this, 'translateChild'),
- + '+' => array($this, 'translateDirectAdjacent'),
- + '~' => array($this, 'translateIndirectAdjacent'),
- + );
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param XPathExpr $combinedXpath
- + *
- + * @return XPathExpr
- + */
- + public function translateDescendant(XPathExpr $xpath, XPathExpr $combinedXpath)
- + {
- + return $xpath->join('/descendant-or-self::*/', $combinedXpath);
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param XPathExpr $combinedXpath
- + *
- + * @return XPathExpr
- + */
- + public function translateChild(XPathExpr $xpath, XPathExpr $combinedXpath)
- + {
- + return $xpath->join('/', $combinedXpath);
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param XPathExpr $combinedXpath
- + *
- + * @return XPathExpr
- + */
- + public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath)
- + {
- + return $xpath
- + ->join('/following-sibling::', $combinedXpath)
- + ->addNameTest()
- + ->addCondition('position() = 1');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param XPathExpr $combinedXpath
- + *
- + * @return XPathExpr
- + */
- + public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath)
- + {
- + return $xpath->join('/following-sibling::', $combinedXpath);
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getName()
- + {
- + return 'combination';
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php 2014-11-19 15:54:09.172099994 +0100
- @@ -0,0 +1,67 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\XPath\Extension;
- +
- +/**
- + * XPath expression translator extension interface.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +interface ExtensionInterface
- +{
- + /**
- + * Returns node translators.
- + *
- + * These callables will receive the node as first argument and the translator as second argument.
- + *
- + * @return callable[]
- + */
- + public function getNodeTranslators();
- +
- + /**
- + * Returns combination translators.
- + *
- + * @return callable[]
- + */
- + public function getCombinationTranslators();
- +
- + /**
- + * Returns function translators.
- + *
- + * @return callable[]
- + */
- + public function getFunctionTranslators();
- +
- + /**
- + * Returns pseudo-class translators.
- + *
- + * @return callable[]
- + */
- + public function getPseudoClassTranslators();
- +
- + /**
- + * Returns attribute operation translators.
- + *
- + * @return callable[]
- + */
- + public function getAttributeMatchingTranslators();
- +
- + /**
- + * Returns extension name.
- + *
- + * @return string
- + */
- + public function getName();
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php 2014-11-19 15:54:08.692099991 +0100
- @@ -0,0 +1,209 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\XPath\Extension;
- +
- +use Symfony\Component\CssSelector\Exception\ExpressionErrorException;
- +use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
- +use Symfony\Component\CssSelector\Node\FunctionNode;
- +use Symfony\Component\CssSelector\Parser\Parser;
- +use Symfony\Component\CssSelector\XPath\Translator;
- +use Symfony\Component\CssSelector\XPath\XPathExpr;
- +
- +/**
- + * XPath expression translator function extension.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class FunctionExtension extends AbstractExtension
- +{
- + /**
- + * {@inheritdoc}
- + */
- + public function getFunctionTranslators()
- + {
- + return array(
- + 'nth-child' => array($this, 'translateNthChild'),
- + 'nth-last-child' => array($this, 'translateNthLastChild'),
- + 'nth-of-type' => array($this, 'translateNthOfType'),
- + 'nth-last-of-type' => array($this, 'translateNthLastOfType'),
- + 'contains' => array($this, 'translateContains'),
- + 'lang' => array($this, 'translateLang'),
- + );
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param FunctionNode $function
- + * @param bool $last
- + * @param bool $addNameTest
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function translateNthChild(XPathExpr $xpath, FunctionNode $function, $last = false, $addNameTest = true)
- + {
- + try {
- + list($a, $b) = Parser::parseSeries($function->getArguments());
- + } catch (SyntaxErrorException $e) {
- + throw new ExpressionErrorException(sprintf('Invalid series: %s', implode(', ', $function->getArguments())), 0, $e);
- + }
- +
- + $xpath->addStarPrefix();
- + if ($addNameTest) {
- + $xpath->addNameTest();
- + }
- +
- + if (0 === $a) {
- + return $xpath->addCondition('position() = '.($last ? 'last() - '.($b - 1) : $b));
- + }
- +
- + if ($a < 0) {
- + if ($b < 1) {
- + return $xpath->addCondition('false()');
- + }
- +
- + $sign = '<=';
- + } else {
- + $sign = '>=';
- + }
- +
- + $expr = 'position()';
- +
- + if ($last) {
- + $expr = 'last() - '.$expr;
- + $b--;
- + }
- +
- + if (0 !== $b) {
- + $expr .= ' - '.$b;
- + }
- +
- + $conditions = array(sprintf('%s %s 0', $expr, $sign));
- +
- + if (1 !== $a && -1 !== $a) {
- + $conditions[] = sprintf('(%s) mod %d = 0', $expr, $a);
- + }
- +
- + return $xpath->addCondition(implode(' and ', $conditions));
- +
- + // todo: handle an+b, odd, even
- + // an+b means every-a, plus b, e.g., 2n+1 means odd
- + // 0n+b means b
- + // n+0 means a=1, i.e., all elements
- + // an means every a elements, i.e., 2n means even
- + // -n means -1n
- + // -1n+6 means elements 6 and previous
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param FunctionNode $function
- + *
- + * @return XPathExpr
- + */
- + public function translateNthLastChild(XPathExpr $xpath, FunctionNode $function)
- + {
- + return $this->translateNthChild($xpath, $function, true);
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param FunctionNode $function
- + *
- + * @return XPathExpr
- + */
- + public function translateNthOfType(XPathExpr $xpath, FunctionNode $function)
- + {
- + return $this->translateNthChild($xpath, $function, false, false);
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param FunctionNode $function
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function)
- + {
- + if ('*' === $xpath->getElement()) {
- + throw new ExpressionErrorException('"*:nth-of-type()" is not implemented.');
- + }
- +
- + return $this->translateNthChild($xpath, $function, true, false);
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param FunctionNode $function
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function translateContains(XPathExpr $xpath, FunctionNode $function)
- + {
- + $arguments = $function->getArguments();
- + foreach ($arguments as $token) {
- + if (!($token->isString() || $token->isIdentifier())) {
- + throw new ExpressionErrorException(
- + 'Expected a single string or identifier for :contains(), got '
- + .implode(', ', $arguments)
- + );
- + }
- + }
- +
- + return $xpath->addCondition(sprintf(
- + 'contains(string(.), %s)',
- + Translator::getXpathLiteral($arguments[0]->getValue())
- + ));
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param FunctionNode $function
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function translateLang(XPathExpr $xpath, FunctionNode $function)
- + {
- + $arguments = $function->getArguments();
- + foreach ($arguments as $token) {
- + if (!($token->isString() || $token->isIdentifier())) {
- + throw new ExpressionErrorException(
- + 'Expected a single string or identifier for :lang(), got '
- + .implode(', ', $arguments)
- + );
- + }
- + }
- +
- + return $xpath->addCondition(sprintf(
- + 'lang(%s)',
- + Translator::getXpathLiteral($arguments[0]->getValue())
- + ));
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getName()
- + {
- + return 'function';
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php 2014-11-19 15:54:09.016099993 +0100
- @@ -0,0 +1,238 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\XPath\Extension;
- +
- +use Symfony\Component\CssSelector\Exception\ExpressionErrorException;
- +use Symfony\Component\CssSelector\Node\FunctionNode;
- +use Symfony\Component\CssSelector\XPath\Translator;
- +use Symfony\Component\CssSelector\XPath\XPathExpr;
- +
- +/**
- + * XPath expression translator HTML extension.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class HtmlExtension extends AbstractExtension
- +{
- + /**
- + * Constructor.
- + *
- + * @param Translator $translator
- + */
- + public function __construct(Translator $translator)
- + {
- + $translator
- + ->getExtension('node')
- + ->setFlag(NodeExtension::ELEMENT_NAME_IN_LOWER_CASE, true)
- + ->setFlag(NodeExtension::ATTRIBUTE_NAME_IN_LOWER_CASE, true);
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getPseudoClassTranslators()
- + {
- + return array(
- + 'checked' => array($this, 'translateChecked'),
- + 'link' => array($this, 'translateLink'),
- + 'disabled' => array($this, 'translateDisabled'),
- + 'enabled' => array($this, 'translateEnabled'),
- + 'selected' => array($this, 'translateSelected'),
- + 'invalid' => array($this, 'translateInvalid'),
- + 'hover' => array($this, 'translateHover'),
- + 'visited' => array($this, 'translateVisited'),
- + );
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getFunctionTranslators()
- + {
- + return array(
- + 'lang' => array($this, 'translateLang'),
- + );
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateChecked(XPathExpr $xpath)
- + {
- + return $xpath->addCondition(
- + '(@checked '
- + ."and (name(.) = 'input' or name(.) = 'command')"
- + ."and (@type = 'checkbox' or @type = 'radio'))"
- + );
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateLink(XPathExpr $xpath)
- + {
- + return $xpath->addCondition("@href and (name(.) = 'a' or name(.) = 'link' or name(.) = 'area')");
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateDisabled(XPathExpr $xpath)
- + {
- + return $xpath->addCondition(
- + "("
- + ."@disabled and"
- + ."("
- + ."(name(.) = 'input' and @type != 'hidden')"
- + ." or name(.) = 'button'"
- + ." or name(.) = 'select'"
- + ." or name(.) = 'textarea'"
- + ." or name(.) = 'command'"
- + ." or name(.) = 'fieldset'"
- + ." or name(.) = 'optgroup'"
- + ." or name(.) = 'option'"
- + .")"
- + .") or ("
- + ."(name(.) = 'input' and @type != 'hidden')"
- + ." or name(.) = 'button'"
- + ." or name(.) = 'select'"
- + ." or name(.) = 'textarea'"
- + .")"
- + ." and ancestor::fieldset[@disabled]"
- + );
- + // todo: in the second half, add "and is not a descendant of that fieldset element's first legend element child, if any."
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateEnabled(XPathExpr $xpath)
- + {
- + return $xpath->addCondition(
- + '('
- + .'@href and ('
- + ."name(.) = 'a'"
- + ." or name(.) = 'link'"
- + ." or name(.) = 'area'"
- + .')'
- + .') or ('
- + .'('
- + ."name(.) = 'command'"
- + ." or name(.) = 'fieldset'"
- + ." or name(.) = 'optgroup'"
- + .')'
- + .' and not(@disabled)'
- + .') or ('
- + .'('
- + ."(name(.) = 'input' and @type != 'hidden')"
- + ." or name(.) = 'button'"
- + ." or name(.) = 'select'"
- + ." or name(.) = 'textarea'"
- + ." or name(.) = 'keygen'"
- + .')'
- + ." and not (@disabled or ancestor::fieldset[@disabled])"
- + .') or ('
- + ."name(.) = 'option' and not("
- + ."@disabled or ancestor::optgroup[@disabled]"
- + .')'
- + .')'
- + );
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param FunctionNode $function
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function translateLang(XPathExpr $xpath, FunctionNode $function)
- + {
- + $arguments = $function->getArguments();
- + foreach ($arguments as $token) {
- + if (!($token->isString() || $token->isIdentifier())) {
- + throw new ExpressionErrorException(
- + 'Expected a single string or identifier for :lang(), got '
- + .implode(', ', $arguments)
- + );
- + }
- + }
- +
- + return $xpath->addCondition(sprintf(
- + 'ancestor-or-self::*[@lang][1][starts-with(concat('
- + ."translate(@%s, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), '-')"
- + .', %s)]',
- + 'lang',
- + Translator::getXpathLiteral(strtolower($arguments[0]->getValue()).'-')
- + ));
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateSelected(XPathExpr $xpath)
- + {
- + return $xpath->addCondition("(@selected and name(.) = 'option')");
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateInvalid(XPathExpr $xpath)
- + {
- + return $xpath->addCondition('0');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateHover(XPathExpr $xpath)
- + {
- + return $xpath->addCondition('0');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateVisited(XPathExpr $xpath)
- + {
- + return $xpath->addCondition('0');
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getName()
- + {
- + return 'html';
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php 2014-11-19 15:54:09.660099997 +0100
- @@ -0,0 +1,271 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\XPath\Extension;
- +
- +use Symfony\Component\CssSelector\Node;
- +use Symfony\Component\CssSelector\XPath\Translator;
- +use Symfony\Component\CssSelector\XPath\XPathExpr;
- +
- +/**
- + * XPath expression translator node extension.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class NodeExtension extends AbstractExtension
- +{
- + const ELEMENT_NAME_IN_LOWER_CASE = 1;
- + const ATTRIBUTE_NAME_IN_LOWER_CASE = 2;
- + const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4;
- +
- + /**
- + * @var int
- + */
- + private $flags;
- +
- + /**
- + * Constructor.
- + *
- + * @param int $flags
- + */
- + public function __construct($flags = 0)
- + {
- + $this->flags = $flags;
- + }
- +
- + /**
- + * @param int $flag
- + * @param bool $on
- + *
- + * @return NodeExtension
- + */
- + public function setFlag($flag, $on)
- + {
- + if ($on && !$this->hasFlag($flag)) {
- + $this->flags += $flag;
- + }
- +
- + if (!$on && $this->hasFlag($flag)) {
- + $this->flags -= $flag;
- + }
- +
- + return $this;
- + }
- +
- + /**
- + * @param int $flag
- + *
- + * @return bool
- + */
- + public function hasFlag($flag)
- + {
- + return $this->flags & $flag;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getNodeTranslators()
- + {
- + return array(
- + 'Selector' => array($this, 'translateSelector'),
- + 'CombinedSelector' => array($this, 'translateCombinedSelector'),
- + 'Negation' => array($this, 'translateNegation'),
- + 'Function' => array($this, 'translateFunction'),
- + 'Pseudo' => array($this, 'translatePseudo'),
- + 'Attribute' => array($this, 'translateAttribute'),
- + 'Class' => array($this, 'translateClass'),
- + 'Hash' => array($this, 'translateHash'),
- + 'Element' => array($this, 'translateElement'),
- + );
- + }
- +
- + /**
- + * @param Node\SelectorNode $node
- + * @param Translator $translator
- + *
- + * @return XPathExpr
- + */
- + public function translateSelector(Node\SelectorNode $node, Translator $translator)
- + {
- + return $translator->nodeToXPath($node->getTree());
- + }
- +
- + /**
- + * @param Node\CombinedSelectorNode $node
- + * @param Translator $translator
- + *
- + * @return XPathExpr
- + */
- + public function translateCombinedSelector(Node\CombinedSelectorNode $node, Translator $translator)
- + {
- + return $translator->addCombination($node->getCombinator(), $node->getSelector(), $node->getSubSelector());
- + }
- +
- + /**
- + * @param Node\NegationNode $node
- + * @param Translator $translator
- + *
- + * @return XPathExpr
- + */
- + public function translateNegation(Node\NegationNode $node, Translator $translator)
- + {
- + $xpath = $translator->nodeToXPath($node->getSelector());
- + $subXpath = $translator->nodeToXPath($node->getSubSelector());
- + $subXpath->addNameTest();
- +
- + if ($subXpath->getCondition()) {
- + return $xpath->addCondition(sprintf('not(%s)', $subXpath->getCondition()));
- + }
- +
- + return $xpath->addCondition('0');
- + }
- +
- + /**
- + * @param Node\FunctionNode $node
- + * @param Translator $translator
- + *
- + * @return XPathExpr
- + */
- + public function translateFunction(Node\FunctionNode $node, Translator $translator)
- + {
- + $xpath = $translator->nodeToXPath($node->getSelector());
- +
- + return $translator->addFunction($xpath, $node);
- + }
- +
- + /**
- + * @param Node\PseudoNode $node
- + * @param Translator $translator
- + *
- + * @return XPathExpr
- + */
- + public function translatePseudo(Node\PseudoNode $node, Translator $translator)
- + {
- + $xpath = $translator->nodeToXPath($node->getSelector());
- +
- + return $translator->addPseudoClass($xpath, $node->getIdentifier());
- + }
- +
- + /**
- + * @param Node\AttributeNode $node
- + * @param Translator $translator
- + *
- + * @return XPathExpr
- + */
- + public function translateAttribute(Node\AttributeNode $node, Translator $translator)
- + {
- + $name = $node->getAttribute();
- + $safe = $this->isSafeName($name);
- +
- + if ($this->hasFlag(self::ATTRIBUTE_NAME_IN_LOWER_CASE)) {
- + $name = strtolower($name);
- + }
- +
- + if ($node->getNamespace()) {
- + $name = sprintf('%s:%s', $node->getNamespace(), $name);
- + $safe = $safe && $this->isSafeName($node->getNamespace());
- + }
- +
- + $attribute = $safe ? '@'.$name : sprintf('attribute::*[name() = %s]', Translator::getXpathLiteral($name));
- + $value = $node->getValue();
- + $xpath = $translator->nodeToXPath($node->getSelector());
- +
- + if ($this->hasFlag(self::ATTRIBUTE_VALUE_IN_LOWER_CASE)) {
- + $value = strtolower($value);
- + }
- +
- + return $translator->addAttributeMatching($xpath, $node->getOperator(), $attribute, $value);
- + }
- +
- + /**
- + * @param Node\ClassNode $node
- + * @param Translator $translator
- + *
- + * @return XPathExpr
- + */
- + public function translateClass(Node\ClassNode $node, Translator $translator)
- + {
- + $xpath = $translator->nodeToXPath($node->getSelector());
- +
- + return $translator->addAttributeMatching($xpath, '~=', '@class', $node->getName());
- + }
- +
- + /**
- + * @param Node\HashNode $node
- + * @param Translator $translator
- + *
- + * @return XPathExpr
- + */
- + public function translateHash(Node\HashNode $node, Translator $translator)
- + {
- + $xpath = $translator->nodeToXPath($node->getSelector());
- +
- + return $translator->addAttributeMatching($xpath, '=', '@id', $node->getId());
- + }
- +
- + /**
- + * @param Node\ElementNode $node
- + *
- + * @return XPathExpr
- + */
- + public function translateElement(Node\ElementNode $node)
- + {
- + $element = $node->getElement();
- +
- + if ($this->hasFlag(self::ELEMENT_NAME_IN_LOWER_CASE)) {
- + $element = strtolower($element);
- + }
- +
- + if ($element) {
- + $safe = $this->isSafeName($element);
- + } else {
- + $element = '*';
- + $safe = true;
- + }
- +
- + if ($node->getNamespace()) {
- + $element = sprintf('%s:%s', $node->getNamespace(), $element);
- + $safe = $safe && $this->isSafeName($node->getNamespace());
- + }
- +
- + $xpath = new XPathExpr('', $element);
- +
- + if (!$safe) {
- + $xpath->addNameTest();
- + }
- +
- + return $xpath;
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getName()
- + {
- + return 'node';
- + }
- +
- + /**
- + * Tests if given name is safe.
- + *
- + * @param string $name
- + *
- + * @return bool
- + */
- + private function isSafeName($name)
- + {
- + return 0 < preg_match('~^[a-zA-Z_][a-zA-Z0-9_.-]*$~', $name);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php 2014-11-19 15:54:09.332099995 +0100
- @@ -0,0 +1,162 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\XPath\Extension;
- +
- +use Symfony\Component\CssSelector\Exception\ExpressionErrorException;
- +use Symfony\Component\CssSelector\XPath\XPathExpr;
- +
- +/**
- + * XPath expression translator pseudo-class extension.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class PseudoClassExtension extends AbstractExtension
- +{
- + /**
- + * {@inheritdoc}
- + */
- + public function getPseudoClassTranslators()
- + {
- + return array(
- + 'root' => array($this, 'translateRoot'),
- + 'first-child' => array($this, 'translateFirstChild'),
- + 'last-child' => array($this, 'translateLastChild'),
- + 'first-of-type' => array($this, 'translateFirstOfType'),
- + 'last-of-type' => array($this, 'translateLastOfType'),
- + 'only-child' => array($this, 'translateOnlyChild'),
- + 'only-of-type' => array($this, 'translateOnlyOfType'),
- + 'empty' => array($this, 'translateEmpty'),
- + );
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateRoot(XPathExpr $xpath)
- + {
- + return $xpath->addCondition('not(parent::*)');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateFirstChild(XPathExpr $xpath)
- + {
- + return $xpath
- + ->addStarPrefix()
- + ->addNameTest()
- + ->addCondition('position() = 1');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateLastChild(XPathExpr $xpath)
- + {
- + return $xpath
- + ->addStarPrefix()
- + ->addNameTest()
- + ->addCondition('position() = last()');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function translateFirstOfType(XPathExpr $xpath)
- + {
- + if ('*' === $xpath->getElement()) {
- + throw new ExpressionErrorException('"*:first-of-type" is not implemented.');
- + }
- +
- + return $xpath
- + ->addStarPrefix()
- + ->addCondition('position() = 1');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function translateLastOfType(XPathExpr $xpath)
- + {
- + if ('*' === $xpath->getElement()) {
- + throw new ExpressionErrorException('"*:last-of-type" is not implemented.');
- + }
- +
- + return $xpath
- + ->addStarPrefix()
- + ->addCondition('position() = last()');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateOnlyChild(XPathExpr $xpath)
- + {
- + return $xpath
- + ->addStarPrefix()
- + ->addNameTest()
- + ->addCondition('last() = 1');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function translateOnlyOfType(XPathExpr $xpath)
- + {
- + if ('*' === $xpath->getElement()) {
- + throw new ExpressionErrorException('"*:only-of-type" is not implemented.');
- + }
- +
- + return $xpath->addCondition('last() = 1');
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + *
- + * @return XPathExpr
- + */
- + public function translateEmpty(XPathExpr $xpath)
- + {
- + return $xpath->addCondition('not(*) and not(string-length())');
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function getName()
- + {
- + return 'pseudo-class';
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/TranslatorInterface.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/TranslatorInterface.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/TranslatorInterface.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/TranslatorInterface.php 2014-11-19 15:54:08.212099988 +0100
- @@ -0,0 +1,45 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\XPath;
- +
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +
- +/**
- + * XPath expression translator interface.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +interface TranslatorInterface
- +{
- + /**
- + * Translates a CSS selector to an XPath expression.
- + *
- + * @param string $cssExpr
- + * @param string $prefix
- + *
- + * @return XPathExpr
- + */
- + public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::');
- +
- + /**
- + * Translates a parsed selector node to an XPath expression
- + *
- + * @param SelectorNode $selector
- + * @param string $prefix
- + *
- + * @return XPathExpr
- + */
- + public function selectorToXPath(SelectorNode $selector, $prefix = 'descendant-or-self::');
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Translator.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Translator.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Translator.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Translator.php 2014-11-19 15:54:08.052099987 +0100
- @@ -0,0 +1,299 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\XPath;
- +
- +use Symfony\Component\CssSelector\Exception\ExpressionErrorException;
- +use Symfony\Component\CssSelector\Node\FunctionNode;
- +use Symfony\Component\CssSelector\Node\NodeInterface;
- +use Symfony\Component\CssSelector\Node\SelectorNode;
- +use Symfony\Component\CssSelector\Parser\Parser;
- +use Symfony\Component\CssSelector\Parser\ParserInterface;
- +
- +/**
- + * XPath expression translator interface.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class Translator implements TranslatorInterface
- +{
- + /**
- + * @var ParserInterface
- + */
- + private $mainParser;
- +
- + /**
- + * @var ParserInterface[]
- + */
- + private $shortcutParsers = array();
- +
- + /**
- + * @var Extension\ExtensionInterface
- + */
- + private $extensions = array();
- +
- + /**
- + * @var array
- + */
- + private $nodeTranslators = array();
- +
- + /**
- + * @var array
- + */
- + private $combinationTranslators = array();
- +
- + /**
- + * @var array
- + */
- + private $functionTranslators = array();
- +
- + /**
- + * @var array
- + */
- + private $pseudoClassTranslators = array();
- +
- + /**
- + * @var array
- + */
- + private $attributeMatchingTranslators = array();
- +
- + /**
- + * Constructor.
- + */
- + public function __construct(ParserInterface $parser = null)
- + {
- + $this->mainParser = $parser ?: new Parser();
- +
- + $this
- + ->registerExtension(new Extension\NodeExtension())
- + ->registerExtension(new Extension\CombinationExtension())
- + ->registerExtension(new Extension\FunctionExtension())
- + ->registerExtension(new Extension\PseudoClassExtension())
- + ->registerExtension(new Extension\AttributeMatchingExtension())
- + ;
- + }
- +
- + /**
- + * @param string $element
- + *
- + * @return string
- + */
- + public static function getXpathLiteral($element)
- + {
- + if (false === strpos($element, "'")) {
- + return "'".$element."'";
- + }
- +
- + if (false === strpos($element, '"')) {
- + return '"'.$element.'"';
- + }
- +
- + $string = $element;
- + $parts = array();
- + while (true) {
- + if (false !== $pos = strpos($string, "'")) {
- + $parts[] = sprintf("'%s'", substr($string, 0, $pos));
- + $parts[] = "\"'\"";
- + $string = substr($string, $pos + 1);
- + } else {
- + $parts[] = "'$string'";
- + break;
- + }
- + }
- +
- + return sprintf('concat(%s)', implode($parts, ', '));
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::')
- + {
- + $selectors = $this->parseSelectors($cssExpr);
- +
- + /** @var SelectorNode $selector */
- + foreach ($selectors as $index => $selector) {
- + if (null !== $selector->getPseudoElement()) {
- + throw new ExpressionErrorException('Pseudo-elements are not supported.');
- + }
- +
- + $selectors[$index] = $this->selectorToXPath($selector, $prefix);
- + }
- +
- + return implode(' | ', $selectors);
- + }
- +
- + /**
- + * {@inheritdoc}
- + */
- + public function selectorToXPath(SelectorNode $selector, $prefix = 'descendant-or-self::')
- + {
- + return ($prefix ?: '').$this->nodeToXPath($selector);
- + }
- +
- + /**
- + * Registers an extension.
- + *
- + * @param Extension\ExtensionInterface $extension
- + *
- + * @return Translator
- + */
- + public function registerExtension(Extension\ExtensionInterface $extension)
- + {
- + $this->extensions[$extension->getName()] = $extension;
- +
- + $this->nodeTranslators = array_merge($this->nodeTranslators, $extension->getNodeTranslators());
- + $this->combinationTranslators = array_merge($this->combinationTranslators, $extension->getCombinationTranslators());
- + $this->functionTranslators = array_merge($this->functionTranslators, $extension->getFunctionTranslators());
- + $this->pseudoClassTranslators = array_merge($this->pseudoClassTranslators, $extension->getPseudoClassTranslators());
- + $this->attributeMatchingTranslators = array_merge($this->attributeMatchingTranslators, $extension->getAttributeMatchingTranslators());
- +
- + return $this;
- + }
- +
- + /**
- + * @param string $name
- + *
- + * @return Extension\ExtensionInterface
- + *
- + * @throws ExpressionErrorException
- + */
- + public function getExtension($name)
- + {
- + if (!isset($this->extensions[$name])) {
- + throw new ExpressionErrorException(sprintf('Extension "%s" not registered.', $name));
- + }
- +
- + return $this->extensions[$name];
- + }
- +
- + /**
- + * Registers a shortcut parser.
- + *
- + * @param ParserInterface $shortcut
- + *
- + * @return Translator
- + */
- + public function registerParserShortcut(ParserInterface $shortcut)
- + {
- + $this->shortcutParsers[] = $shortcut;
- +
- + return $this;
- + }
- +
- + /**
- + * @param NodeInterface $node
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function nodeToXPath(NodeInterface $node)
- + {
- + if (!isset($this->nodeTranslators[$node->getNodeName()])) {
- + throw new ExpressionErrorException(sprintf('Node "%s" not supported.', $node->getNodeName()));
- + }
- +
- + return call_user_func($this->nodeTranslators[$node->getNodeName()], $node, $this);
- + }
- +
- + /**
- + * @param string $combiner
- + * @param NodeInterface $xpath
- + * @param NodeInterface $combinedXpath
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function addCombination($combiner, NodeInterface $xpath, NodeInterface $combinedXpath)
- + {
- + if (!isset($this->combinationTranslators[$combiner])) {
- + throw new ExpressionErrorException(sprintf('Combiner "%s" not supported.', $combiner));
- + }
- +
- + return call_user_func($this->combinationTranslators[$combiner], $this->nodeToXPath($xpath), $this->nodeToXPath($combinedXpath));
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param FunctionNode $function
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function addFunction(XPathExpr $xpath, FunctionNode $function)
- + {
- + if (!isset($this->functionTranslators[$function->getName()])) {
- + throw new ExpressionErrorException(sprintf('Function "%s" not supported.', $function->getName()));
- + }
- +
- + return call_user_func($this->functionTranslators[$function->getName()], $xpath, $function);
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param string $pseudoClass
- + *
- + * @return XPathExpr
- + *
- + * @throws ExpressionErrorException
- + */
- + public function addPseudoClass(XPathExpr $xpath, $pseudoClass)
- + {
- + if (!isset($this->pseudoClassTranslators[$pseudoClass])) {
- + throw new ExpressionErrorException(sprintf('Pseudo-class "%s" not supported.', $pseudoClass));
- + }
- +
- + return call_user_func($this->pseudoClassTranslators[$pseudoClass], $xpath);
- + }
- +
- + /**
- + * @param XPathExpr $xpath
- + * @param string $operator
- + * @param string $attribute
- + * @param string $value
- + *
- + * @throws ExpressionErrorException
- + *
- + * @return XPathExpr
- + */
- + public function addAttributeMatching(XPathExpr $xpath, $operator, $attribute, $value)
- + {
- + if (!isset($this->attributeMatchingTranslators[$operator])) {
- + throw new ExpressionErrorException(sprintf('Attribute matcher operator "%s" not supported.', $operator));
- + }
- +
- + return call_user_func($this->attributeMatchingTranslators[$operator], $xpath, $attribute, $value);
- + }
- +
- + /**
- + * @param string $css
- + *
- + * @return SelectorNode[]
- + */
- + private function parseSelectors($css)
- + {
- + foreach ($this->shortcutParsers as $shortcut) {
- + $tokens = $shortcut->parse($css);
- +
- + if (!empty($tokens)) {
- + return $tokens;
- + }
- + }
- +
- + return $this->mainParser->parse($css);
- + }
- +}
- diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/XPathExpr.php sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/XPathExpr.php
- --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/XPathExpr.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/XPathExpr.php 2014-11-19 15:54:07.884099986 +0100
- @@ -0,0 +1,140 @@
- +<?php
- +
- +/*
- + * This file is part of the Symfony package.
- + *
- + * (c) Fabien Potencier <fabien@symfony.com>
- + *
- + * For the full copyright and license information, please view the LICENSE
- + * file that was distributed with this source code.
- + */
- +
- +namespace Symfony\Component\CssSelector\XPath;
- +
- +/**
- + * XPath expression translator interface.
- + *
- + * This component is a port of the Python cssselector library,
- + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
- + *
- + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
- + */
- +class XPathExpr
- +{
- + /**
- + * @var string
- + */
- + private $path;
- +
- + /**
- + * @var string
- + */
- + private $element;
- +
- + /**
- + * @var string
- + */
- + private $condition;
- +
- + /**
- + * @param string $path
- + * @param string $element
- + * @param string $condition
- + * @param bool $starPrefix
- + */
- + public function __construct($path = '', $element = '*', $condition = '', $starPrefix = false)
- + {
- + $this->path = $path;
- + $this->element = $element;
- + $this->condition = $condition;
- +
- + if ($starPrefix) {
- + $this->addStarPrefix();
- + }
- + }
- +
- + /**
- + * @return string
- + */
- + public function getElement()
- + {
- + return $this->element;
- + }
- +
- + /**
- + * @param $condition
- + *
- + * @return XPathExpr
- + */
- + public function addCondition($condition)
- + {
- + $this->condition = $this->condition ? sprintf('%s and (%s)', $this->condition, $condition) : $condition;
- +
- + return $this;
- + }
- +
- + /**
- + * @return string
- + */
- + public function getCondition()
- + {
- + return $this->condition;
- + }
- +
- + /**
- + * @return XPathExpr
- + */
- + public function addNameTest()
- + {
- + if ('*' !== $this->element) {
- + $this->addCondition('name() = '.Translator::getXpathLiteral($this->element));
- + $this->element = '*';
- + }
- +
- + return $this;
- + }
- +
- + /**
- + * @return XPathExpr
- + */
- + public function addStarPrefix()
- + {
- + $this->path .= '*/';
- +
- + return $this;
- + }
- +
- + /**
- + * Joins another XPathExpr with a combiner.
- + *
- + * @param string $combiner
- + * @param XPathExpr $expr
- + *
- + * @return XPathExpr
- + */
- + public function join($combiner, XPathExpr $expr)
- + {
- + $path = $this->__toString().$combiner;
- +
- + if ('*/' !== $expr->path) {
- + $path .= $expr->path;
- + }
- +
- + $this->path = $path;
- + $this->element = $expr->element;
- + $this->condition = $expr->condition;
- +
- + return $this;
- + }
- +
- + /**
- + * @return string
- + */
- + public function __toString()
- + {
- + $path = $this->path.$this->element;
- + $condition = null === $this->condition || '' === $this->condition ? '' : '['.$this->condition.']';
- +
- + return $path.$condition;
- + }
- +}
- diff -uNr sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/composer.json sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/composer.json
- --- sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/composer.json 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/composer.json 2014-11-19 15:53:56.256099915 +0100
- @@ -0,0 +1,31 @@
- +{
- + "name": "tijsverkoyen/css-to-inline-styles",
- + "type": "library",
- + "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.",
- + "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles",
- + "license": "BSD",
- + "authors": [
- + {
- + "name": "Tijs Verkoyen",
- + "email": "css_to_inline_styles@verkoyen.eu",
- + "role": "Developer"
- + }
- + ],
- + "require": {
- + "php": ">=5.3.0",
- + "symfony/css-selector": "~2.1"
- + },
- + "require-dev": {
- + "phpunit/phpunit": "~4.0"
- + },
- + "autoload": {
- + "psr-4": {
- + "TijsVerkoyen\\CssToInlineStyles\\": "src"
- + }
- + },
- + "extra": {
- + "branch-alias": {
- + "dev-master": "1.5.x-dev"
- + }
- + }
- +}
- diff -uNr sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/LICENSE.md sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/LICENSE.md
- --- sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/LICENSE.md 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/LICENSE.md 2014-11-19 15:53:57.252099922 +0100
- @@ -0,0 +1,22 @@
- +Copyright (c) Tijs Verkoyen. All rights reserved.
- +Redistribution and use in source and binary forms, with or without
- +modification, are permitted provided that the following conditions are met:
- +
- +1. Redistributions of source code must retain the above copyright notice, this
- + list of conditions and the following disclaimer.
- +2. Redistributions in binary form must reproduce the above copyright notice,
- + this list of conditions and the following disclaimer in the documentation
- + and/or other materials provided with the distribution.
- +3. The name of the author may not be used to endorse or promote products
- + derived from this software without specific prior written permission.
- +
- +This software is provided by the author "as is" and any express or implied
- +warranties, including, but not limited to, the implied warranties of
- +merchantability and fitness for a particular purpose are disclaimed. In no event
- +shall the author be liable for any direct, indirect, incidental, special,
- +exemplary, or consequential damages (including, but not limited to, procurement
- +of substitute goods or services; loss of use, data, or profits; or business
- +interruption) however caused and on any theory of liability, whether in
- +contract, strict liability, or tort (including negligence or otherwise) arising
- +in any way out of the use of this software, even if advised of the possibility
- +of such damage.
- diff -uNr sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/src/CssToInlineStyles.php sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/src/CssToInlineStyles.php
- --- sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/src/CssToInlineStyles.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/src/CssToInlineStyles.php 2014-11-19 15:53:56.768099919 +0100
- @@ -0,0 +1,670 @@
- +<?php
- +namespace TijsVerkoyen\CssToInlineStyles;
- +
- +use Symfony\Component\CssSelector\CssSelector;
- +use Symfony\Component\CssSelector\Exception\ExceptionInterface;
- +
- +/**
- + * CSS to Inline Styles class
- + *
- + * @author Tijs Verkoyen <php-css-to-inline-styles@verkoyen.eu>
- + * @version 1.5.2
- + * @copyright Copyright (c), Tijs Verkoyen. All rights reserved.
- + * @license BSD License
- + */
- +class CssToInlineStyles
- +{
- + /**
- + * The CSS to use
- + *
- + * @var string
- + */
- + private $css;
- +
- + /**
- + * The processed CSS rules
- + *
- + * @var array
- + */
- + private $cssRules;
- +
- + /**
- + * Should the generated HTML be cleaned
- + *
- + * @var bool
- + */
- + private $cleanup = false;
- +
- + /**
- + * The encoding to use.
- + *
- + * @var string
- + */
- + private $encoding = 'UTF-8';
- +
- + /**
- + * The HTML to process
- + *
- + * @var string
- + */
- + private $html;
- +
- + /**
- + * Use inline-styles block as CSS
- + *
- + * @var bool
- + */
- + private $useInlineStylesBlock = false;
- +
- + /**
- + * Strip original style tags
- + *
- + * @var bool
- + */
- + private $stripOriginalStyleTags = false;
- +
- + /**
- + * Exclude the media queries from the inlined styles
- + *
- + * @var bool
- + */
- + private $excludeMediaQueries = true;
- +
- + /**
- + * Creates an instance, you could set the HTML and CSS here, or load it
- + * later.
- + *
- + * @return void
- + * @param string [optional] $html The HTML to process.
- + * @param string [optional] $css The CSS to use.
- + */
- + public function __construct($html = null, $css = null)
- + {
- + if ($html !== null) {
- + $this->setHTML($html);
- + }
- + if ($css !== null) {
- + $this->setCSS($css);
- + }
- + }
- +
- + /**
- + * Cleanup the generated HTML
- + *
- + * @return string
- + * @param string $html The HTML to cleanup.
- + */
- + private function cleanupHTML($html)
- + {
- + // remove classes
- + $html = preg_replace('/(\s)+class="(.*)"(\s)*/U', ' ', $html);
- +
- + // remove IDs
- + $html = preg_replace('/(\s)+id="(.*)"(\s)*/U', ' ', $html);
- +
- + // return
- + return $html;
- + }
- +
- + /**
- + * Converts the loaded HTML into an HTML-string with inline styles based on the loaded CSS
- + *
- + * @return string
- + * @param bool [optional] $outputXHTML Should we output valid XHTML?
- + */
- + public function convert($outputXHTML = false)
- + {
- + // redefine
- + $outputXHTML = (bool) $outputXHTML;
- +
- + // validate
- + if ($this->html == null) {
- + throw new Exception('No HTML provided.');
- + }
- +
- + // should we use inline style-block
- + if ($this->useInlineStylesBlock) {
- + // init var
- + $matches = array();
- +
- + // match the style blocks
- + preg_match_all('|<style(.*)>(.*)</style>|isU', $this->html, $matches);
- +
- + // any style-blocks found?
- + if (!empty($matches[2])) {
- + // add
- + foreach ($matches[2] as $match) {
- + $this->css .= trim($match) . "\n";
- + }
- + }
- + }
- +
- + // process css
- + $this->processCSS();
- +
- + // create new DOMDocument
- + $document = new \DOMDocument('1.0', $this->getEncoding());
- +
- + // set error level
- + libxml_use_internal_errors(true);
- +
- + // load HTML
- + $document->loadHTML($this->html);
- +
- + // create new XPath
- + $xPath = new \DOMXPath($document);
- +
- + // any rules?
- + if (!empty($this->cssRules)) {
- + // loop rules
- + foreach ($this->cssRules as $rule) {
- + try {
- + $query = CssSelector::toXPath($rule['selector']);
- + } catch (ExceptionInterface $e) {
- + continue;
- + }
- +
- + // search elements
- + $elements = $xPath->query($query);
- +
- + // validate elements
- + if ($elements === false) {
- + continue;
- + }
- +
- + // loop found elements
- + foreach ($elements as $element) {
- + // no styles stored?
- + if ($element->attributes->getNamedItem(
- + 'data-css-to-inline-styles-original-styles'
- + ) == null
- + ) {
- + // init var
- + $originalStyle = '';
- + if ($element->attributes->getNamedItem('style') !== null) {
- + $originalStyle = $element->attributes->getNamedItem('style')->value;
- + }
- +
- + // store original styles
- + $element->setAttribute(
- + 'data-css-to-inline-styles-original-styles',
- + $originalStyle
- + );
- +
- + // clear the styles
- + $element->setAttribute('style', '');
- + }
- +
- + // init var
- + $properties = array();
- +
- + // get current styles
- + $stylesAttribute = $element->attributes->getNamedItem('style');
- +
- + // any styles defined before?
- + if ($stylesAttribute !== null) {
- + // get value for the styles attribute
- + $definedStyles = (string) $stylesAttribute->value;
- +
- + // split into properties
- + $definedProperties = (array) explode(';', $definedStyles);
- +
- + // loop properties
- + foreach ($definedProperties as $property) {
- + // validate property
- + if ($property == '') {
- + continue;
- + }
- +
- + // split into chunks
- + $chunks = (array) explode(':', trim($property), 2);
- +
- + // validate
- + if (!isset($chunks[1])) {
- + continue;
- + }
- +
- + // loop chunks
- + $properties[$chunks[0]] = trim($chunks[1]);
- + }
- + }
- +
- + // add new properties into the list
- + foreach ($rule['properties'] as $key => $value) {
- + // If one of the rules is already set and is !important, don't apply it,
- + // except if the new rule is also important.
- + if (
- + !isset($properties[$key])
- + || stristr($properties[$key], '!important') === false
- + || (stristr(implode('', $value), '!important') !== false)
- + ) {
- + $properties[$key] = $value;
- + }
- + }
- +
- + // build string
- + $propertyChunks = array();
- +
- + // build chunks
- + foreach ($properties as $key => $values) {
- + foreach ((array) $values as $value) {
- + $propertyChunks[] = $key . ': ' . $value . ';';
- + }
- + }
- +
- + // build properties string
- + $propertiesString = implode(' ', $propertyChunks);
- +
- + // set attribute
- + if ($propertiesString != '') {
- + $element->setAttribute('style', $propertiesString);
- + }
- + }
- + }
- +
- + // reapply original styles
- + // search elements
- + $elements = $xPath->query('//*[@data-css-to-inline-styles-original-styles]');
- +
- + // loop found elements
- + foreach ($elements as $element) {
- + // get the original styles
- + $originalStyle = $element->attributes->getNamedItem(
- + 'data-css-to-inline-styles-original-styles'
- + )->value;
- +
- + if ($originalStyle != '') {
- + $originalProperties = array();
- + $originalStyles = (array) explode(';', $originalStyle);
- +
- + foreach ($originalStyles as $property) {
- + // validate property
- + if ($property == '') {
- + continue;
- + }
- +
- + // split into chunks
- + $chunks = (array) explode(':', trim($property), 2);
- +
- + // validate
- + if (!isset($chunks[1])) {
- + continue;
- + }
- +
- + // loop chunks
- + $originalProperties[$chunks[0]] = trim($chunks[1]);
- + }
- +
- + // get current styles
- + $stylesAttribute = $element->attributes->getNamedItem('style');
- + $properties = array();
- +
- + // any styles defined before?
- + if ($stylesAttribute !== null) {
- + // get value for the styles attribute
- + $definedStyles = (string) $stylesAttribute->value;
- +
- + // split into properties
- + $definedProperties = (array) explode(';', $definedStyles);
- +
- + // loop properties
- + foreach ($definedProperties as $property) {
- + // validate property
- + if ($property == '') {
- + continue;
- + }
- +
- + // split into chunks
- + $chunks = (array) explode(':', trim($property), 2);
- +
- + // validate
- + if (!isset($chunks[1])) {
- + continue;
- + }
- +
- + // loop chunks
- + $properties[$chunks[0]] = trim($chunks[1]);
- + }
- + }
- +
- + // add new properties into the list
- + foreach ($originalProperties as $key => $value) {
- + $properties[$key] = $value;
- + }
- +
- + // build string
- + $propertyChunks = array();
- +
- + // build chunks
- + foreach ($properties as $key => $values) {
- + foreach ((array) $values as $value) {
- + $propertyChunks[] = $key . ': ' . $value . ';';
- + }
- + }
- +
- + // build properties string
- + $propertiesString = implode(' ', $propertyChunks);
- +
- + // set attribute
- + if ($propertiesString != '') {
- + $element->setAttribute(
- + 'style',
- + $propertiesString
- + );
- + }
- + }
- +
- + // remove placeholder
- + $element->removeAttribute(
- + 'data-css-to-inline-styles-original-styles'
- + );
- + }
- + }
- +
- + // strip original style tags if we need to
- + if ($this->stripOriginalStyleTags) {
- + $this->stripOriginalStyleTags($xPath);
- + }
- +
- + // should we output XHTML?
- + if ($outputXHTML) {
- + // set formating
- + $document->formatOutput = true;
- +
- + // get the HTML as XML
- + $html = $document->saveXML(null, LIBXML_NOEMPTYTAG);
- +
- + // get start of the XML-declaration
- + $startPosition = strpos($html, '<?xml');
- +
- + // valid start position?
- + if ($startPosition !== false) {
- + // get end of the xml-declaration
- + $endPosition = strpos($html, '?>', $startPosition);
- +
- + // remove the XML-header
- + $html = ltrim(substr($html, $endPosition + 1));
- + }
- + } // just regular HTML 4.01 as it should be used in newsletters
- + else {
- + // get the HTML
- + $html = $document->saveHTML();
- + }
- +
- + // cleanup the HTML if we need to
- + if ($this->cleanup) {
- + $html = $this->cleanupHTML($html);
- + }
- +
- + // return
- + return $html;
- + }
- +
- + /**
- + * Get the encoding to use
- + *
- + * @return string
- + */
- + private function getEncoding()
- + {
- + return $this->encoding;
- + }
- +
- + /**
- + * Process the loaded CSS
- + *
- + * @return void
- + */
- + private function processCSS()
- + {
- + // init vars
- + $css = (string) $this->css;
- +
- + // remove newlines
- + $css = str_replace(array("\r", "\n"), '', $css);
- +
- + // replace double quotes by single quotes
- + $css = str_replace('"', '\'', $css);
- +
- + // remove comments
- + $css = preg_replace('|/\*.*?\*/|', '', $css);
- +
- + // remove spaces
- + $css = preg_replace('/\s\s+/', ' ', $css);
- +
- + if ($this->excludeMediaQueries) {
- + $css = preg_replace('/@media [^{]*{([^{}]|{[^{}]*})*}/', '', $css);
- + }
- +
- + // rules are splitted by }
- + $rules = (array) explode('}', $css);
- +
- + // init var
- + $i = 1;
- +
- + // loop rules
- + foreach ($rules as $rule) {
- + // split into chunks
- + $chunks = explode('{', $rule);
- +
- + // invalid rule?
- + if (!isset($chunks[1])) {
- + continue;
- + }
- +
- + // set the selectors
- + $selectors = trim($chunks[0]);
- +
- + // get cssProperties
- + $cssProperties = trim($chunks[1]);
- +
- + // split multiple selectors
- + $selectors = (array) explode(',', $selectors);
- +
- + // loop selectors
- + foreach ($selectors as $selector) {
- + // cleanup
- + $selector = trim($selector);
- +
- + // build an array for each selector
- + $ruleSet = array();
- +
- + // store selector
- + $ruleSet['selector'] = $selector;
- +
- + // process the properties
- + $ruleSet['properties'] = $this->processCSSProperties(
- + $cssProperties
- + );
- +
- + // calculate specificity
- + $ruleSet['specificity'] = Specificity::fromSelector($selector);
- +
- + // remember the order in which the rules appear
- + $ruleSet['order'] = $i;
- +
- + // add into global rules
- + $this->cssRules[] = $ruleSet;
- + }
- +
- + // increment
- + $i++;
- + }
- +
- + // sort based on specificity
- + if (!empty($this->cssRules)) {
- + usort($this->cssRules, array(__CLASS__, 'sortOnSpecificity'));
- + }
- + }
- +
- + /**
- + * Process the CSS-properties
- + *
- + * @return array
- + * @param string $propertyString The CSS-properties.
- + */
- + private function processCSSProperties($propertyString)
- + {
- + // split into chunks
- + $properties = (array) explode(';', $propertyString);
- +
- + // init var
- + $pairs = array();
- +
- + // loop properties
- + foreach ($properties as $property) {
- + // split into chunks
- + $chunks = (array) explode(':', $property, 2);
- +
- + // validate
- + if (!isset($chunks[1])) {
- + continue;
- + }
- +
- + // cleanup
- + $chunks[0] = trim($chunks[0]);
- + $chunks[1] = trim($chunks[1]);
- +
- + // add to pairs array
- + if (!isset($pairs[$chunks[0]]) ||
- + !in_array($chunks[1], $pairs[$chunks[0]])
- + ) {
- + $pairs[$chunks[0]][] = $chunks[1];
- + }
- + }
- +
- + // sort the pairs
- + ksort($pairs);
- +
- + // return
- + return $pairs;
- + }
- +
- + /**
- + * Should the IDs and classes be removed?
- + *
- + * @return void
- + * @param bool [optional] $on Should we enable cleanup?
- + */
- + public function setCleanup($on = true)
- + {
- + $this->cleanup = (bool) $on;
- + }
- +
- + /**
- + * Set CSS to use
- + *
- + * @return void
- + * @param string $css The CSS to use.
- + */
- + public function setCSS($css)
- + {
- + $this->css = (string) $css;
- + }
- +
- + /**
- + * Set the encoding to use with the DOMDocument
- + *
- + * @return void
- + * @param string $encoding The encoding to use.
- + *
- + * @deprecated Doesn't have any effect
- + */
- + public function setEncoding($encoding)
- + {
- + $this->encoding = (string) $encoding;
- + }
- +
- + /**
- + * Set HTML to process
- + *
- + * @return void
- + * @param string $html The HTML to process.
- + */
- + public function setHTML($html)
- + {
- + $this->html = (string) $html;
- + }
- +
- + /**
- + * Set use of inline styles block
- + * If this is enabled the class will use the style-block in the HTML.
- + *
- + * @return void
- + * @param bool [optional] $on Should we process inline styles?
- + */
- + public function setUseInlineStylesBlock($on = true)
- + {
- + $this->useInlineStylesBlock = (bool) $on;
- + }
- +
- + /**
- + * Set strip original style tags
- + * If this is enabled the class will remove all style tags in the HTML.
- + *
- + * @return void
- + * @param bool [optional] $on Should we process inline styles?
- + */
- + public function setStripOriginalStyleTags($on = true)
- + {
- + $this->stripOriginalStyleTags = (bool) $on;
- + }
- +
- + /**
- + * Set exclude media queries
- + *
- + * If this is enabled the media queries will be removed before inlining the rules
- + *
- + * @return void
- + * @param bool [optional] $on
- + */
- + public function setExcludeMediaQueries($on = true)
- + {
- + $this->excludeMediaQueries = (bool) $on;
- + }
- +
- + /**
- + * Strip style tags into the generated HTML
- + *
- + * @return string
- + * @param \DOMXPath $xPath The DOMXPath for the entire document.
- + */
- + private function stripOriginalStyleTags(\DOMXPath $xPath)
- + {
- + // Get all style tags
- + $nodes = $xPath->query('descendant-or-self::style');
- +
- + foreach ($nodes as $node) {
- + if ($this->excludeMediaQueries) {
- + //Search for Media Queries
- + preg_match_all('/@media [^{]*{([^{}]|{[^{}]*})*}/', $node->nodeValue, $mqs);
- +
- + // Replace the nodeValue with just the Media Queries
- + $node->nodeValue = implode("\n", $mqs[0]);
- + } else {
- + // Remove the entire style tag
- + $node->parentNode->removeChild($node);
- + }
- + }
- + }
- +
- + /**
- + * Sort an array on the specificity element
- + *
- + * @return int
- + * @param array $e1 The first element.
- + * @param array $e2 The second element.
- + */
- + private static function sortOnSpecificity($e1, $e2)
- + {
- + // Compare the specificity
- + $value = $e1['specificity']->compareTo($e2['specificity']);
- +
- + // if the specificity is the same, use the order in which the element appeared
- + if ($value === 0) {
- + $value = $e1['order'] - $e2['order'];
- + }
- +
- + return $value;
- + }
- +}
- diff -uNr sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Exception.php sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Exception.php
- --- sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Exception.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Exception.php 2014-11-19 15:53:57.088099921 +0100
- @@ -0,0 +1,11 @@
- +<?php
- +namespace TijsVerkoyen\CssToInlineStyles;
- +
- +/**
- + * CssToInlineStyles Exception class
- + *
- + * @author Tijs Verkoyen <php-css-to-inline-styles@verkoyen.eu>
- + */
- +class Exception extends \Exception
- +{
- +}
- diff -uNr sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Specificity.php sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Specificity.php
- --- sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Specificity.php 1970-01-01 01:00:00.000000000 +0100
- +++ sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Specificity.php 2014-11-19 15:53:56.928099920 +0100
- @@ -0,0 +1,133 @@
- +<?php
- +namespace TijsVerkoyen\CssToInlineStyles;
- +
- +/**
- + * CSS to Inline Styles Specificity class.
- + *
- + * Compare specificity based on the CSS3 spec.
- + *
- + * @see http://www.w3.org/TR/selectors/#specificity
- + *
- + */
- +class Specificity
- +{
- +
- + /**
- + * The number of ID selectors in the selector
- + *
- + * @var int
- + */
- + private $a;
- +
- + /**
- + *
- + * The number of class selectors, attributes selectors, and pseudo-classes in the selector
- + *
- + * @var int
- + */
- + private $b;
- +
- + /**
- + * The number of type selectors and pseudo-elements in the selector
- + *
- + * @var int
- + */
- + private $c;
- +
- + /**
- + * @param int $a The number of ID selectors in the selector
- + * @param int $b The number of class selectors, attributes selectors, and pseudo-classes in the selector
- + * @param int $c The number of type selectors and pseudo-elements in the selector
- + */
- + public function __construct($a = 0, $b = 0, $c = 0)
- + {
- + $this->a = $a;
- + $this->b = $b;
- + $this->c = $c;
- + }
- +
- + /**
- + * Increase the current specificity by adding the three values
- + *
- + * @param int $a The number of ID selectors in the selector
- + * @param int $b The number of class selectors, attributes selectors, and pseudo-classes in the selector
- + * @param int $c The number of type selectors and pseudo-elements in the selector
- + */
- + public function increase($a, $b, $c)
- + {
- + $this->a += $a;
- + $this->b += $b;
- + $this->c += $c;
- + }
- +
- + /**
- + * Get the specificity values as an array
- + *
- + * @return array
- + */
- + public function getValues()
- + {
- + return array($this->a, $this->b, $this->c);
- + }
- +
- + /**
- + * Calculate the specificity based on a CSS Selector string,
- + * Based on the patterns from premailer/css_parser by Alex Dunae
- + *
- + * @see https://github.com/premailer/css_parser/blob/master/lib/css_parser/regexps.rb
- + * @param string $selector
- + * @return static
- + */
- + public static function fromSelector($selector)
- + {
- + $pattern_a = " \#";
- + $pattern_b = " (\.[\w]+) # classes
- + |
- + \[(\w+) # attributes
- + |
- + (\:( # pseudo classes
- + link|visited|active
- + |hover|focus
- + |lang
- + |target
- + |enabled|disabled|checked|indeterminate
- + |root
- + |nth-child|nth-last-child|nth-of-type|nth-last-of-type
- + |first-child|last-child|first-of-type|last-of-type
- + |only-child|only-of-type
- + |empty|contains
- + ))";
- +
- + $pattern_c = " ((^|[\s\+\>\~]+)[\w]+ # elements
- + |
- + \:{1,2}( # pseudo-elements
- + after|before
- + |first-letter|first-line
- + |selection
- + )
- + )";
- +
- + return new static(
- + preg_match_all("/{$pattern_a}/ix", $selector, $matches),
- + preg_match_all("/{$pattern_b}/ix", $selector, $matches),
- + preg_match_all("/{$pattern_c}/ix", $selector, $matches)
- + );
- + }
- +
- + /**
- + * Returns <0 when $specificity is greater, 0 when equal, >0 when smaller
- + *
- + * @param Specificity $specificity
- + * @return int
- + */
- + public function compareTo(Specificity $specificity)
- + {
- + if ($this->a !== $specificity->a) {
- + return $this->a - $specificity->a;
- + } elseif ($this->b !== $specificity->b) {
- + return $this->b - $specificity->b;
- + } else {
- + return $this->c - $specificity->c;
- + }
- + }
- +}
- diff -uNr sendy/scheduled.php sendy-modified/scheduled.php
- --- sendy/scheduled.php 2014-08-14 14:10:12.000000000 +0200
- +++ sendy-modified/scheduled.php 2014-11-19 15:52:49.760099513 +0100
- @@ -1,5 +1,6 @@
- <?php ini_set('display_errors', 0);?>
- <?php include('includes/helpers/class.phpmailer.php');?>
- +<?php include('includes/inline_css.php');?>
- <?php
- include('includes/config.php');
- //--------------------------------------------------------------//
- @@ -482,8 +483,10 @@
- $plain_treated = str_replace($unconverted_date, $converted_date, $plain_treated);
- $title_treated = str_replace($unconverted_date, $converted_date, $title_treated);
- + $html_treated = inline_css($html_treated);
- +
- //add tracking 1 by 1px image
- - $html_treated .= '<img src="'.APP_PATH.'/t/'.short($campaign_id).'/'.short($subscriber_id).'" alt=""/>';
- + $html_treated .= '<img src="'.APP_PATH.'/t/'.short($campaign_id).'/'.short($subscriber_id).'" alt="" width="1" height="1"/>';
- //Get server path
- $server_path_array = explode('scheduled.php', $_SERVER['SCRIPT_FILENAME']);
- @@ -825,4 +828,4 @@
- }
- }
- }
- -?>
- \ No newline at end of file
- +?>
- diff -uNr sendy/w.php sendy-modified/w.php
- --- sendy/w.php 2014-03-25 01:00:14.000000000 +0100
- +++ sendy-modified/w.php 2014-11-19 15:52:51.276099522 +0100
- @@ -1,6 +1,7 @@
- <?php
- ini_set('display_errors', 0);
- include('includes/config.php');
- + include('includes/inline_css.php');
- //--------------------------------------------------------------//
- function dbConnect() { //Connect to database
- //--------------------------------------------------------------//
- @@ -118,7 +119,7 @@
- //convert date tags
- convert_date_tags();
- - echo $html;
- + echo inline_css($html);
- exit;
- }
- }
- @@ -306,5 +307,5 @@
- $r = mysqli_query($mysqli, $q);
- if ($r){}
- - echo $html;
- -?>
- \ No newline at end of file
- + echo inline_css($html);
- +?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement