Advertisement
Guest User

inlineCss.patch

a guest
Nov 19th, 2014
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 366.86 KB | None | 0 0
  1. This patch adds inline css functionality to sendy (1.1.9.5).
  2. Thanks to tijsverkoyen for his great inline css class: https://github.com/tijsverkoyen/CssToInlineStyles
  3. Also thanks to Fabien Potencier and his team (Symfony) for being awesome: http://symfony.com/
  4. Patch by Kai Fricke <kai@kaifricke.com>
  5.  
  6. diff -uNr sendy/includes/create/send-now.php sendy-modified/includes/create/send-now.php
  7. --- sendy/includes/create/send-now.php  2014-08-05 16:29:00.000000000 +0200
  8. +++ sendy-modified/includes/create/send-now.php 2014-11-19 15:53:34.812099786 +0100
  9. @@ -2,6 +2,7 @@
  10.  <?php include('../login/auth.php');?>
  11.  <?php include('../helpers/class.phpmailer.php');?>
  12.  <?php include('../helpers/short.php');?>
  13. +<?php include('../inline_css.php');?>
  14.  <?php
  15.    
  16.  //variables
  17. @@ -463,9 +464,11 @@
  18.         $html_treated = str_replace($unconverted_date, $converted_date, $html_treated);
  19.         $plain_treated = str_replace($unconverted_date, $converted_date, $plain_treated);
  20.         $title_treated = str_replace($unconverted_date, $converted_date, $title_treated);
  21. +
  22. +        $html_treated = inline_css($html_treated);
  23.        
  24.         //add tracking 1 by 1px image
  25. -       $html_treated .= '<img src="'.get_app_info('path').'/t/'.short($campaign_id).'/'.short($subscriber_id).'" alt=""/>';
  26. +       $html_treated .= '<img src="'.APP_PATH.'/t/'.short($campaign_id).'/'.short($subscriber_id).'" alt="" width="1" height="1"/>';
  27.        
  28.         //send email
  29.         $mail = new PHPMailer();
  30. diff -uNr sendy/includes/create/test-send.php sendy-modified/includes/create/test-send.php
  31. --- sendy/includes/create/test-send.php 2014-04-03 15:57:48.000000000 +0200
  32. +++ sendy-modified/includes/create/test-send.php    2014-11-19 15:53:35.572099790 +0100
  33. @@ -1,6 +1,7 @@
  34.  <?php include('../functions.php');?>
  35.  <?php include('../login/auth.php');?>
  36.  <?php include('../helpers/class.phpmailer.php');?>
  37. +<?php include('../inline_css.php');?>
  38.  <?php
  39.  
  40.  //POST variables
  41. @@ -122,6 +123,8 @@
  42.     $html_text2 = str_replace('[Email]', $test_email_array[$i], $html_text);
  43.     $plain_text2 = str_replace('[Email]', $test_email_array[$i], $plain_text);
  44.     $title2 = str_replace('[Email]', $test_email_array[$i], $title);
  45. +
  46. +    $html_text2 = inline_css($html_text2);
  47.    
  48.     //send test email
  49.     $mail = new PHPMailer();
  50. @@ -171,4 +174,4 @@
  51.     mysqli_query($mysqli, 'UPDATE apps SET test_email = "'.$test_email.'" WHERE id = '.$app);
  52.  }
  53.  
  54. -?>
  55. \ No newline at end of file
  56. +?>
  57. diff -uNr sendy/includes/inline_css.php sendy-modified/includes/inline_css.php
  58. --- sendy/includes/inline_css.php   1970-01-01 01:00:00.000000000 +0100
  59. +++ sendy-modified/includes/inline_css.php  2014-11-19 15:53:12.988099654 +0100
  60. @@ -0,0 +1,14 @@
  61. +<?php
  62. +
  63. +require_once __DIR__ . '/vendor/autoload.php';
  64. +use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;
  65. +
  66. +function inline_css($html) {
  67. +    $inliner = new CssToInlineStyles();
  68. +
  69. +    $inliner->setHTML($html);
  70. +    $inliner->setUseInlineStylesBlock(true);
  71. +
  72. +    return $inliner->convert();
  73. +
  74. +}
  75. diff -uNr sendy/includes/vendor/autoload.php sendy-modified/includes/vendor/autoload.php
  76. --- sendy/includes/vendor/autoload.php  1970-01-01 01:00:00.000000000 +0100
  77. +++ sendy-modified/includes/vendor/autoload.php 2014-11-19 15:54:31.644100130 +0100
  78. @@ -0,0 +1,7 @@
  79. +<?php
  80. +
  81. +// autoload.php @generated by Composer
  82. +
  83. +require_once __DIR__ . '/composer' . '/autoload_real.php';
  84. +
  85. +return ComposerAutoloaderInit8df2fcf8c38bde27d6e06ea05b60660d::getLoader();
  86. diff -uNr sendy/includes/vendor/composer/autoload_classmap.php sendy-modified/includes/vendor/composer/autoload_classmap.php
  87. --- sendy/includes/vendor/composer/autoload_classmap.php    1970-01-01 01:00:00.000000000 +0100
  88. +++ sendy-modified/includes/vendor/composer/autoload_classmap.php   2014-11-19 15:53:57.904099925 +0100
  89. @@ -0,0 +1,9 @@
  90. +<?php
  91. +
  92. +// autoload_classmap.php @generated by Composer
  93. +
  94. +$vendorDir = dirname(dirname(__FILE__));
  95. +$baseDir = dirname($vendorDir);
  96. +
  97. +return array(
  98. +);
  99. diff -uNr sendy/includes/vendor/composer/autoload_namespaces.php sendy-modified/includes/vendor/composer/autoload_namespaces.php
  100. --- sendy/includes/vendor/composer/autoload_namespaces.php  1970-01-01 01:00:00.000000000 +0100
  101. +++ sendy-modified/includes/vendor/composer/autoload_namespaces.php 2014-11-19 15:53:58.536099929 +0100
  102. @@ -0,0 +1,10 @@
  103. +<?php
  104. +
  105. +// autoload_namespaces.php @generated by Composer
  106. +
  107. +$vendorDir = dirname(dirname(__FILE__));
  108. +$baseDir = dirname($vendorDir);
  109. +
  110. +return array(
  111. +    'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'),
  112. +);
  113. diff -uNr sendy/includes/vendor/composer/autoload_psr4.php sendy-modified/includes/vendor/composer/autoload_psr4.php
  114. --- sendy/includes/vendor/composer/autoload_psr4.php    1970-01-01 01:00:00.000000000 +0100
  115. +++ sendy-modified/includes/vendor/composer/autoload_psr4.php   2014-11-19 15:53:58.380099928 +0100
  116. @@ -0,0 +1,10 @@
  117. +<?php
  118. +
  119. +// autoload_psr4.php @generated by Composer
  120. +
  121. +$vendorDir = dirname(dirname(__FILE__));
  122. +$baseDir = dirname($vendorDir);
  123. +
  124. +return array(
  125. +    'TijsVerkoyen\\CssToInlineStyles\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'),
  126. +);
  127. diff -uNr sendy/includes/vendor/composer/autoload_real.php sendy-modified/includes/vendor/composer/autoload_real.php
  128. --- sendy/includes/vendor/composer/autoload_real.php    1970-01-01 01:00:00.000000000 +0100
  129. +++ sendy-modified/includes/vendor/composer/autoload_real.php   2014-11-19 15:53:58.060099926 +0100
  130. @@ -0,0 +1,50 @@
  131. +<?php
  132. +
  133. +// autoload_real.php @generated by Composer
  134. +
  135. +class ComposerAutoloaderInit8df2fcf8c38bde27d6e06ea05b60660d
  136. +{
  137. +    private static $loader;
  138. +
  139. +    public static function loadClassLoader($class)
  140. +    {
  141. +        if ('Composer\Autoload\ClassLoader' === $class) {
  142. +            require __DIR__ . '/ClassLoader.php';
  143. +        }
  144. +    }
  145. +
  146. +    public static function getLoader()
  147. +    {
  148. +        if (null !== self::$loader) {
  149. +            return self::$loader;
  150. +        }
  151. +
  152. +        spl_autoload_register(array('ComposerAutoloaderInit8df2fcf8c38bde27d6e06ea05b60660d', 'loadClassLoader'), true, true);
  153. +        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
  154. +        spl_autoload_unregister(array('ComposerAutoloaderInit8df2fcf8c38bde27d6e06ea05b60660d', 'loadClassLoader'));
  155. +
  156. +        $map = require __DIR__ . '/autoload_namespaces.php';
  157. +        foreach ($map as $namespace => $path) {
  158. +            $loader->set($namespace, $path);
  159. +        }
  160. +
  161. +        $map = require __DIR__ . '/autoload_psr4.php';
  162. +        foreach ($map as $namespace => $path) {
  163. +            $loader->setPsr4($namespace, $path);
  164. +        }
  165. +
  166. +        $classMap = require __DIR__ . '/autoload_classmap.php';
  167. +        if ($classMap) {
  168. +            $loader->addClassMap($classMap);
  169. +        }
  170. +
  171. +        $loader->register(true);
  172. +
  173. +        return $loader;
  174. +    }
  175. +}
  176. +
  177. +function composerRequire8df2fcf8c38bde27d6e06ea05b60660d($file)
  178. +{
  179. +    require $file;
  180. +}
  181. diff -uNr sendy/includes/vendor/composer/ClassLoader.php sendy-modified/includes/vendor/composer/ClassLoader.php
  182. --- sendy/includes/vendor/composer/ClassLoader.php  1970-01-01 01:00:00.000000000 +0100
  183. +++ sendy-modified/includes/vendor/composer/ClassLoader.php 2014-11-19 15:53:57.744099924 +0100
  184. @@ -0,0 +1,383 @@
  185. +<?php
  186. +
  187. +/*
  188. + * This file is part of Composer.
  189. + *
  190. + * (c) Nils Adermann <naderman@naderman.de>
  191. + *     Jordi Boggiano <j.boggiano@seld.be>
  192. + *
  193. + * For the full copyright and license information, please view the LICENSE
  194. + * file that was distributed with this source code.
  195. + */
  196. +
  197. +namespace Composer\Autoload;
  198. +
  199. +/**
  200. + * ClassLoader implements a PSR-0 class loader
  201. + *
  202. + * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
  203. + *
  204. + *     $loader = new \Composer\Autoload\ClassLoader();
  205. + *
  206. + *     // register classes with namespaces
  207. + *     $loader->add('Symfony\Component', __DIR__.'/component');
  208. + *     $loader->add('Symfony',           __DIR__.'/framework');
  209. + *
  210. + *     // activate the autoloader
  211. + *     $loader->register();
  212. + *
  213. + *     // to enable searching the include path (eg. for PEAR packages)
  214. + *     $loader->setUseIncludePath(true);
  215. + *
  216. + * In this example, if you try to use a class in the Symfony\Component
  217. + * namespace or one of its children (Symfony\Component\Console for instance),
  218. + * the autoloader will first look for the class under the component/
  219. + * directory, and it will then fallback to the framework/ directory if not
  220. + * found before giving up.
  221. + *
  222. + * This class is loosely based on the Symfony UniversalClassLoader.
  223. + *
  224. + * @author Fabien Potencier <fabien@symfony.com>
  225. + * @author Jordi Boggiano <j.boggiano@seld.be>
  226. + */
  227. +class ClassLoader
  228. +{
  229. +    // PSR-4
  230. +    private $prefixLengthsPsr4 = array();
  231. +    private $prefixDirsPsr4 = array();
  232. +    private $fallbackDirsPsr4 = array();
  233. +
  234. +    // PSR-0
  235. +    private $prefixesPsr0 = array();
  236. +    private $fallbackDirsPsr0 = array();
  237. +
  238. +    private $useIncludePath = false;
  239. +    private $classMap = array();
  240. +
  241. +    public function getPrefixes()
  242. +    {
  243. +        return call_user_func_array('array_merge', $this->prefixesPsr0);
  244. +    }
  245. +
  246. +    public function getPrefixesPsr4()
  247. +    {
  248. +        return $this->prefixDirsPsr4;
  249. +    }
  250. +
  251. +    public function getFallbackDirs()
  252. +    {
  253. +        return $this->fallbackDirsPsr0;
  254. +    }
  255. +
  256. +    public function getFallbackDirsPsr4()
  257. +    {
  258. +        return $this->fallbackDirsPsr4;
  259. +    }
  260. +
  261. +    public function getClassMap()
  262. +    {
  263. +        return $this->classMap;
  264. +    }
  265. +
  266. +    /**
  267. +     * @param array $classMap Class to filename map
  268. +     */
  269. +    public function addClassMap(array $classMap)
  270. +    {
  271. +        if ($this->classMap) {
  272. +            $this->classMap = array_merge($this->classMap, $classMap);
  273. +        } else {
  274. +            $this->classMap = $classMap;
  275. +        }
  276. +    }
  277. +
  278. +    /**
  279. +     * Registers a set of PSR-0 directories for a given prefix, either
  280. +     * appending or prepending to the ones previously set for this prefix.
  281. +     *
  282. +     * @param string       $prefix  The prefix
  283. +     * @param array|string $paths   The PSR-0 root directories
  284. +     * @param bool         $prepend Whether to prepend the directories
  285. +     */
  286. +    public function add($prefix, $paths, $prepend = false)
  287. +    {
  288. +        if (!$prefix) {
  289. +            if ($prepend) {
  290. +                $this->fallbackDirsPsr0 = array_merge(
  291. +                    (array) $paths,
  292. +                    $this->fallbackDirsPsr0
  293. +                );
  294. +            } else {
  295. +                $this->fallbackDirsPsr0 = array_merge(
  296. +                    $this->fallbackDirsPsr0,
  297. +                    (array) $paths
  298. +                );
  299. +            }
  300. +
  301. +            return;
  302. +        }
  303. +
  304. +        $first = $prefix[0];
  305. +        if (!isset($this->prefixesPsr0[$first][$prefix])) {
  306. +            $this->prefixesPsr0[$first][$prefix] = (array) $paths;
  307. +
  308. +            return;
  309. +        }
  310. +        if ($prepend) {
  311. +            $this->prefixesPsr0[$first][$prefix] = array_merge(
  312. +                (array) $paths,
  313. +                $this->prefixesPsr0[$first][$prefix]
  314. +            );
  315. +        } else {
  316. +            $this->prefixesPsr0[$first][$prefix] = array_merge(
  317. +                $this->prefixesPsr0[$first][$prefix],
  318. +                (array) $paths
  319. +            );
  320. +        }
  321. +    }
  322. +
  323. +    /**
  324. +     * Registers a set of PSR-4 directories for a given namespace, either
  325. +     * appending or prepending to the ones previously set for this namespace.
  326. +     *
  327. +     * @param string       $prefix  The prefix/namespace, with trailing '\\'
  328. +     * @param array|string $paths   The PSR-0 base directories
  329. +     * @param bool         $prepend Whether to prepend the directories
  330. +     *
  331. +     * @throws \InvalidArgumentException
  332. +     */
  333. +    public function addPsr4($prefix, $paths, $prepend = false)
  334. +    {
  335. +        if (!$prefix) {
  336. +            // Register directories for the root namespace.
  337. +            if ($prepend) {
  338. +                $this->fallbackDirsPsr4 = array_merge(
  339. +                    (array) $paths,
  340. +                    $this->fallbackDirsPsr4
  341. +                );
  342. +            } else {
  343. +                $this->fallbackDirsPsr4 = array_merge(
  344. +                    $this->fallbackDirsPsr4,
  345. +                    (array) $paths
  346. +                );
  347. +            }
  348. +        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
  349. +            // Register directories for a new namespace.
  350. +            $length = strlen($prefix);
  351. +            if ('\\' !== $prefix[$length - 1]) {
  352. +                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
  353. +            }
  354. +            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
  355. +            $this->prefixDirsPsr4[$prefix] = (array) $paths;
  356. +        } elseif ($prepend) {
  357. +            // Prepend directories for an already registered namespace.
  358. +            $this->prefixDirsPsr4[$prefix] = array_merge(
  359. +                (array) $paths,
  360. +                $this->prefixDirsPsr4[$prefix]
  361. +            );
  362. +        } else {
  363. +            // Append directories for an already registered namespace.
  364. +            $this->prefixDirsPsr4[$prefix] = array_merge(
  365. +                $this->prefixDirsPsr4[$prefix],
  366. +                (array) $paths
  367. +            );
  368. +        }
  369. +    }
  370. +
  371. +    /**
  372. +     * Registers a set of PSR-0 directories for a given prefix,
  373. +     * replacing any others previously set for this prefix.
  374. +     *
  375. +     * @param string       $prefix The prefix
  376. +     * @param array|string $paths  The PSR-0 base directories
  377. +     */
  378. +    public function set($prefix, $paths)
  379. +    {
  380. +        if (!$prefix) {
  381. +            $this->fallbackDirsPsr0 = (array) $paths;
  382. +        } else {
  383. +            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
  384. +        }
  385. +    }
  386. +
  387. +    /**
  388. +     * Registers a set of PSR-4 directories for a given namespace,
  389. +     * replacing any others previously set for this namespace.
  390. +     *
  391. +     * @param string       $prefix The prefix/namespace, with trailing '\\'
  392. +     * @param array|string $paths  The PSR-4 base directories
  393. +     *
  394. +     * @throws \InvalidArgumentException
  395. +     */
  396. +    public function setPsr4($prefix, $paths)
  397. +    {
  398. +        if (!$prefix) {
  399. +            $this->fallbackDirsPsr4 = (array) $paths;
  400. +        } else {
  401. +            $length = strlen($prefix);
  402. +            if ('\\' !== $prefix[$length - 1]) {
  403. +                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
  404. +            }
  405. +            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
  406. +            $this->prefixDirsPsr4[$prefix] = (array) $paths;
  407. +        }
  408. +    }
  409. +
  410. +    /**
  411. +     * Turns on searching the include path for class files.
  412. +     *
  413. +     * @param bool $useIncludePath
  414. +     */
  415. +    public function setUseIncludePath($useIncludePath)
  416. +    {
  417. +        $this->useIncludePath = $useIncludePath;
  418. +    }
  419. +
  420. +    /**
  421. +     * Can be used to check if the autoloader uses the include path to check
  422. +     * for classes.
  423. +     *
  424. +     * @return bool
  425. +     */
  426. +    public function getUseIncludePath()
  427. +    {
  428. +        return $this->useIncludePath;
  429. +    }
  430. +
  431. +    /**
  432. +     * Registers this instance as an autoloader.
  433. +     *
  434. +     * @param bool $prepend Whether to prepend the autoloader or not
  435. +     */
  436. +    public function register($prepend = false)
  437. +    {
  438. +        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
  439. +    }
  440. +
  441. +    /**
  442. +     * Unregisters this instance as an autoloader.
  443. +     */
  444. +    public function unregister()
  445. +    {
  446. +        spl_autoload_unregister(array($this, 'loadClass'));
  447. +    }
  448. +
  449. +    /**
  450. +     * Loads the given class or interface.
  451. +     *
  452. +     * @param  string    $class The name of the class
  453. +     * @return bool|null True if loaded, null otherwise
  454. +     */
  455. +    public function loadClass($class)
  456. +    {
  457. +        if ($file = $this->findFile($class)) {
  458. +            includeFile($file);
  459. +
  460. +            return true;
  461. +        }
  462. +    }
  463. +
  464. +    /**
  465. +     * Finds the path to the file where the class is defined.
  466. +     *
  467. +     * @param string $class The name of the class
  468. +     *
  469. +     * @return string|false The path if found, false otherwise
  470. +     */
  471. +    public function findFile($class)
  472. +    {
  473. +        // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
  474. +        if ('\\' == $class[0]) {
  475. +            $class = substr($class, 1);
  476. +        }
  477. +
  478. +        // class map lookup
  479. +        if (isset($this->classMap[$class])) {
  480. +            return $this->classMap[$class];
  481. +        }
  482. +
  483. +        $file = $this->findFileWithExtension($class, '.php');
  484. +
  485. +        // Search for Hack files if we are running on HHVM
  486. +        if ($file === null && defined('HHVM_VERSION')) {
  487. +            $file = $this->findFileWithExtension($class, '.hh');
  488. +        }
  489. +
  490. +        if ($file === null) {
  491. +            // Remember that this class does not exist.
  492. +            return $this->classMap[$class] = false;
  493. +        }
  494. +
  495. +        return $file;
  496. +    }
  497. +
  498. +    private function findFileWithExtension($class, $ext)
  499. +    {
  500. +        // PSR-4 lookup
  501. +        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
  502. +
  503. +        $first = $class[0];
  504. +        if (isset($this->prefixLengthsPsr4[$first])) {
  505. +            foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
  506. +                if (0 === strpos($class, $prefix)) {
  507. +                    foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
  508. +                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
  509. +                            return $file;
  510. +                        }
  511. +                    }
  512. +                }
  513. +            }
  514. +        }
  515. +
  516. +        // PSR-4 fallback dirs
  517. +        foreach ($this->fallbackDirsPsr4 as $dir) {
  518. +            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
  519. +                return $file;
  520. +            }
  521. +        }
  522. +
  523. +        // PSR-0 lookup
  524. +        if (false !== $pos = strrpos($class, '\\')) {
  525. +            // namespaced class name
  526. +            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
  527. +                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
  528. +        } else {
  529. +            // PEAR-like class name
  530. +            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
  531. +        }
  532. +
  533. +        if (isset($this->prefixesPsr0[$first])) {
  534. +            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
  535. +                if (0 === strpos($class, $prefix)) {
  536. +                    foreach ($dirs as $dir) {
  537. +                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
  538. +                            return $file;
  539. +                        }
  540. +                    }
  541. +                }
  542. +            }
  543. +        }
  544. +
  545. +        // PSR-0 fallback dirs
  546. +        foreach ($this->fallbackDirsPsr0 as $dir) {
  547. +            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
  548. +                return $file;
  549. +            }
  550. +        }
  551. +
  552. +        // PSR-0 include paths.
  553. +        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
  554. +            return $file;
  555. +        }
  556. +    }
  557. +}
  558. +
  559. +/**
  560. + * Scope isolated include.
  561. + *
  562. + * Prevents access to $this/self from included files.
  563. + */
  564. +function includeFile($file)
  565. +{
  566. +    include $file;
  567. +}
  568. diff -uNr sendy/includes/vendor/composer/installed.json sendy-modified/includes/vendor/composer/installed.json
  569. --- sendy/includes/vendor/composer/installed.json   1970-01-01 01:00:00.000000000 +0100
  570. +++ sendy-modified/includes/vendor/composer/installed.json  2014-11-19 15:53:58.220099927 +0100
  571. @@ -0,0 +1,104 @@
  572. +[
  573. +    {
  574. +        "name": "symfony/css-selector",
  575. +        "version": "v2.5.6",
  576. +        "version_normalized": "2.5.6.0",
  577. +        "target-dir": "Symfony/Component/CssSelector",
  578. +        "source": {
  579. +            "type": "git",
  580. +            "url": "https://github.com/symfony/CssSelector.git",
  581. +            "reference": "7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc"
  582. +        },
  583. +        "dist": {
  584. +            "type": "zip",
  585. +            "url": "https://api.github.com/repos/symfony/CssSelector/zipball/7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc",
  586. +            "reference": "7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc",
  587. +            "shasum": ""
  588. +        },
  589. +        "require": {
  590. +            "php": ">=5.3.3"
  591. +        },
  592. +        "time": "2014-10-09 16:00:03",
  593. +        "type": "library",
  594. +        "extra": {
  595. +            "branch-alias": {
  596. +                "dev-master": "2.5-dev"
  597. +            }
  598. +        },
  599. +        "installation-source": "source",
  600. +        "autoload": {
  601. +            "psr-0": {
  602. +                "Symfony\\Component\\CssSelector\\": ""
  603. +            }
  604. +        },
  605. +        "notification-url": "https://packagist.org/downloads/",
  606. +        "license": [
  607. +            "MIT"
  608. +        ],
  609. +        "authors": [
  610. +            {
  611. +                "name": "Symfony Community",
  612. +                "homepage": "http://symfony.com/contributors"
  613. +            },
  614. +            {
  615. +                "name": "Jean-FranΓ§ois Simon",
  616. +                "email": "jeanfrancois.simon@sensiolabs.com"
  617. +            },
  618. +            {
  619. +                "name": "Fabien Potencier",
  620. +                "email": "fabien@symfony.com"
  621. +            }
  622. +        ],
  623. +        "description": "Symfony CssSelector Component",
  624. +        "homepage": "http://symfony.com"
  625. +    },
  626. +    {
  627. +        "name": "tijsverkoyen/css-to-inline-styles",
  628. +        "version": "1.5.2",
  629. +        "version_normalized": "1.5.2.0",
  630. +        "source": {
  631. +            "type": "git",
  632. +            "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git",
  633. +            "reference": "c50e8cd86acb0e528855c59653006e96d094a5b1"
  634. +        },
  635. +        "dist": {
  636. +            "type": "zip",
  637. +            "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/c50e8cd86acb0e528855c59653006e96d094a5b1",
  638. +            "reference": "c50e8cd86acb0e528855c59653006e96d094a5b1",
  639. +            "shasum": ""
  640. +        },
  641. +        "require": {
  642. +            "php": ">=5.3.0",
  643. +            "symfony/css-selector": "~2.1"
  644. +        },
  645. +        "require-dev": {
  646. +            "phpunit/phpunit": "~4.0"
  647. +        },
  648. +        "time": "2014-08-01 18:02:04",
  649. +        "type": "library",
  650. +        "extra": {
  651. +            "branch-alias": {
  652. +                "dev-master": "1.5.x-dev"
  653. +            }
  654. +        },
  655. +        "installation-source": "dist",
  656. +        "autoload": {
  657. +            "psr-4": {
  658. +                "TijsVerkoyen\\CssToInlineStyles\\": "src"
  659. +            }
  660. +        },
  661. +        "notification-url": "https://packagist.org/downloads/",
  662. +        "license": [
  663. +            "BSD"
  664. +        ],
  665. +        "authors": [
  666. +            {
  667. +                "name": "Tijs Verkoyen",
  668. +                "email": "css_to_inline_styles@verkoyen.eu",
  669. +                "role": "Developer"
  670. +            }
  671. +        ],
  672. +        "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.",
  673. +        "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles"
  674. +    }
  675. +]
  676. 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
  677. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CHANGELOG.md   1970-01-01 01:00:00.000000000 +0100
  678. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CHANGELOG.md  2014-11-19 15:54:29.044100114 +0100
  679. @@ -0,0 +1,7 @@
  680. +CHANGELOG
  681. +=========
  682. +
  683. +2.1.0
  684. +-----
  685. +
  686. + * none
  687. 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
  688. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/composer.json  1970-01-01 01:00:00.000000000 +0100
  689. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/composer.json 2014-11-19 15:54:07.412099983 +0100
  690. @@ -0,0 +1,35 @@
  691. +{
  692. +    "name": "symfony/css-selector",
  693. +    "type": "library",
  694. +    "description": "Symfony CssSelector Component",
  695. +    "keywords": [],
  696. +    "homepage": "http://symfony.com",
  697. +    "license": "MIT",
  698. +    "authors": [
  699. +        {
  700. +            "name": "Fabien Potencier",
  701. +            "email": "fabien@symfony.com"
  702. +        },
  703. +        {
  704. +            "name": "Jean-FranΓ§ois Simon",
  705. +            "email": "jeanfrancois.simon@sensiolabs.com"
  706. +        },
  707. +        {
  708. +            "name": "Symfony Community",
  709. +            "homepage": "http://symfony.com/contributors"
  710. +        }
  711. +    ],
  712. +    "require": {
  713. +        "php": ">=5.3.3"
  714. +    },
  715. +    "autoload": {
  716. +        "psr-0": { "Symfony\\Component\\CssSelector\\": "" }
  717. +    },
  718. +    "target-dir": "Symfony/Component/CssSelector",
  719. +    "minimum-stability": "dev",
  720. +    "extra": {
  721. +        "branch-alias": {
  722. +            "dev-master": "2.5-dev"
  723. +        }
  724. +    }
  725. +}
  726. 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
  727. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CssSelector.php    1970-01-01 01:00:00.000000000 +0100
  728. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/CssSelector.php   2014-11-19 15:54:31.464100129 +0100
  729. @@ -0,0 +1,83 @@
  730. +<?php
  731. +
  732. +/*
  733. + * This file is part of the Symfony package.
  734. + *
  735. + * (c) Fabien Potencier <fabien@symfony.com>
  736. + *
  737. + * For the full copyright and license information, please view the LICENSE
  738. + * file that was distributed with this source code.
  739. + */
  740. +
  741. +namespace Symfony\Component\CssSelector;
  742. +
  743. +use Symfony\Component\CssSelector\Parser\Shortcut\ClassParser;
  744. +use Symfony\Component\CssSelector\Parser\Shortcut\ElementParser;
  745. +use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser;
  746. +use Symfony\Component\CssSelector\Parser\Shortcut\HashParser;
  747. +use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension;
  748. +use Symfony\Component\CssSelector\XPath\Translator;
  749. +
  750. +/**
  751. + * CssSelector is the main entry point of the component and can convert CSS
  752. + * selectors to XPath expressions.
  753. + *
  754. + * $xpath = CssSelector::toXpath('h1.foo');
  755. + *
  756. + * This component is a port of the Python cssselector library,
  757. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  758. + *
  759. + * @author Fabien Potencier <fabien@symfony.com>
  760. + *
  761. + * @api
  762. + */
  763. +class CssSelector
  764. +{
  765. +    private static $html = true;
  766. +
  767. +    /**
  768. +     * Translates a CSS expression to its XPath equivalent.
  769. +     * Optionally, a prefix can be added to the resulting XPath
  770. +     * expression with the $prefix parameter.
  771. +     *
  772. +     * @param mixed   $cssExpr The CSS expression.
  773. +     * @param string  $prefix  An optional prefix for the XPath expression.
  774. +     *
  775. +     * @return string
  776. +     *
  777. +     * @api
  778. +     */
  779. +    public static function toXPath($cssExpr, $prefix = 'descendant-or-self::')
  780. +    {
  781. +        $translator = new Translator();
  782. +
  783. +        if (self::$html) {
  784. +            $translator->registerExtension(new HtmlExtension($translator));
  785. +        }
  786. +
  787. +        $translator
  788. +            ->registerParserShortcut(new EmptyStringParser())
  789. +            ->registerParserShortcut(new ElementParser())
  790. +            ->registerParserShortcut(new ClassParser())
  791. +            ->registerParserShortcut(new HashParser())
  792. +        ;
  793. +
  794. +        return $translator->cssToXPath($cssExpr, $prefix);
  795. +    }
  796. +
  797. +    /**
  798. +     * Enables the HTML extension.
  799. +     */
  800. +    public static function enableHtmlExtension()
  801. +    {
  802. +        self::$html = true;
  803. +    }
  804. +
  805. +    /**
  806. +     * Disables the HTML extension.
  807. +     */
  808. +    public static function disableHtmlExtension()
  809. +    {
  810. +        self::$html = false;
  811. +    }
  812. +}
  813. 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
  814. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExceptionInterface.php   1970-01-01 01:00:00.000000000 +0100
  815. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExceptionInterface.php  2014-11-19 15:54:10.772100003 +0100
  816. @@ -0,0 +1,24 @@
  817. +<?php
  818. +
  819. +/*
  820. + * This file is part of the Symfony package.
  821. + *
  822. + * (c) Fabien Potencier <fabien@symfony.com>
  823. + *
  824. + * For the full copyright and license information, please view the LICENSE
  825. + * file that was distributed with this source code.
  826. + */
  827. +
  828. +namespace Symfony\Component\CssSelector\Exception;
  829. +
  830. +/**
  831. + * Interface for exceptions.
  832. + *
  833. + * This component is a port of the Python cssselector library,
  834. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  835. + *
  836. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  837. + */
  838. +interface ExceptionInterface
  839. +{
  840. +}
  841. 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
  842. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExpressionErrorException.php 1970-01-01 01:00:00.000000000 +0100
  843. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ExpressionErrorException.php    2014-11-19 15:54:10.932100004 +0100
  844. @@ -0,0 +1,24 @@
  845. +<?php
  846. +
  847. +/*
  848. + * This file is part of the Symfony package.
  849. + *
  850. + * (c) Fabien Potencier <fabien@symfony.com>
  851. + *
  852. + * For the full copyright and license information, please view the LICENSE
  853. + * file that was distributed with this source code.
  854. + */
  855. +
  856. +namespace Symfony\Component\CssSelector\Exception;
  857. +
  858. +/**
  859. + * ParseException is thrown when a CSS selector syntax is not valid.
  860. + *
  861. + * This component is a port of the Python cssselector library,
  862. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  863. + *
  864. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  865. + */
  866. +class ExpressionErrorException extends ParseException implements ExceptionInterface
  867. +{
  868. +}
  869. 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
  870. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/InternalErrorException.php   1970-01-01 01:00:00.000000000 +0100
  871. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/InternalErrorException.php  2014-11-19 15:54:11.088100005 +0100
  872. @@ -0,0 +1,24 @@
  873. +<?php
  874. +
  875. +/*
  876. + * This file is part of the Symfony package.
  877. + *
  878. + * (c) Fabien Potencier <fabien@symfony.com>
  879. + *
  880. + * For the full copyright and license information, please view the LICENSE
  881. + * file that was distributed with this source code.
  882. + */
  883. +
  884. +namespace Symfony\Component\CssSelector\Exception;
  885. +
  886. +/**
  887. + * ParseException is thrown when a CSS selector syntax is not valid.
  888. + *
  889. + * This component is a port of the Python cssselector library,
  890. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  891. + *
  892. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  893. + */
  894. +class InternalErrorException extends ParseException implements ExceptionInterface
  895. +{
  896. +}
  897. 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
  898. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ParseException.php   1970-01-01 01:00:00.000000000 +0100
  899. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/ParseException.php  2014-11-19 15:54:10.456100001 +0100
  900. @@ -0,0 +1,24 @@
  901. +<?php
  902. +
  903. +/*
  904. + * This file is part of the Symfony package.
  905. + *
  906. + * (c) Fabien Potencier <fabien@symfony.com>
  907. + *
  908. + * For the full copyright and license information, please view the LICENSE
  909. + * file that was distributed with this source code.
  910. + */
  911. +
  912. +namespace Symfony\Component\CssSelector\Exception;
  913. +
  914. +/**
  915. + * ParseException is thrown when a CSS selector syntax is not valid.
  916. + *
  917. + * This component is a port of the Python cssselector library,
  918. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  919. + *
  920. + * @author Fabien Potencier <fabien@symfony.com>
  921. + */
  922. +class ParseException extends \Exception implements ExceptionInterface
  923. +{
  924. +}
  925. 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
  926. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php 1970-01-01 01:00:00.000000000 +0100
  927. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Exception/SyntaxErrorException.php    2014-11-19 15:54:10.616100002 +0100
  928. @@ -0,0 +1,73 @@
  929. +<?php
  930. +
  931. +/*
  932. + * This file is part of the Symfony package.
  933. + *
  934. + * (c) Fabien Potencier <fabien@symfony.com>
  935. + *
  936. + * For the full copyright and license information, please view the LICENSE
  937. + * file that was distributed with this source code.
  938. + */
  939. +
  940. +namespace Symfony\Component\CssSelector\Exception;
  941. +
  942. +use Symfony\Component\CssSelector\Parser\Token;
  943. +
  944. +/**
  945. + * ParseException is thrown when a CSS selector syntax is not valid.
  946. + *
  947. + * This component is a port of the Python cssselector library,
  948. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  949. + *
  950. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  951. + */
  952. +class SyntaxErrorException extends ParseException implements ExceptionInterface
  953. +{
  954. +    /**
  955. +     * @param string $expectedValue
  956. +     * @param Token  $foundToken
  957. +     *
  958. +     * @return SyntaxErrorException
  959. +     */
  960. +    public static function unexpectedToken($expectedValue, Token $foundToken)
  961. +    {
  962. +        return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken));
  963. +    }
  964. +
  965. +    /**
  966. +     * @param string $pseudoElement
  967. +     * @param string $unexpectedLocation
  968. +     *
  969. +     * @return SyntaxErrorException
  970. +     */
  971. +    public static function pseudoElementFound($pseudoElement, $unexpectedLocation)
  972. +    {
  973. +        return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation));
  974. +    }
  975. +
  976. +    /**
  977. +     * @param int $position
  978. +     *
  979. +     * @return SyntaxErrorException
  980. +     */
  981. +    public static function unclosedString($position)
  982. +    {
  983. +        return new self(sprintf('Unclosed/invalid string at %s.', $position));
  984. +    }
  985. +
  986. +    /**
  987. +     * @return SyntaxErrorException
  988. +     */
  989. +    public static function nestedNot()
  990. +    {
  991. +        return new self('Got nested ::not().');
  992. +    }
  993. +
  994. +    /**
  995. +     * @return SyntaxErrorException
  996. +     */
  997. +    public static function stringAsFunctionArgument()
  998. +    {
  999. +        return new self('String not allowed as function argument.');
  1000. +    }
  1001. +}
  1002. 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
  1003. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/config    1970-01-01 01:00:00.000000000 +0100
  1004. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/config   2014-11-19 15:54:25.892100095 +0100
  1005. @@ -0,0 +1,15 @@
  1006. +[core]
  1007. +   repositoryformatversion = 0
  1008. +   filemode = true
  1009. +   bare = false
  1010. +   logallrefupdates = true
  1011. +[remote "origin"]
  1012. +   url = git://github.com/symfony/CssSelector.git
  1013. +   fetch = +refs/heads/*:refs/remotes/origin/*
  1014. +   pushurl = git@github.com:symfony/CssSelector.git
  1015. +[branch "master"]
  1016. +   remote = origin
  1017. +   merge = refs/heads/master
  1018. +[remote "composer"]
  1019. +   url = git://github.com/symfony/CssSelector.git
  1020. +   fetch = +refs/heads/*:refs/remotes/composer/*
  1021. 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
  1022. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/description   1970-01-01 01:00:00.000000000 +0100
  1023. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/description  2014-11-19 15:54:21.932100071 +0100
  1024. @@ -0,0 +1 @@
  1025. +Unnamed repository; edit this file 'description' to name the repository.
  1026. 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
  1027. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/FETCH_HEAD    1970-01-01 01:00:00.000000000 +0100
  1028. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/FETCH_HEAD   2014-11-19 15:54:26.848100101 +0100
  1029. @@ -0,0 +1,9 @@
  1030. +354d622bce93ab079ed0ca16874f5815f2a73323   not-for-merge   branch '2.0' of git://github.com/symfony/CssSelector
  1031. +bf7bb82a099dfb26b018daf70ad1985fea4d2997   not-for-merge   branch '2.1' of git://github.com/symfony/CssSelector
  1032. +9ff0e208cfccd5a49a233221a645ce60a582f7d0   not-for-merge   branch '2.2' of git://github.com/symfony/CssSelector
  1033. +5bb1c69c1e2aa246292792024aeacd75f7e5d26a   not-for-merge   branch '2.3' of git://github.com/symfony/CssSelector
  1034. +4e9ddc09c13475fb1a52fb578a8899c8303966c5   not-for-merge   branch '2.4' of git://github.com/symfony/CssSelector
  1035. +3046789831631e5ccdd0df1a1221380eab343922   not-for-merge   branch '2.5' of git://github.com/symfony/CssSelector
  1036. +41953ad30ffc5cd710d106cf01eff79f6effa117   not-for-merge   branch '2.6' of git://github.com/symfony/CssSelector
  1037. +301d5705725b4e11c6255e443244642eb3b5dfa1   not-for-merge   branch '2.7' of git://github.com/symfony/CssSelector
  1038. +32f70108bf023759e21f80646cca37763a74ea7e   not-for-merge   branch 'master' of git://github.com/symfony/CssSelector
  1039. 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
  1040. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/HEAD  1970-01-01 01:00:00.000000000 +0100
  1041. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/HEAD 2014-11-19 15:54:28.724100112 +0100
  1042. @@ -0,0 +1 @@
  1043. +7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc
  1044. 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
  1045. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/applypatch-msg.sample   1970-01-01 01:00:00.000000000 +0100
  1046. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/applypatch-msg.sample  2014-11-19 15:54:17.648100045 +0100
  1047. @@ -0,0 +1,15 @@
  1048. +#!/bin/sh
  1049. +#
  1050. +# An example hook script to check the commit log message taken by
  1051. +# applypatch from an e-mail message.
  1052. +#
  1053. +# The hook should exit with non-zero status after issuing an
  1054. +# appropriate message if it wants to stop the commit.  The hook is
  1055. +# allowed to edit the commit message file.
  1056. +#
  1057. +# To enable this hook, rename this file to "applypatch-msg".
  1058. +
  1059. +. git-sh-setup
  1060. +test -x "$GIT_DIR/hooks/commit-msg" &&
  1061. +   exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
  1062. +:
  1063. 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
  1064. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/commit-msg.sample   1970-01-01 01:00:00.000000000 +0100
  1065. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/commit-msg.sample  2014-11-19 15:54:16.840100040 +0100
  1066. @@ -0,0 +1,24 @@
  1067. +#!/bin/sh
  1068. +#
  1069. +# An example hook script to check the commit log message.
  1070. +# Called by "git commit" with one argument, the name of the file
  1071. +# that has the commit message.  The hook should exit with non-zero
  1072. +# status after issuing an appropriate message if it wants to stop the
  1073. +# commit.  The hook is allowed to edit the commit message file.
  1074. +#
  1075. +# To enable this hook, rename this file to "commit-msg".
  1076. +
  1077. +# Uncomment the below to add a Signed-off-by line to the message.
  1078. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
  1079. +# hook is more suited to it.
  1080. +#
  1081. +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: /p')
  1082. +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
  1083. +
  1084. +# This example catches duplicate Signed-off-by lines.
  1085. +
  1086. +test "" = "$(grep '^Signed-off-by: ' "$1" |
  1087. +    sort | uniq -c | sed -e '/^[   ]*1[    ]/d')" || {
  1088. +   echo >&2 Duplicate Signed-off-by lines.
  1089. +   exit 1
  1090. +}
  1091. 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
  1092. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/post-update.sample  1970-01-01 01:00:00.000000000 +0100
  1093. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/post-update.sample 2014-11-19 15:54:17.808100046 +0100
  1094. @@ -0,0 +1,8 @@
  1095. +#!/bin/sh
  1096. +#
  1097. +# An example hook script to prepare a packed repository for use over
  1098. +# dumb transports.
  1099. +#
  1100. +# To enable this hook, rename this file to "post-update".
  1101. +
  1102. +exec git update-server-info
  1103. 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
  1104. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-applypatch.sample   1970-01-01 01:00:00.000000000 +0100
  1105. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-applypatch.sample  2014-11-19 15:54:17.164100042 +0100
  1106. @@ -0,0 +1,14 @@
  1107. +#!/bin/sh
  1108. +#
  1109. +# An example hook script to verify what is about to be committed
  1110. +# by applypatch from an e-mail message.
  1111. +#
  1112. +# The hook should exit with non-zero status after issuing an
  1113. +# appropriate message if it wants to stop the commit.
  1114. +#
  1115. +# To enable this hook, rename this file to "pre-applypatch".
  1116. +
  1117. +. git-sh-setup
  1118. +test -x "$GIT_DIR/hooks/pre-commit" &&
  1119. +   exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
  1120. +:
  1121. 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
  1122. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-commit.sample   1970-01-01 01:00:00.000000000 +0100
  1123. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-commit.sample  2014-11-19 15:54:17.968100047 +0100
  1124. @@ -0,0 +1,49 @@
  1125. +#!/bin/sh
  1126. +#
  1127. +# An example hook script to verify what is about to be committed.
  1128. +# Called by "git commit" with no arguments.  The hook should
  1129. +# exit with non-zero status after issuing an appropriate message if
  1130. +# it wants to stop the commit.
  1131. +#
  1132. +# To enable this hook, rename this file to "pre-commit".
  1133. +
  1134. +if git rev-parse --verify HEAD >/dev/null 2>&1
  1135. +then
  1136. +   against=HEAD
  1137. +else
  1138. +   # Initial commit: diff against an empty tree object
  1139. +   against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
  1140. +fi
  1141. +
  1142. +# If you want to allow non-ASCII filenames set this variable to true.
  1143. +allownonascii=$(git config --bool hooks.allownonascii)
  1144. +
  1145. +# Redirect output to stderr.
  1146. +exec 1>&2
  1147. +
  1148. +# Cross platform projects tend to avoid non-ASCII filenames; prevent
  1149. +# them from being added to the repository. We exploit the fact that the
  1150. +# printable range starts at the space character and ends with tilde.
  1151. +if [ "$allownonascii" != "true" ] &&
  1152. +   # Note that the use of brackets around a tr range is ok here, (it's
  1153. +   # even required, for portability to Solaris 10's /usr/bin/tr), since
  1154. +   # the square bracket bytes happen to fall in the designated range.
  1155. +   test $(git diff --cached --name-only --diff-filter=A -z $against |
  1156. +     LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
  1157. +then
  1158. +   cat <<\EOF
  1159. +Error: Attempt to add a non-ASCII file name.
  1160. +
  1161. +This can cause problems if you want to work with people on other platforms.
  1162. +
  1163. +To be portable it is advisable to rename the file.
  1164. +
  1165. +If you know what you are doing you can disable this check using:
  1166. +
  1167. +  git config hooks.allownonascii true
  1168. +EOF
  1169. +   exit 1
  1170. +fi
  1171. +
  1172. +# If there are whitespace errors, print the offending file names and fail.
  1173. +exec git diff-index --check --cached $against --
  1174. 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
  1175. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/prepare-commit-msg.sample   1970-01-01 01:00:00.000000000 +0100
  1176. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/prepare-commit-msg.sample  2014-11-19 15:54:17.488100044 +0100
  1177. @@ -0,0 +1,36 @@
  1178. +#!/bin/sh
  1179. +#
  1180. +# An example hook script to prepare the commit log message.
  1181. +# Called by "git commit" with the name of the file that has the
  1182. +# commit message, followed by the description of the commit
  1183. +# message's source.  The hook's purpose is to edit the commit
  1184. +# message file.  If the hook fails with a non-zero status,
  1185. +# the commit is aborted.
  1186. +#
  1187. +# To enable this hook, rename this file to "prepare-commit-msg".
  1188. +
  1189. +# This hook includes three examples.  The first comments out the
  1190. +# "Conflicts:" part of a merge commit.
  1191. +#
  1192. +# The second includes the output of "git diff --name-status -r"
  1193. +# into the message, just before the "git status" output.  It is
  1194. +# commented because it doesn't cope with --amend or with squashed
  1195. +# commits.
  1196. +#
  1197. +# The third example adds a Signed-off-by line to the message, that can
  1198. +# still be edited.  This is rarely a good idea.
  1199. +
  1200. +case "$2,$3" in
  1201. +  merge,)
  1202. +    /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
  1203. +
  1204. +# ,|template,)
  1205. +#   /usr/bin/perl -i.bak -pe '
  1206. +#      print "\n" . `git diff --cached --name-status -r`
  1207. +#   if /^#/ && $first++ == 0' "$1" ;;
  1208. +
  1209. +  *) ;;
  1210. +esac
  1211. +
  1212. +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: /p')
  1213. +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
  1214. 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
  1215. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-push.sample 1970-01-01 01:00:00.000000000 +0100
  1216. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-push.sample    2014-11-19 15:54:18.128100048 +0100
  1217. @@ -0,0 +1,54 @@
  1218. +#!/bin/sh
  1219. +
  1220. +# An example hook script to verify what is about to be pushed.  Called by "git
  1221. +# push" after it has checked the remote status, but before anything has been
  1222. +# pushed.  If this script exits with a non-zero status nothing will be pushed.
  1223. +#
  1224. +# This hook is called with the following parameters:
  1225. +#
  1226. +# $1 -- Name of the remote to which the push is being done
  1227. +# $2 -- URL to which the push is being done
  1228. +#
  1229. +# If pushing without using a named remote those arguments will be equal.
  1230. +#
  1231. +# Information about the commits which are being pushed is supplied as lines to
  1232. +# the standard input in the form:
  1233. +#
  1234. +#   <local ref> <local sha1> <remote ref> <remote sha1>
  1235. +#
  1236. +# This sample shows how to prevent push of commits where the log message starts
  1237. +# with "WIP" (work in progress).
  1238. +
  1239. +remote="$1"
  1240. +url="$2"
  1241. +
  1242. +z40=0000000000000000000000000000000000000000
  1243. +
  1244. +IFS=' '
  1245. +while read local_ref local_sha remote_ref remote_sha
  1246. +do
  1247. +   if [ "$local_sha" = $z40 ]
  1248. +   then
  1249. +       # Handle delete
  1250. +       :
  1251. +   else
  1252. +       if [ "$remote_sha" = $z40 ]
  1253. +       then
  1254. +           # New branch, examine all commits
  1255. +           range="$local_sha"
  1256. +       else
  1257. +           # Update to existing branch, examine new commits
  1258. +           range="$remote_sha..$local_sha"
  1259. +       fi
  1260. +
  1261. +       # Check for WIP commit
  1262. +       commit=`git rev-list -n 1 --grep '^WIP' "$range"`
  1263. +       if [ -n "$commit" ]
  1264. +       then
  1265. +           echo "Found WIP commit in $local_ref, not pushing"
  1266. +           exit 1
  1267. +       fi
  1268. +   fi
  1269. +done
  1270. +
  1271. +exit 0
  1272. 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
  1273. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-rebase.sample   1970-01-01 01:00:00.000000000 +0100
  1274. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/pre-rebase.sample  2014-11-19 15:54:17.328100043 +0100
  1275. @@ -0,0 +1,169 @@
  1276. +#!/bin/sh
  1277. +#
  1278. +# Copyright (c) 2006, 2008 Junio C Hamano
  1279. +#
  1280. +# The "pre-rebase" hook is run just before "git rebase" starts doing
  1281. +# its job, and can prevent the command from running by exiting with
  1282. +# non-zero status.
  1283. +#
  1284. +# The hook is called with the following parameters:
  1285. +#
  1286. +# $1 -- the upstream the series was forked from.
  1287. +# $2 -- the branch being rebased (or empty when rebasing the current branch).
  1288. +#
  1289. +# This sample shows how to prevent topic branches that are already
  1290. +# merged to 'next' branch from getting rebased, because allowing it
  1291. +# would result in rebasing already published history.
  1292. +
  1293. +publish=next
  1294. +basebranch="$1"
  1295. +if test "$#" = 2
  1296. +then
  1297. +   topic="refs/heads/$2"
  1298. +else
  1299. +   topic=`git symbolic-ref HEAD` ||
  1300. +   exit 0 ;# we do not interrupt rebasing detached HEAD
  1301. +fi
  1302. +
  1303. +case "$topic" in
  1304. +refs/heads/??/*)
  1305. +   ;;
  1306. +*)
  1307. +   exit 0 ;# we do not interrupt others.
  1308. +   ;;
  1309. +esac
  1310. +
  1311. +# Now we are dealing with a topic branch being rebased
  1312. +# on top of master.  Is it OK to rebase it?
  1313. +
  1314. +# Does the topic really exist?
  1315. +git show-ref -q "$topic" || {
  1316. +   echo >&2 "No such branch $topic"
  1317. +   exit 1
  1318. +}
  1319. +
  1320. +# Is topic fully merged to master?
  1321. +not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
  1322. +if test -z "$not_in_master"
  1323. +then
  1324. +   echo >&2 "$topic is fully merged to master; better remove it."
  1325. +   exit 1 ;# we could allow it, but there is no point.
  1326. +fi
  1327. +
  1328. +# Is topic ever merged to next?  If so you should not be rebasing it.
  1329. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
  1330. +only_next_2=`git rev-list ^master           ${publish} | sort`
  1331. +if test "$only_next_1" = "$only_next_2"
  1332. +then
  1333. +   not_in_topic=`git rev-list "^$topic" master`
  1334. +   if test -z "$not_in_topic"
  1335. +   then
  1336. +       echo >&2 "$topic is already up-to-date with master"
  1337. +       exit 1 ;# we could allow it, but there is no point.
  1338. +   else
  1339. +       exit 0
  1340. +   fi
  1341. +else
  1342. +   not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
  1343. +   /usr/bin/perl -e '
  1344. +       my $topic = $ARGV[0];
  1345. +       my $msg = "* $topic has commits already merged to public branch:\n";
  1346. +       my (%not_in_next) = map {
  1347. +           /^([0-9a-f]+) /;
  1348. +           ($1 => 1);
  1349. +       } split(/\n/, $ARGV[1]);
  1350. +       for my $elem (map {
  1351. +               /^([0-9a-f]+) (.*)$/;
  1352. +               [$1 => $2];
  1353. +           } split(/\n/, $ARGV[2])) {
  1354. +           if (!exists $not_in_next{$elem->[0]}) {
  1355. +               if ($msg) {
  1356. +                   print STDERR $msg;
  1357. +                   undef $msg;
  1358. +               }
  1359. +               print STDERR " $elem->[1]\n";
  1360. +           }
  1361. +       }
  1362. +   ' "$topic" "$not_in_next" "$not_in_master"
  1363. +   exit 1
  1364. +fi
  1365. +
  1366. +<<\DOC_END
  1367. +
  1368. +This sample hook safeguards topic branches that have been
  1369. +published from being rewound.
  1370. +
  1371. +The workflow assumed here is:
  1372. +
  1373. + * Once a topic branch forks from "master", "master" is never
  1374. +   merged into it again (either directly or indirectly).
  1375. +
  1376. + * Once a topic branch is fully cooked and merged into "master",
  1377. +   it is deleted.  If you need to build on top of it to correct
  1378. +   earlier mistakes, a new topic branch is created by forking at
  1379. +   the tip of the "master".  This is not strictly necessary, but
  1380. +   it makes it easier to keep your history simple.
  1381. +
  1382. + * Whenever you need to test or publish your changes to topic
  1383. +   branches, merge them into "next" branch.
  1384. +
  1385. +The script, being an example, hardcodes the publish branch name
  1386. +to be "next", but it is trivial to make it configurable via
  1387. +$GIT_DIR/config mechanism.
  1388. +
  1389. +With this workflow, you would want to know:
  1390. +
  1391. +(1) ... if a topic branch has ever been merged to "next".  Young
  1392. +    topic branches can have stupid mistakes you would rather
  1393. +    clean up before publishing, and things that have not been
  1394. +    merged into other branches can be easily rebased without
  1395. +    affecting other people.  But once it is published, you would
  1396. +    not want to rewind it.
  1397. +
  1398. +(2) ... if a topic branch has been fully merged to "master".
  1399. +    Then you can delete it.  More importantly, you should not
  1400. +    build on top of it -- other people may already want to
  1401. +    change things related to the topic as patches against your
  1402. +    "master", so if you need further changes, it is better to
  1403. +    fork the topic (perhaps with the same name) afresh from the
  1404. +    tip of "master".
  1405. +
  1406. +Let's look at this example:
  1407. +
  1408. +          o---o---o---o---o---o---o---o---o---o "next"
  1409. +         /       /           /           /
  1410. +        /   a---a---b A     /           /
  1411. +       /   /               /           /
  1412. +          /   /   c---c---c---c B         /
  1413. +         /   /   /             \         /
  1414. +        /   /   /   b---b C     \       /
  1415. +       /   /   /   /             \     /
  1416. +    ---o---o---o---o---o---o---o---o---o---o---o "master"
  1417. +
  1418. +
  1419. +A, B and C are topic branches.
  1420. +
  1421. + * A has one fix since it was merged up to "next".
  1422. +
  1423. + * B has finished.  It has been fully merged up to "master" and "next",
  1424. +   and is ready to be deleted.
  1425. +
  1426. + * C has not merged to "next" at all.
  1427. +
  1428. +We would want to allow C to be rebased, refuse A, and encourage
  1429. +B to be deleted.
  1430. +
  1431. +To compute (1):
  1432. +
  1433. +   git rev-list ^master ^topic next
  1434. +   git rev-list ^master        next
  1435. +
  1436. +   if these match, topic has not merged in next at all.
  1437. +
  1438. +To compute (2):
  1439. +
  1440. +   git rev-list master..topic
  1441. +
  1442. +   if this is empty, it is fully merged to "master".
  1443. +
  1444. +DOC_END
  1445. 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
  1446. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/update.sample   1970-01-01 01:00:00.000000000 +0100
  1447. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/hooks/update.sample  2014-11-19 15:54:17.004100041 +0100
  1448. @@ -0,0 +1,128 @@
  1449. +#!/bin/sh
  1450. +#
  1451. +# An example hook script to blocks unannotated tags from entering.
  1452. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
  1453. +#
  1454. +# To enable this hook, rename this file to "update".
  1455. +#
  1456. +# Config
  1457. +# ------
  1458. +# hooks.allowunannotated
  1459. +#   This boolean sets whether unannotated tags will be allowed into the
  1460. +#   repository.  By default they won't be.
  1461. +# hooks.allowdeletetag
  1462. +#   This boolean sets whether deleting tags will be allowed in the
  1463. +#   repository.  By default they won't be.
  1464. +# hooks.allowmodifytag
  1465. +#   This boolean sets whether a tag may be modified after creation. By default
  1466. +#   it won't be.
  1467. +# hooks.allowdeletebranch
  1468. +#   This boolean sets whether deleting branches will be allowed in the
  1469. +#   repository.  By default they won't be.
  1470. +# hooks.denycreatebranch
  1471. +#   This boolean sets whether remotely creating branches will be denied
  1472. +#   in the repository.  By default this is allowed.
  1473. +#
  1474. +
  1475. +# --- Command line
  1476. +refname="$1"
  1477. +oldrev="$2"
  1478. +newrev="$3"
  1479. +
  1480. +# --- Safety check
  1481. +if [ -z "$GIT_DIR" ]; then
  1482. +   echo "Don't run this script from the command line." >&2
  1483. +   echo " (if you want, you could supply GIT_DIR then run" >&2
  1484. +   echo "  $0 <ref> <oldrev> <newrev>)" >&2
  1485. +   exit 1
  1486. +fi
  1487. +
  1488. +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
  1489. +   echo "usage: $0 <ref> <oldrev> <newrev>" >&2
  1490. +   exit 1
  1491. +fi
  1492. +
  1493. +# --- Config
  1494. +allowunannotated=$(git config --bool hooks.allowunannotated)
  1495. +allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
  1496. +denycreatebranch=$(git config --bool hooks.denycreatebranch)
  1497. +allowdeletetag=$(git config --bool hooks.allowdeletetag)
  1498. +allowmodifytag=$(git config --bool hooks.allowmodifytag)
  1499. +
  1500. +# check for no description
  1501. +projectdesc=$(sed -e '1q' "$GIT_DIR/description")
  1502. +case "$projectdesc" in
  1503. +"Unnamed repository"* | "")
  1504. +   echo "*** Project description file hasn't been set" >&2
  1505. +   exit 1
  1506. +   ;;
  1507. +esac
  1508. +
  1509. +# --- Check types
  1510. +# if $newrev is 0000...0000, it's a commit to delete a ref.
  1511. +zero="0000000000000000000000000000000000000000"
  1512. +if [ "$newrev" = "$zero" ]; then
  1513. +   newrev_type=delete
  1514. +else
  1515. +   newrev_type=$(git cat-file -t $newrev)
  1516. +fi
  1517. +
  1518. +case "$refname","$newrev_type" in
  1519. +   refs/tags/*,commit)
  1520. +       # un-annotated tag
  1521. +       short_refname=${refname##refs/tags/}
  1522. +       if [ "$allowunannotated" != "true" ]; then
  1523. +           echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
  1524. +           echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
  1525. +           exit 1
  1526. +       fi
  1527. +       ;;
  1528. +   refs/tags/*,delete)
  1529. +       # delete tag
  1530. +       if [ "$allowdeletetag" != "true" ]; then
  1531. +           echo "*** Deleting a tag is not allowed in this repository" >&2
  1532. +           exit 1
  1533. +       fi
  1534. +       ;;
  1535. +   refs/tags/*,tag)
  1536. +       # annotated tag
  1537. +       if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
  1538. +       then
  1539. +           echo "*** Tag '$refname' already exists." >&2
  1540. +           echo "*** Modifying a tag is not allowed in this repository." >&2
  1541. +           exit 1
  1542. +       fi
  1543. +       ;;
  1544. +   refs/heads/*,commit)
  1545. +       # branch
  1546. +       if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
  1547. +           echo "*** Creating a branch is not allowed in this repository" >&2
  1548. +           exit 1
  1549. +       fi
  1550. +       ;;
  1551. +   refs/heads/*,delete)
  1552. +       # delete branch
  1553. +       if [ "$allowdeletebranch" != "true" ]; then
  1554. +           echo "*** Deleting a branch is not allowed in this repository" >&2
  1555. +           exit 1
  1556. +       fi
  1557. +       ;;
  1558. +   refs/remotes/*,commit)
  1559. +       # tracking branch
  1560. +       ;;
  1561. +   refs/remotes/*,delete)
  1562. +       # delete tracking branch
  1563. +       if [ "$allowdeletebranch" != "true" ]; then
  1564. +           echo "*** Deleting a tracking branch is not allowed in this repository" >&2
  1565. +           exit 1
  1566. +       fi
  1567. +       ;;
  1568. +   *)
  1569. +       # Anything else (is there anything else?)
  1570. +       echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
  1571. +       exit 1
  1572. +       ;;
  1573. +esac
  1574. +
  1575. +# --- Finished
  1576. +exit 0
  1577. 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
  1578. 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
  1579. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/info/exclude  1970-01-01 01:00:00.000000000 +0100
  1580. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/info/exclude 2014-11-19 15:54:26.364100098 +0100
  1581. @@ -0,0 +1,6 @@
  1582. +# git ls-files --others --exclude-from=.git/info/exclude
  1583. +# Lines that start with '#' are comments.
  1584. +# For a project mostly in C, the following would be a good set of
  1585. +# exclude patterns (uncomment them if you want to use them):
  1586. +# *.[oa]
  1587. +# *~
  1588. 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
  1589. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/HEAD 1970-01-01 01:00:00.000000000 +0100
  1590. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/HEAD    2014-11-19 15:54:25.732100094 +0100
  1591. @@ -0,0 +1,2 @@
  1592. +0000000000000000000000000000000000000000 32f70108bf023759e21f80646cca37763a74ea7e Kai Fricke <fricke@elbsilber.de> 1416405098 +0100    clone: from git://github.com/symfony/CssSelector.git
  1593. +32f70108bf023759e21f80646cca37763a74ea7e 7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc Kai Fricke <fricke@elbsilber.de> 1416405099 +0100    checkout: moving from master to v2.5.6
  1594. 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
  1595. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/heads/master    1970-01-01 01:00:00.000000000 +0100
  1596. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/heads/master   2014-11-19 15:54:25.572100093 +0100
  1597. @@ -0,0 +1 @@
  1598. +0000000000000000000000000000000000000000 32f70108bf023759e21f80646cca37763a74ea7e Kai Fricke <fricke@elbsilber.de> 1416405098 +0100    clone: from git://github.com/symfony/CssSelector.git
  1599. 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
  1600. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.0    1970-01-01 01:00:00.000000000 +0100
  1601. +++ 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
  1602. @@ -0,0 +1 @@
  1603. +0000000000000000000000000000000000000000 354d622bce93ab079ed0ca16874f5815f2a73323 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100    fetch composer: storing head
  1604. 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
  1605. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.1    1970-01-01 01:00:00.000000000 +0100
  1606. +++ 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
  1607. @@ -0,0 +1 @@
  1608. +0000000000000000000000000000000000000000 bf7bb82a099dfb26b018daf70ad1985fea4d2997 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100    fetch composer: storing head
  1609. 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
  1610. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.2    1970-01-01 01:00:00.000000000 +0100
  1611. +++ 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
  1612. @@ -0,0 +1 @@
  1613. +0000000000000000000000000000000000000000 9ff0e208cfccd5a49a233221a645ce60a582f7d0 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100    fetch composer: storing head
  1614. 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
  1615. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.3    1970-01-01 01:00:00.000000000 +0100
  1616. +++ 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
  1617. @@ -0,0 +1 @@
  1618. +0000000000000000000000000000000000000000 5bb1c69c1e2aa246292792024aeacd75f7e5d26a Kai Fricke <fricke@elbsilber.de> 1416405099 +0100    fetch composer: storing head
  1619. 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
  1620. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.4    1970-01-01 01:00:00.000000000 +0100
  1621. +++ 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
  1622. @@ -0,0 +1 @@
  1623. +0000000000000000000000000000000000000000 4e9ddc09c13475fb1a52fb578a8899c8303966c5 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100    fetch composer: storing head
  1624. 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
  1625. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.5    1970-01-01 01:00:00.000000000 +0100
  1626. +++ 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
  1627. @@ -0,0 +1 @@
  1628. +0000000000000000000000000000000000000000 3046789831631e5ccdd0df1a1221380eab343922 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100    fetch composer: storing head
  1629. 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
  1630. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.6    1970-01-01 01:00:00.000000000 +0100
  1631. +++ 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
  1632. @@ -0,0 +1 @@
  1633. +0000000000000000000000000000000000000000 41953ad30ffc5cd710d106cf01eff79f6effa117 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100    fetch composer: storing head
  1634. 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
  1635. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/2.7    1970-01-01 01:00:00.000000000 +0100
  1636. +++ 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
  1637. @@ -0,0 +1 @@
  1638. +0000000000000000000000000000000000000000 301d5705725b4e11c6255e443244642eb3b5dfa1 Kai Fricke <fricke@elbsilber.de> 1416405099 +0100    fetch composer: storing head
  1639. 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
  1640. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/master 1970-01-01 01:00:00.000000000 +0100
  1641. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/composer/master    2014-11-19 15:54:24.620100087 +0100
  1642. @@ -0,0 +1 @@
  1643. +0000000000000000000000000000000000000000 32f70108bf023759e21f80646cca37763a74ea7e Kai Fricke <fricke@elbsilber.de> 1416405099 +0100    fetch composer: storing head
  1644. 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
  1645. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/origin/HEAD 1970-01-01 01:00:00.000000000 +0100
  1646. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/logs/refs/remotes/origin/HEAD    2014-11-19 15:54:25.096100090 +0100
  1647. @@ -0,0 +1 @@
  1648. +0000000000000000000000000000000000000000 32f70108bf023759e21f80646cca37763a74ea7e Kai Fricke <fricke@elbsilber.de> 1416405098 +0100    clone: from git://github.com/symfony/CssSelector.git
  1649. 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
  1650. 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
  1651. 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
  1652. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/ORIG_HEAD 1970-01-01 01:00:00.000000000 +0100
  1653. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/ORIG_HEAD    2014-11-19 15:54:26.688100100 +0100
  1654. @@ -0,0 +1 @@
  1655. +7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc
  1656. 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
  1657. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/packed-refs   1970-01-01 01:00:00.000000000 +0100
  1658. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/packed-refs  2014-11-19 15:54:28.568100111 +0100
  1659. @@ -0,0 +1,200 @@
  1660. +# pack-refs with: peeled fully-peeled
  1661. +354d622bce93ab079ed0ca16874f5815f2a73323 refs/remotes/origin/2.0
  1662. +bf7bb82a099dfb26b018daf70ad1985fea4d2997 refs/remotes/origin/2.1
  1663. +9ff0e208cfccd5a49a233221a645ce60a582f7d0 refs/remotes/origin/2.2
  1664. +5bb1c69c1e2aa246292792024aeacd75f7e5d26a refs/remotes/origin/2.3
  1665. +4e9ddc09c13475fb1a52fb578a8899c8303966c5 refs/remotes/origin/2.4
  1666. +3046789831631e5ccdd0df1a1221380eab343922 refs/remotes/origin/2.5
  1667. +41953ad30ffc5cd710d106cf01eff79f6effa117 refs/remotes/origin/2.6
  1668. +301d5705725b4e11c6255e443244642eb3b5dfa1 refs/remotes/origin/2.7
  1669. +32f70108bf023759e21f80646cca37763a74ea7e refs/remotes/origin/master
  1670. +27e124eff2d95b11c6cead88def6997243f7d859 refs/tags/v2.0.0
  1671. +^7742407893ab5f14266ebe3d48d2308d4779946f
  1672. +3da2a3dfdaf5e735b29ce332d3f9e89bd3a5f7c8 refs/tags/v2.0.1
  1673. +^7742407893ab5f14266ebe3d48d2308d4779946f
  1674. +807a4362ab51b76984f1a17f080f274fc28ee78a refs/tags/v2.0.10
  1675. +^20165ecbb58254c560eb579879b90c3b41510b31
  1676. +08dd9dd1d60f90ca83890dd0634f88a615c20694 refs/tags/v2.0.12
  1677. +^e22ee361ef90283fa48002cec4cc0c018ff4af37
  1678. +753474f045641705fcd2dd4b827ac2f3a411a084 refs/tags/v2.0.13
  1679. +^e22ee361ef90283fa48002cec4cc0c018ff4af37
  1680. +6c90b8d51f170c57ded25bb06ab0f565a422c14f refs/tags/v2.0.14
  1681. +^23fa9f4df262d48e7bd740741ed3903f5b674778
  1682. +86892e6ccfba27c5c756d537f92ae338dd91b656 refs/tags/v2.0.15
  1683. +^76ce6fd53c6ed1bca1b9b7d594e83cefd4748d1f
  1684. +bac7cf63e069fcf71c5724220470258072ee165f refs/tags/v2.0.16
  1685. +^e37dee425f5f3f7e31d30626ec04727e709b9b06
  1686. +5b6c27bbf2d5a92f615ab31ef6b5bb1e9d70ba9c refs/tags/v2.0.17
  1687. +^e37dee425f5f3f7e31d30626ec04727e709b9b06
  1688. +ebeb675e3062599e1f6405b614edeb43dea7b8c6 refs/tags/v2.0.18
  1689. +^e37dee425f5f3f7e31d30626ec04727e709b9b06
  1690. +4091e5feba8b931ac5f3f1f82407b72fa34e9ca7 refs/tags/v2.0.19
  1691. +^e37dee425f5f3f7e31d30626ec04727e709b9b06
  1692. +ed01d136a7de1ce831d1096820d9553118c7fd02 refs/tags/v2.0.20
  1693. +^9f6108e4b181bb9b0b99f0358d80a5d76da4911a
  1694. +2916fb2ec2efe87d888def059ffa057145298eb8 refs/tags/v2.0.21
  1695. +^9f6108e4b181bb9b0b99f0358d80a5d76da4911a
  1696. +6bbf73b6400a9197f1e2342ef3cf6180c4f08144 refs/tags/v2.0.22
  1697. +^354d622bce93ab079ed0ca16874f5815f2a73323
  1698. +15b477ef9c9c07fa74a675531c5bc973c5a9cf2e refs/tags/v2.0.23
  1699. +^354d622bce93ab079ed0ca16874f5815f2a73323
  1700. +211b2621a094742ea7e774c5a41040ea6477f7cd refs/tags/v2.0.24
  1701. +^354d622bce93ab079ed0ca16874f5815f2a73323
  1702. +f72c7935bcc5d3d0e6887315bc50f4058f3473fe refs/tags/v2.0.25
  1703. +^354d622bce93ab079ed0ca16874f5815f2a73323
  1704. +d0afbef6f47a4beb5b5933a7a74ef8d97ac77ffb refs/tags/v2.0.4
  1705. +^8b836c58bbfcd7b9193884ce82c6a6050ec856c6
  1706. +691dce2bf054749f2544f95ee331eaef3faa3383 refs/tags/v2.0.5
  1707. +^7e103001d8888bc7f98d3efd2d2eafae536da8d3
  1708. +b627aefef2cd457fa5da9bc3b349d98e59e3faca refs/tags/v2.0.6
  1709. +^9afb1eed337e8bb70dcdef165a0e83100f28e8f3
  1710. +322062923de75630177370d0f1d20d96b49c5b70 refs/tags/v2.0.7
  1711. +^4b6e5e7fbe86c68eb4b6b75a3b6ff53d6d6c1017
  1712. +d32b982cce948cfc9b93623fc5954cd0201fdeb7 refs/tags/v2.0.9
  1713. +^20165ecbb58254c560eb579879b90c3b41510b31
  1714. +e91dfcad32fa37716791f1dc8dd949e885d40e74 refs/tags/v2.1.0
  1715. +^676a7fd9b5027da85b58dd11db5561fef01c6271
  1716. +4496971d39895d608b0183a92d994c6a2f020b6e refs/tags/v2.1.1
  1717. +^676a7fd9b5027da85b58dd11db5561fef01c6271
  1718. +a91a17be5763e422b1047b7c153ff3b6c4708ed8 refs/tags/v2.1.10
  1719. +^8e8cb053407749391e14c0cae7ac3b7e155c1392
  1720. +6bbecd5f35b3546a08202678bb1b11a810a0e9f3 refs/tags/v2.1.11
  1721. +^bf7bb82a099dfb26b018daf70ad1985fea4d2997
  1722. +7c4efbe9d9f302430f66dc5320e4f884ab285abf refs/tags/v2.1.12
  1723. +^bf7bb82a099dfb26b018daf70ad1985fea4d2997
  1724. +42c8693ef030ea2751f4cf57578416dec11c7821 refs/tags/v2.1.13
  1725. +^bf7bb82a099dfb26b018daf70ad1985fea4d2997
  1726. +0396905c85f2653942817016f3429bdbc8742729 refs/tags/v2.1.2
  1727. +^676a7fd9b5027da85b58dd11db5561fef01c6271
  1728. +a1806f14f34b3abf077a0482a5a38a9d846068c0 refs/tags/v2.1.3
  1729. +^02fa0bf05b6db612e008d04184d6408c0599e73b
  1730. +1457a0ca1f429a8b2356e8569b1e88d5f08ccf49 refs/tags/v2.1.4
  1731. +^abf8279792230c6685234eb0fa95b0a85e9e9c7a
  1732. +663b5137b237c5224f32b5722ead727df6c833eb refs/tags/v2.1.5
  1733. +^3bf44fd37af95e0fd7764040abf9744f189fba05
  1734. +d533f3decb8a490abb1fea5ba6fe31eb9abee9ee refs/tags/v2.1.6
  1735. +^3bf44fd37af95e0fd7764040abf9744f189fba05
  1736. +445e0302ff7f48a70b098b70e85fe01b69fac33a refs/tags/v2.1.7
  1737. +^8e8cb053407749391e14c0cae7ac3b7e155c1392
  1738. +bbdc3f8876893e70cbeee09b184653795ca14324 refs/tags/v2.1.8
  1739. +^8e8cb053407749391e14c0cae7ac3b7e155c1392
  1740. +5a036eba44f16afed55b4ec02148654e8792ea16 refs/tags/v2.1.9
  1741. +^8e8cb053407749391e14c0cae7ac3b7e155c1392
  1742. +02db732e277a984fa5f6d80b01675e3f25ffed75 refs/tags/v2.2.0
  1743. +^931f7fa8b01688f7c839784e9cf2897e118e37d2
  1744. +69b541153d73d357dc7e740d1191b987b054a0ac refs/tags/v2.2.1
  1745. +^931f7fa8b01688f7c839784e9cf2897e118e37d2
  1746. +a30c4a55c97964234c2ff0580a04dfd8fc1a63e9 refs/tags/v2.2.10
  1747. +^9ff0e208cfccd5a49a233221a645ce60a582f7d0
  1748. +0412a5fd652af3aab37d5c25ab574b117f42400a refs/tags/v2.2.11
  1749. +^9ff0e208cfccd5a49a233221a645ce60a582f7d0
  1750. +f8298da5580033f6eb40abf900d599369b023c41 refs/tags/v2.2.2
  1751. +^8b4d745ffad13dbbfb99fcaccd97ae2632048260
  1752. +96aeb89eedf84676c25d844068e41443e8677ab6 refs/tags/v2.2.3
  1753. +^8b4d745ffad13dbbfb99fcaccd97ae2632048260
  1754. +83da53eb47b926892fea2ebbd97ed7050821dc65 refs/tags/v2.2.4
  1755. +^a5deeae9ed56895cff84fd9b9844727eec45a373
  1756. +7b8a720bf11105576e970d524e2eb6a86996dc8e refs/tags/v2.2.5
  1757. +^a5deeae9ed56895cff84fd9b9844727eec45a373
  1758. +1e70dfb454385e4d90c76b7f95518541310c110f refs/tags/v2.2.6
  1759. +^a5deeae9ed56895cff84fd9b9844727eec45a373
  1760. +6221eded8db7ebcaf4eab027d1545936878b4cdf refs/tags/v2.2.7
  1761. +^9ff0e208cfccd5a49a233221a645ce60a582f7d0
  1762. +d043d8071bc9127fab5fc363af3bd0a66dce9208 refs/tags/v2.2.8
  1763. +^9ff0e208cfccd5a49a233221a645ce60a582f7d0
  1764. +9919eb8d9c778cb8bc3f214eb79e55f20205d17e refs/tags/v2.2.9
  1765. +^9ff0e208cfccd5a49a233221a645ce60a582f7d0
  1766. +00bd471b8fe0f4fb4acc10197b3e3c13a3060b3c refs/tags/v2.3.0
  1767. +^6cf5ed69c27ac001d52b448a621f631e4e9b4176
  1768. +77251f45f2696c7eb40a85a428c64cc1eab7c638 refs/tags/v2.3.1
  1769. +^6cf5ed69c27ac001d52b448a621f631e4e9b4176
  1770. +549ae94d03d805f23074b31ac00845fa0a77e160 refs/tags/v2.3.10
  1771. +^a7450fde13926ab5b796f7884a05e91372dcbccc
  1772. +88027ef4ea74c93b6f19b54a8bd1a3f056175056 refs/tags/v2.3.11
  1773. +^a7450fde13926ab5b796f7884a05e91372dcbccc
  1774. +814447d475a965dab549a3ec2a91f03fa2df49f2 refs/tags/v2.3.12
  1775. +^fd008ce53fdbcf315d602921abe6fecad19804d3
  1776. +2ab3e0ba7c999a0fef8f92ac56c74ce9d0f80cbb refs/tags/v2.3.13
  1777. +^0d2ab42d49536760f045069415832c9c604c8cc7
  1778. +89c27221d2b82aa34b53e0d85ab24a3faec98efb refs/tags/v2.3.14
  1779. +^2ff53e8a7870b453836e879b083b971d455e174d
  1780. +1a1bccf5aab8b16951ad2824ca1342f718868d26 refs/tags/v2.3.15
  1781. +^2ff53e8a7870b453836e879b083b971d455e174d
  1782. +a2b11132fffff8f67088647a590ff318918cde53 refs/tags/v2.3.16
  1783. +^2ff53e8a7870b453836e879b083b971d455e174d
  1784. +72624fb8acd766504a0f083a319986592f15ca8b refs/tags/v2.3.17
  1785. +^f31e5ef34bc16fd08c63992b50cfd4e47c5edf8f
  1786. +fb45079894e474ac3eb9b108ddcc8d288c82c845 refs/tags/v2.3.18
  1787. +^84460a630f5e61486c2641a1a9b9f30df091ad49
  1788. +34ee6af76b9d91349bb69e9dd8ffb749b03e609a refs/tags/v2.3.19
  1789. +^8953d325d3341c246abadb79be172de95ef80664
  1790. +2f8d38f042a862a98949eb0313fbafdc5ae07139 refs/tags/v2.3.2
  1791. +^e3aa2495604a483b58f318ad6de845b88ec410d6
  1792. +d29f6421ffe0013740269d380e2889a4f13b499b refs/tags/v2.3.20
  1793. +^9b320f7b6baa094032996e3e7170ced7405f64f3
  1794. +5fa7ac2209187d40e9979f9cdac7c80b5996c746 refs/tags/v2.3.21
  1795. +^d9943386b648d21746bed25cc24f61fab1387943
  1796. +7e5af359c3ef3178cf526b40e64be3e2e4af2240 refs/tags/v2.3.3
  1797. +^885544201cb24e79754da1dbd61bd779c2e4353e
  1798. +ad96da4ed3df875c108ca01ba9a8270f9cba5389 refs/tags/v2.3.4
  1799. +^885544201cb24e79754da1dbd61bd779c2e4353e
  1800. +38e7f0c2f316fd62039a606a7884144839d219c9 refs/tags/v2.3.5
  1801. +^4e01c74f19ea049773fa3ee9fb2bb5bf5e14f7eb
  1802. +7940c5c10db22f079a6c8ac1b26f851184c91fd2 refs/tags/v2.3.6
  1803. +^4e01c74f19ea049773fa3ee9fb2bb5bf5e14f7eb
  1804. +f7f1438097dfba47c2a836b5d53fb47f11e0ffb2 refs/tags/v2.3.7
  1805. +^8df20c54ffa650df860a3e42dbcd1fbd25a24977
  1806. +b57a05f709f2d66eadf50c4cb5d37ff4e5efa207 refs/tags/v2.3.8
  1807. +^8df20c54ffa650df860a3e42dbcd1fbd25a24977
  1808. +15f7928bcc61f9e2b2f4d3ba0af622f64b5a64ae refs/tags/v2.3.9
  1809. +^48851624cb5808d16af98651aed59e5188f7277c
  1810. +7da4f8ddf582bd1fb3dbd90ee8282a7428e2cc19 refs/tags/v2.4.0
  1811. +^d7524797f1a6b20a8c7c31fbdd64f38fbfce1797
  1812. +090b508f94ccb63fdc526141030e58c16e1fbfbd refs/tags/v2.4.0-BETA1
  1813. +^2fd5d92f08774b0c9605e1a8a77273b16364ff20
  1814. +41e1f17c47254b2b775bcff9f325e13451e9d3ca refs/tags/v2.4.0-BETA2
  1815. +^13032e63b946d6e3f1ee0f60035298a175ae5088
  1816. +2c78bb192bd9c4144727d8cf15f2873d86cde9fa refs/tags/v2.4.0-RC1
  1817. +^d7524797f1a6b20a8c7c31fbdd64f38fbfce1797
  1818. +c4268f4e5969770a31cfe56ed05d9cfb7e005488 refs/tags/v2.4.1
  1819. +^352552da1f50a79f6a6fa427e4a85ee2ea1945f6
  1820. +58b9dbbd13aaf1cfea5e73766242a763ca2e9ff5 refs/tags/v2.4.10
  1821. +^4e9ddc09c13475fb1a52fb578a8899c8303966c5
  1822. +cfd65186d56650be66c65a680ae16d58804ec29c refs/tags/v2.4.2
  1823. +^ed1d61b2e23a0fd5dba0b20651258c4633d3e3a7
  1824. +1617fffead2d34dc51dcaaf9ee0354349c7edc9c refs/tags/v2.4.3
  1825. +^c0ca90adac5b581dbd346df23c3e3355ac823238
  1826. +45fb66847ca8d71e0e9a6265a8f76f276301eb3a refs/tags/v2.4.4
  1827. +^479a5b409723f596ffc3b5178034e4d76ce615b3
  1828. +1052f59248bff65276b3aab5b804763520fe84b6 refs/tags/v2.4.5
  1829. +^268d0a51166edaf84dfcf043c57f273685cb7c93
  1830. +49cc858dcfaa04226fd97c1a0173965e76b32dd7 refs/tags/v2.4.6
  1831. +^268d0a51166edaf84dfcf043c57f273685cb7c93
  1832. +f4d3f6378b0ccdbd41a35ae22898c3af7fa47ee6 refs/tags/v2.4.7
  1833. +^256a9363b26594b92bf6b5b136c49f806458abaa
  1834. +e69282998b4c0ec359745d78b0a1404dcccd6587 refs/tags/v2.4.8
  1835. +^52c35be379ec341c15d2edc7f798f7fd69708645
  1836. +e141cbf12a7845d7a6f237bb2ead3fe160b4686e refs/tags/v2.4.9
  1837. +^2014a6e253d29ded3b8dd179a8d96ac52f2dfba5
  1838. +88d65ee501e0cc87430fa34ac35f35bcd44a1aad refs/tags/v2.5.0
  1839. +^bcdd62af59bd3137ede467946a06d41f8644048c
  1840. +bcf5790a2ec7d16a32ca70f2132b7acad0ba36b4 refs/tags/v2.5.0-BETA1
  1841. +^39df955c4456b62c65e272dea2d5fd320d034ce3
  1842. +f20eff7e36f86aa0936190ccce33103270dae94b refs/tags/v2.5.0-BETA2
  1843. +^339e53ea57506b2532b15545cd9242f09cc48ad4
  1844. +8441ba4a3c8a989ce9d3ba78830890d6b9be37bb refs/tags/v2.5.0-RC1
  1845. +^bcdd62af59bd3137ede467946a06d41f8644048c
  1846. +cdd6b38e089bb7223e2cbcdddfb3dcafc8311be4 refs/tags/v2.5.1
  1847. +^8679e89e6cc9cd415120625071c3cbb3c70311b5
  1848. +5dd9b7c96705cbe04abe0f4e6295898add5cf126 refs/tags/v2.5.2
  1849. +^e24b8215bf39a6a2ce0c262bc5b000724077afa9
  1850. +37864e8b59320b35c9d43bab0dfa7830201dc382 refs/tags/v2.5.3
  1851. +^e24b8215bf39a6a2ce0c262bc5b000724077afa9
  1852. +57157e3da54355f28b32fd570e8fa124be5dff1b refs/tags/v2.5.4
  1853. +^143abf51b91e4517cde67d416bdf67a90cffa32d
  1854. +707d1f6445c474b0bec0320d8e32077a89d9ba01 refs/tags/v2.5.5
  1855. +^caf5ecc3face1f22884fb74b8edab65ac5ba9976
  1856. +df39e89e37cb0445eaa5ca4b036bdcca73d2a740 refs/tags/v2.5.6
  1857. +^7cdf543a3f31935aae58de4e6e607d4bdeb3f5dc
  1858. +8995817f0a50fbdefc9d5ed5048d6cea5c62c76a refs/tags/v2.6.0-BETA1
  1859. +^41953ad30ffc5cd710d106cf01eff79f6effa117
  1860. 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
  1861. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/heads/master 1970-01-01 01:00:00.000000000 +0100
  1862. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/heads/master    2014-11-19 15:54:21.764100070 +0100
  1863. @@ -0,0 +1 @@
  1864. +32f70108bf023759e21f80646cca37763a74ea7e
  1865. 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
  1866. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.0 1970-01-01 01:00:00.000000000 +0100
  1867. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.0    2014-11-19 15:54:20.496100062 +0100
  1868. @@ -0,0 +1 @@
  1869. +354d622bce93ab079ed0ca16874f5815f2a73323
  1870. 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
  1871. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.1 1970-01-01 01:00:00.000000000 +0100
  1872. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.1    2014-11-19 15:54:20.336100061 +0100
  1873. @@ -0,0 +1 @@
  1874. +bf7bb82a099dfb26b018daf70ad1985fea4d2997
  1875. 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
  1876. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.2 1970-01-01 01:00:00.000000000 +0100
  1877. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.2    2014-11-19 15:54:20.180100060 +0100
  1878. @@ -0,0 +1 @@
  1879. +9ff0e208cfccd5a49a233221a645ce60a582f7d0
  1880. 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
  1881. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.3 1970-01-01 01:00:00.000000000 +0100
  1882. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.3    2014-11-19 15:54:20.020100059 +0100
  1883. @@ -0,0 +1 @@
  1884. +5bb1c69c1e2aa246292792024aeacd75f7e5d26a
  1885. 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
  1886. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.4 1970-01-01 01:00:00.000000000 +0100
  1887. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.4    2014-11-19 15:54:19.860100058 +0100
  1888. @@ -0,0 +1 @@
  1889. +4e9ddc09c13475fb1a52fb578a8899c8303966c5
  1890. 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
  1891. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.5 1970-01-01 01:00:00.000000000 +0100
  1892. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.5    2014-11-19 15:54:19.704100057 +0100
  1893. @@ -0,0 +1 @@
  1894. +3046789831631e5ccdd0df1a1221380eab343922
  1895. 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
  1896. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.6 1970-01-01 01:00:00.000000000 +0100
  1897. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.6    2014-11-19 15:54:20.972100065 +0100
  1898. @@ -0,0 +1 @@
  1899. +41953ad30ffc5cd710d106cf01eff79f6effa117
  1900. 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
  1901. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.7 1970-01-01 01:00:00.000000000 +0100
  1902. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/2.7    2014-11-19 15:54:20.812100064 +0100
  1903. @@ -0,0 +1 @@
  1904. +301d5705725b4e11c6255e443244642eb3b5dfa1
  1905. 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
  1906. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/master  1970-01-01 01:00:00.000000000 +0100
  1907. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/composer/master 2014-11-19 15:54:20.656100063 +0100
  1908. @@ -0,0 +1 @@
  1909. +32f70108bf023759e21f80646cca37763a74ea7e
  1910. 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
  1911. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/origin/HEAD  1970-01-01 01:00:00.000000000 +0100
  1912. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.git/refs/remotes/origin/HEAD 2014-11-19 15:54:19.228100055 +0100
  1913. @@ -0,0 +1 @@
  1914. +ref: refs/remotes/origin/master
  1915. diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.gitignore sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.gitignore
  1916. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.gitignore 1970-01-01 01:00:00.000000000 +0100
  1917. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/.gitignore    2014-11-19 15:54:09.988099999 +0100
  1918. @@ -0,0 +1,3 @@
  1919. +vendor/
  1920. +composer.lock
  1921. +phpunit.xml
  1922. diff -uNr sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/LICENSE sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/LICENSE
  1923. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/LICENSE    1970-01-01 01:00:00.000000000 +0100
  1924. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/LICENSE   2014-11-19 15:54:28.884100113 +0100
  1925. @@ -0,0 +1,19 @@
  1926. +Copyright (c) 2004-2014 Fabien Potencier
  1927. +
  1928. +Permission is hereby granted, free of charge, to any person obtaining a copy
  1929. +of this software and associated documentation files (the "Software"), to deal
  1930. +in the Software without restriction, including without limitation the rights
  1931. +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1932. +copies of the Software, and to permit persons to whom the Software is furnished
  1933. +to do so, subject to the following conditions:
  1934. +
  1935. +The above copyright notice and this permission notice shall be included in all
  1936. +copies or substantial portions of the Software.
  1937. +
  1938. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1939. +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1940. +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1941. +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1942. +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1943. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1944. +THE SOFTWARE.
  1945. 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
  1946. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AbstractNode.php  1970-01-01 01:00:00.000000000 +0100
  1947. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AbstractNode.php 2014-11-19 15:54:31.280100127 +0100
  1948. @@ -0,0 +1,40 @@
  1949. +<?php
  1950. +
  1951. +/*
  1952. + * This file is part of the Symfony package.
  1953. + *
  1954. + * (c) Fabien Potencier <fabien@symfony.com>
  1955. + *
  1956. + * For the full copyright and license information, please view the LICENSE
  1957. + * file that was distributed with this source code.
  1958. + */
  1959. +
  1960. +namespace Symfony\Component\CssSelector\Node;
  1961. +
  1962. +/**
  1963. + * Abstract base node class.
  1964. + *
  1965. + * This component is a port of the Python cssselector library,
  1966. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  1967. + *
  1968. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  1969. + */
  1970. +abstract class AbstractNode implements NodeInterface
  1971. +{
  1972. +    /**
  1973. +     * @var string
  1974. +     */
  1975. +    private $nodeName;
  1976. +
  1977. +    /**
  1978. +     * @return string
  1979. +     */
  1980. +    public function getNodeName()
  1981. +    {
  1982. +        if (null === $this->nodeName) {
  1983. +            $this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', get_called_class());
  1984. +        }
  1985. +
  1986. +        return $this->nodeName;
  1987. +    }
  1988. +}
  1989. 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
  1990. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AttributeNode.php 1970-01-01 01:00:00.000000000 +0100
  1991. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/AttributeNode.php    2014-11-19 15:54:29.840100119 +0100
  1992. @@ -0,0 +1,124 @@
  1993. +<?php
  1994. +
  1995. +/*
  1996. + * This file is part of the Symfony package.
  1997. + *
  1998. + * (c) Fabien Potencier <fabien@symfony.com>
  1999. + *
  2000. + * For the full copyright and license information, please view the LICENSE
  2001. + * file that was distributed with this source code.
  2002. + */
  2003. +
  2004. +namespace Symfony\Component\CssSelector\Node;
  2005. +
  2006. +/**
  2007. + * Represents a "<selector>[<namespace>|<attribute> <operator> <value>]" node.
  2008. + *
  2009. + * This component is a port of the Python cssselector library,
  2010. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2011. + *
  2012. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2013. + */
  2014. +class AttributeNode extends AbstractNode
  2015. +{
  2016. +    /**
  2017. +     * @var NodeInterface
  2018. +     */
  2019. +    private $selector;
  2020. +
  2021. +    /**
  2022. +     * @var string
  2023. +     */
  2024. +    private $namespace;
  2025. +
  2026. +    /**
  2027. +     * @var string
  2028. +     */
  2029. +    private $attribute;
  2030. +
  2031. +    /**
  2032. +     * @var string
  2033. +     */
  2034. +    private $operator;
  2035. +
  2036. +    /**
  2037. +     * @var string
  2038. +     */
  2039. +    private $value;
  2040. +
  2041. +    /**
  2042. +     * @param NodeInterface $selector
  2043. +     * @param string        $namespace
  2044. +     * @param string        $attribute
  2045. +     * @param string        $operator
  2046. +     * @param string        $value
  2047. +     */
  2048. +    public function __construct(NodeInterface $selector, $namespace, $attribute, $operator, $value)
  2049. +    {
  2050. +        $this->selector = $selector;
  2051. +        $this->namespace = $namespace;
  2052. +        $this->attribute = $attribute;
  2053. +        $this->operator = $operator;
  2054. +        $this->value = $value;
  2055. +    }
  2056. +
  2057. +    /**
  2058. +     * @return NodeInterface
  2059. +     */
  2060. +    public function getSelector()
  2061. +    {
  2062. +        return $this->selector;
  2063. +    }
  2064. +
  2065. +    /**
  2066. +     * @return string
  2067. +     */
  2068. +    public function getNamespace()
  2069. +    {
  2070. +        return $this->namespace;
  2071. +    }
  2072. +
  2073. +    /**
  2074. +     * @return string
  2075. +     */
  2076. +    public function getAttribute()
  2077. +    {
  2078. +        return $this->attribute;
  2079. +    }
  2080. +
  2081. +    /**
  2082. +     * @return string
  2083. +     */
  2084. +    public function getOperator()
  2085. +    {
  2086. +        return $this->operator;
  2087. +    }
  2088. +
  2089. +    /**
  2090. +     * @return string
  2091. +     */
  2092. +    public function getValue()
  2093. +    {
  2094. +        return $this->value;
  2095. +    }
  2096. +
  2097. +    /**
  2098. +     * {@inheritdoc}
  2099. +     */
  2100. +    public function getSpecificity()
  2101. +    {
  2102. +        return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
  2103. +    }
  2104. +
  2105. +    /**
  2106. +     * {@inheritdoc}
  2107. +     */
  2108. +    public function __toString()
  2109. +    {
  2110. +        $attribute = $this->namespace ? $this->namespace.'|'.$this->attribute : $this->attribute;
  2111. +
  2112. +        return 'exists' === $this->operator
  2113. +            ? sprintf('%s[%s[%s]]', $this->getNodeName(), $this->selector, $attribute)
  2114. +            : sprintf("%s[%s[%s %s '%s']]", $this->getNodeName(), $this->selector, $attribute, $this->operator, $this->value);
  2115. +    }
  2116. +}
  2117. 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
  2118. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ClassNode.php 1970-01-01 01:00:00.000000000 +0100
  2119. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ClassNode.php    2014-11-19 15:54:30.800100125 +0100
  2120. @@ -0,0 +1,75 @@
  2121. +<?php
  2122. +
  2123. +/*
  2124. + * This file is part of the Symfony package.
  2125. + *
  2126. + * (c) Fabien Potencier <fabien@symfony.com>
  2127. + *
  2128. + * For the full copyright and license information, please view the LICENSE
  2129. + * file that was distributed with this source code.
  2130. + */
  2131. +
  2132. +namespace Symfony\Component\CssSelector\Node;
  2133. +
  2134. +/**
  2135. + * Represents a "<selector>.<name>" node.
  2136. + *
  2137. + * This component is a port of the Python cssselector library,
  2138. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2139. + *
  2140. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2141. + */
  2142. +class ClassNode extends AbstractNode
  2143. +{
  2144. +    /**
  2145. +     * @var NodeInterface
  2146. +     */
  2147. +    private $selector;
  2148. +
  2149. +    /**
  2150. +     * @var string
  2151. +     */
  2152. +    private $name;
  2153. +
  2154. +    /**
  2155. +     * @param NodeInterface $selector
  2156. +     * @param string        $name
  2157. +     */
  2158. +    public function __construct(NodeInterface $selector, $name)
  2159. +    {
  2160. +        $this->selector = $selector;
  2161. +        $this->name = $name;
  2162. +    }
  2163. +
  2164. +    /**
  2165. +     * @return NodeInterface
  2166. +     */
  2167. +    public function getSelector()
  2168. +    {
  2169. +        return $this->selector;
  2170. +    }
  2171. +
  2172. +    /**
  2173. +     * @return string
  2174. +     */
  2175. +    public function getName()
  2176. +    {
  2177. +        return $this->name;
  2178. +    }
  2179. +
  2180. +    /**
  2181. +     * {@inheritdoc}
  2182. +     */
  2183. +    public function getSpecificity()
  2184. +    {
  2185. +        return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
  2186. +    }
  2187. +
  2188. +    /**
  2189. +     * {@inheritdoc}
  2190. +     */
  2191. +    public function __toString()
  2192. +    {
  2193. +        return sprintf('%s[%s.%s]', $this->getNodeName(), $this->selector, $this->name);
  2194. +    }
  2195. +}
  2196. 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
  2197. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php  1970-01-01 01:00:00.000000000 +0100
  2198. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php 2014-11-19 15:54:30.640100124 +0100
  2199. @@ -0,0 +1,92 @@
  2200. +<?php
  2201. +
  2202. +/*
  2203. + * This file is part of the Symfony package.
  2204. + *
  2205. + * (c) Fabien Potencier <fabien@symfony.com>
  2206. + *
  2207. + * For the full copyright and license information, please view the LICENSE
  2208. + * file that was distributed with this source code.
  2209. + */
  2210. +
  2211. +namespace Symfony\Component\CssSelector\Node;
  2212. +
  2213. +/**
  2214. + * Represents a combined node.
  2215. + *
  2216. + * This component is a port of the Python cssselector library,
  2217. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2218. + *
  2219. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2220. + */
  2221. +class CombinedSelectorNode extends AbstractNode
  2222. +{
  2223. +    /**
  2224. +     * @var NodeInterface
  2225. +     */
  2226. +    private $selector;
  2227. +
  2228. +    /**
  2229. +     * @var string
  2230. +     */
  2231. +    private $combinator;
  2232. +
  2233. +    /**
  2234. +     * @var NodeInterface
  2235. +     */
  2236. +    private $subSelector;
  2237. +
  2238. +    /**
  2239. +     * @param NodeInterface $selector
  2240. +     * @param string        $combinator
  2241. +     * @param NodeInterface $subSelector
  2242. +     */
  2243. +    public function __construct(NodeInterface $selector, $combinator, NodeInterface $subSelector)
  2244. +    {
  2245. +        $this->selector = $selector;
  2246. +        $this->combinator = $combinator;
  2247. +        $this->subSelector = $subSelector;
  2248. +    }
  2249. +
  2250. +    /**
  2251. +     * @return NodeInterface
  2252. +     */
  2253. +    public function getSelector()
  2254. +    {
  2255. +        return $this->selector;
  2256. +    }
  2257. +
  2258. +    /**
  2259. +     * @return string
  2260. +     */
  2261. +    public function getCombinator()
  2262. +    {
  2263. +        return $this->combinator;
  2264. +    }
  2265. +
  2266. +    /**
  2267. +     * @return NodeInterface
  2268. +     */
  2269. +    public function getSubSelector()
  2270. +    {
  2271. +        return $this->subSelector;
  2272. +    }
  2273. +
  2274. +    /**
  2275. +     * {@inheritdoc}
  2276. +     */
  2277. +    public function getSpecificity()
  2278. +    {
  2279. +        return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());
  2280. +    }
  2281. +
  2282. +    /**
  2283. +     * {@inheritdoc}
  2284. +     */
  2285. +    public function __toString()
  2286. +    {
  2287. +        $combinator = ' ' === $this->combinator ? '<followed>' : $this->combinator;
  2288. +
  2289. +        return sprintf('%s[%s %s %s]', $this->getNodeName(), $this->selector, $combinator, $this->subSelector);
  2290. +    }
  2291. +}
  2292. 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
  2293. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ElementNode.php   1970-01-01 01:00:00.000000000 +0100
  2294. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/ElementNode.php  2014-11-19 15:54:29.520100117 +0100
  2295. @@ -0,0 +1,77 @@
  2296. +<?php
  2297. +
  2298. +/*
  2299. + * This file is part of the Symfony package.
  2300. + *
  2301. + * (c) Fabien Potencier <fabien@symfony.com>
  2302. + *
  2303. + * For the full copyright and license information, please view the LICENSE
  2304. + * file that was distributed with this source code.
  2305. + */
  2306. +
  2307. +namespace Symfony\Component\CssSelector\Node;
  2308. +
  2309. +/**
  2310. + * Represents a "<namespace>|<element>" node.
  2311. + *
  2312. + * This component is a port of the Python cssselector library,
  2313. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2314. + *
  2315. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2316. + */
  2317. +class ElementNode extends AbstractNode
  2318. +{
  2319. +    /**
  2320. +     * @var string|null
  2321. +     */
  2322. +    private $namespace;
  2323. +
  2324. +    /**
  2325. +     * @var string|null
  2326. +     */
  2327. +    private $element;
  2328. +
  2329. +    /**
  2330. +     * @param string|null $namespace
  2331. +     * @param string|null $element
  2332. +     */
  2333. +    public function __construct($namespace = null, $element = null)
  2334. +    {
  2335. +        $this->namespace = $namespace;
  2336. +        $this->element = $element;
  2337. +    }
  2338. +
  2339. +    /**
  2340. +     * @return null|string
  2341. +     */
  2342. +    public function getNamespace()
  2343. +    {
  2344. +        return $this->namespace;
  2345. +    }
  2346. +
  2347. +    /**
  2348. +     * @return null|string
  2349. +     */
  2350. +    public function getElement()
  2351. +    {
  2352. +        return $this->element;
  2353. +    }
  2354. +
  2355. +    /**
  2356. +     * {@inheritdoc}
  2357. +     */
  2358. +    public function getSpecificity()
  2359. +    {
  2360. +        return new Specificity(0, 0, $this->element ? 1 : 0);
  2361. +    }
  2362. +
  2363. +    /**
  2364. +     * {@inheritdoc}
  2365. +     */
  2366. +    public function __toString()
  2367. +    {
  2368. +        $element = $this->element ?: '*';
  2369. +
  2370. +        return sprintf('%s[%s]', $this->getNodeName(), $this->namespace ? $this->namespace.'|'.$element : $element);
  2371. +    }
  2372. +}
  2373. 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
  2374. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/FunctionNode.php  1970-01-01 01:00:00.000000000 +0100
  2375. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/FunctionNode.php 2014-11-19 15:54:30.160100121 +0100
  2376. @@ -0,0 +1,96 @@
  2377. +<?php
  2378. +
  2379. +/*
  2380. + * This file is part of the Symfony package.
  2381. + *
  2382. + * (c) Fabien Potencier <fabien@symfony.com>
  2383. + *
  2384. + * For the full copyright and license information, please view the LICENSE
  2385. + * file that was distributed with this source code.
  2386. + */
  2387. +
  2388. +namespace Symfony\Component\CssSelector\Node;
  2389. +
  2390. +use Symfony\Component\CssSelector\Parser\Token;
  2391. +
  2392. +/**
  2393. + * Represents a "<selector>:<name>(<arguments>)" node.
  2394. + *
  2395. + * This component is a port of the Python cssselector library,
  2396. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2397. + *
  2398. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2399. + */
  2400. +class FunctionNode extends AbstractNode
  2401. +{
  2402. +    /**
  2403. +     * @var NodeInterface
  2404. +     */
  2405. +    private $selector;
  2406. +
  2407. +    /**
  2408. +     * @var string
  2409. +     */
  2410. +    private $name;
  2411. +
  2412. +    /**
  2413. +     * @var Token[]
  2414. +     */
  2415. +    private $arguments;
  2416. +
  2417. +    /**
  2418. +     * @param NodeInterface $selector
  2419. +     * @param string        $name
  2420. +     * @param Token[]       $arguments
  2421. +     */
  2422. +    public function __construct(NodeInterface $selector, $name, array $arguments = array())
  2423. +    {
  2424. +        $this->selector = $selector;
  2425. +        $this->name = strtolower($name);
  2426. +        $this->arguments = $arguments;
  2427. +    }
  2428. +
  2429. +    /**
  2430. +     * @return NodeInterface
  2431. +     */
  2432. +    public function getSelector()
  2433. +    {
  2434. +        return $this->selector;
  2435. +    }
  2436. +
  2437. +    /**
  2438. +     * @return string
  2439. +     */
  2440. +    public function getName()
  2441. +    {
  2442. +        return $this->name;
  2443. +    }
  2444. +
  2445. +    /**
  2446. +     * @return Token[]
  2447. +     */
  2448. +    public function getArguments()
  2449. +    {
  2450. +        return $this->arguments;
  2451. +    }
  2452. +
  2453. +    /**
  2454. +     * {@inheritdoc}
  2455. +     */
  2456. +    public function getSpecificity()
  2457. +    {
  2458. +        return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
  2459. +    }
  2460. +
  2461. +    /**
  2462. +     * {@inheritdoc}
  2463. +     */
  2464. +    public function __toString()
  2465. +    {
  2466. +        $arguments = implode(', ', array_map(function (Token $token) {
  2467. +            return "'".$token->getValue()."'";
  2468. +        }, $this->arguments));
  2469. +
  2470. +        return sprintf('%s[%s:%s(%s)]', $this->getNodeName(), $this->selector, $this->name, $arguments ? '['.$arguments.']' : '');
  2471. +    }
  2472. +}
  2473. 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
  2474. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/HashNode.php  1970-01-01 01:00:00.000000000 +0100
  2475. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/HashNode.php 2014-11-19 15:54:30.480100123 +0100
  2476. @@ -0,0 +1,75 @@
  2477. +<?php
  2478. +
  2479. +/*
  2480. + * This file is part of the Symfony package.
  2481. + *
  2482. + * (c) Fabien Potencier <fabien@symfony.com>
  2483. + *
  2484. + * For the full copyright and license information, please view the LICENSE
  2485. + * file that was distributed with this source code.
  2486. + */
  2487. +
  2488. +namespace Symfony\Component\CssSelector\Node;
  2489. +
  2490. +/**
  2491. + * Represents a "<selector>#<id>" node.
  2492. + *
  2493. + * This component is a port of the Python cssselector library,
  2494. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2495. + *
  2496. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2497. + */
  2498. +class HashNode extends AbstractNode
  2499. +{
  2500. +    /**
  2501. +     * @var NodeInterface
  2502. +     */
  2503. +    private $selector;
  2504. +
  2505. +    /**
  2506. +     * @var string
  2507. +     */
  2508. +    private $id;
  2509. +
  2510. +    /**
  2511. +     * @param NodeInterface $selector
  2512. +     * @param string        $id
  2513. +     */
  2514. +    public function __construct(NodeInterface $selector, $id)
  2515. +    {
  2516. +        $this->selector = $selector;
  2517. +        $this->id = $id;
  2518. +    }
  2519. +
  2520. +    /**
  2521. +     * @return NodeInterface
  2522. +     */
  2523. +    public function getSelector()
  2524. +    {
  2525. +        return $this->selector;
  2526. +    }
  2527. +
  2528. +    /**
  2529. +     * @return string
  2530. +     */
  2531. +    public function getId()
  2532. +    {
  2533. +        return $this->id;
  2534. +    }
  2535. +
  2536. +    /**
  2537. +     * {@inheritdoc}
  2538. +     */
  2539. +    public function getSpecificity()
  2540. +    {
  2541. +        return $this->selector->getSpecificity()->plus(new Specificity(1, 0, 0));
  2542. +    }
  2543. +
  2544. +    /**
  2545. +     * {@inheritdoc}
  2546. +     */
  2547. +    public function __toString()
  2548. +    {
  2549. +        return sprintf('%s[%s#%s]', $this->getNodeName(), $this->selector, $this->id);
  2550. +    }
  2551. +}
  2552. 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
  2553. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NegationNode.php  1970-01-01 01:00:00.000000000 +0100
  2554. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NegationNode.php 2014-11-19 15:54:30.320100122 +0100
  2555. @@ -0,0 +1,75 @@
  2556. +<?php
  2557. +
  2558. +/*
  2559. + * This file is part of the Symfony package.
  2560. + *
  2561. + * (c) Fabien Potencier <fabien@symfony.com>
  2562. + *
  2563. + * For the full copyright and license information, please view the LICENSE
  2564. + * file that was distributed with this source code.
  2565. + */
  2566. +
  2567. +namespace Symfony\Component\CssSelector\Node;
  2568. +
  2569. +/**
  2570. + * Represents a "<selector>:not(<identifier>)" node.
  2571. + *
  2572. + * This component is a port of the Python cssselector library,
  2573. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2574. + *
  2575. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2576. + */
  2577. +class NegationNode extends AbstractNode
  2578. +{
  2579. +    /**
  2580. +     * @var NodeInterface
  2581. +     */
  2582. +    private $selector;
  2583. +
  2584. +    /**
  2585. +     * @var NodeInterface
  2586. +     */
  2587. +    private $subSelector;
  2588. +
  2589. +    /**
  2590. +     * @param NodeInterface $selector
  2591. +     * @param NodeInterface $subSelector
  2592. +     */
  2593. +    public function __construct(NodeInterface $selector, NodeInterface $subSelector)
  2594. +    {
  2595. +        $this->selector = $selector;
  2596. +        $this->subSelector = $subSelector;
  2597. +    }
  2598. +
  2599. +    /**
  2600. +     * @return NodeInterface
  2601. +     */
  2602. +    public function getSelector()
  2603. +    {
  2604. +        return $this->selector;
  2605. +    }
  2606. +
  2607. +    /**
  2608. +     * @return NodeInterface
  2609. +     */
  2610. +    public function getSubSelector()
  2611. +    {
  2612. +        return $this->subSelector;
  2613. +    }
  2614. +
  2615. +    /**
  2616. +     * {@inheritdoc}
  2617. +     */
  2618. +    public function getSpecificity()
  2619. +    {
  2620. +        return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity());
  2621. +    }
  2622. +
  2623. +    /**
  2624. +     * {@inheritdoc}
  2625. +     */
  2626. +    public function __toString()
  2627. +    {
  2628. +        return sprintf('%s[%s:not(%s)]', $this->getNodeName(), $this->selector, $this->subSelector);
  2629. +    }
  2630. +}
  2631. 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
  2632. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NodeInterface.php 1970-01-01 01:00:00.000000000 +0100
  2633. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/NodeInterface.php    2014-11-19 15:54:30.000100120 +0100
  2634. @@ -0,0 +1,44 @@
  2635. +<?php
  2636. +
  2637. +/*
  2638. + * This file is part of the Symfony package.
  2639. + *
  2640. + * (c) Fabien Potencier <fabien@symfony.com>
  2641. + *
  2642. + * For the full copyright and license information, please view the LICENSE
  2643. + * file that was distributed with this source code.
  2644. + */
  2645. +
  2646. +namespace Symfony\Component\CssSelector\Node;
  2647. +
  2648. +/**
  2649. + * Interface for nodes.
  2650. + *
  2651. + * This component is a port of the Python cssselector library,
  2652. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2653. + *
  2654. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2655. + */
  2656. +interface NodeInterface
  2657. +{
  2658. +    /**
  2659. +     * Returns node's name.
  2660. +     *
  2661. +     * @return string
  2662. +     */
  2663. +    public function getNodeName();
  2664. +
  2665. +    /**
  2666. +     * Returns node's specificity.
  2667. +     *
  2668. +     * @return Specificity
  2669. +     */
  2670. +    public function getSpecificity();
  2671. +
  2672. +    /**
  2673. +     * Returns node's string representation.
  2674. +     *
  2675. +     * @return string
  2676. +     */
  2677. +    public function __toString();
  2678. +}
  2679. 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
  2680. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/PseudoNode.php    1970-01-01 01:00:00.000000000 +0100
  2681. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/PseudoNode.php   2014-11-19 15:54:29.680100118 +0100
  2682. @@ -0,0 +1,75 @@
  2683. +<?php
  2684. +
  2685. +/*
  2686. + * This file is part of the Symfony package.
  2687. + *
  2688. + * (c) Fabien Potencier <fabien@symfony.com>
  2689. + *
  2690. + * For the full copyright and license information, please view the LICENSE
  2691. + * file that was distributed with this source code.
  2692. + */
  2693. +
  2694. +namespace Symfony\Component\CssSelector\Node;
  2695. +
  2696. +/**
  2697. + * Represents a "<selector>:<identifier>" node.
  2698. + *
  2699. + * This component is a port of the Python cssselector library,
  2700. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2701. + *
  2702. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2703. + */
  2704. +class PseudoNode extends AbstractNode
  2705. +{
  2706. +    /**
  2707. +     * @var NodeInterface
  2708. +     */
  2709. +    private $selector;
  2710. +
  2711. +    /**
  2712. +     * @var string
  2713. +     */
  2714. +    private $identifier;
  2715. +
  2716. +    /**
  2717. +     * @param NodeInterface $selector
  2718. +     * @param string        $identifier
  2719. +     */
  2720. +    public function __construct(NodeInterface $selector, $identifier)
  2721. +    {
  2722. +        $this->selector = $selector;
  2723. +        $this->identifier = strtolower($identifier);
  2724. +    }
  2725. +
  2726. +    /**
  2727. +     * @return NodeInterface
  2728. +     */
  2729. +    public function getSelector()
  2730. +    {
  2731. +        return $this->selector;
  2732. +    }
  2733. +
  2734. +    /**
  2735. +     * @return string
  2736. +     */
  2737. +    public function getIdentifier()
  2738. +    {
  2739. +        return $this->identifier;
  2740. +    }
  2741. +
  2742. +    /**
  2743. +     * {@inheritdoc}
  2744. +     */
  2745. +    public function getSpecificity()
  2746. +    {
  2747. +        return $this->selector->getSpecificity()->plus(new Specificity(0, 1, 0));
  2748. +    }
  2749. +
  2750. +    /**
  2751. +     * {@inheritdoc}
  2752. +     */
  2753. +    public function __toString()
  2754. +    {
  2755. +        return sprintf('%s[%s:%s]', $this->getNodeName(), $this->selector, $this->identifier);
  2756. +    }
  2757. +}
  2758. 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
  2759. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/SelectorNode.php  1970-01-01 01:00:00.000000000 +0100
  2760. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/SelectorNode.php 2014-11-19 15:54:31.120100126 +0100
  2761. @@ -0,0 +1,75 @@
  2762. +<?php
  2763. +
  2764. +/*
  2765. + * This file is part of the Symfony package.
  2766. + *
  2767. + * (c) Fabien Potencier <fabien@symfony.com>
  2768. + *
  2769. + * For the full copyright and license information, please view the LICENSE
  2770. + * file that was distributed with this source code.
  2771. + */
  2772. +
  2773. +namespace Symfony\Component\CssSelector\Node;
  2774. +
  2775. +/**
  2776. + * Represents a "<selector>(::|:)<pseudoElement>" node.
  2777. + *
  2778. + * This component is a port of the Python cssselector library,
  2779. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2780. + *
  2781. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2782. + */
  2783. +class SelectorNode extends AbstractNode
  2784. +{
  2785. +    /**
  2786. +     * @var NodeInterface
  2787. +     */
  2788. +    private $tree;
  2789. +
  2790. +    /**
  2791. +     * @var null|string
  2792. +     */
  2793. +    private $pseudoElement;
  2794. +
  2795. +    /**
  2796. +     * @param NodeInterface $tree
  2797. +     * @param null|string   $pseudoElement
  2798. +     */
  2799. +    public function __construct(NodeInterface $tree, $pseudoElement = null)
  2800. +    {
  2801. +        $this->tree = $tree;
  2802. +        $this->pseudoElement = $pseudoElement ? strtolower($pseudoElement) : null;
  2803. +    }
  2804. +
  2805. +    /**
  2806. +     * @return NodeInterface
  2807. +     */
  2808. +    public function getTree()
  2809. +    {
  2810. +        return $this->tree;
  2811. +    }
  2812. +
  2813. +    /**
  2814. +     * @return null|string
  2815. +     */
  2816. +    public function getPseudoElement()
  2817. +    {
  2818. +        return $this->pseudoElement;
  2819. +    }
  2820. +
  2821. +    /**
  2822. +     * {@inheritdoc}
  2823. +     */
  2824. +    public function getSpecificity()
  2825. +    {
  2826. +        return $this->tree->getSpecificity()->plus(new Specificity(0, 0, $this->pseudoElement ? 1 : 0));
  2827. +    }
  2828. +
  2829. +    /**
  2830. +     * {@inheritdoc}
  2831. +     */
  2832. +    public function __toString()
  2833. +    {
  2834. +        return sprintf('%s[%s%s]', $this->getNodeName(), $this->tree, $this->pseudoElement ? '::'.$this->pseudoElement : '');
  2835. +    }
  2836. +}
  2837. 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
  2838. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/Specificity.php   1970-01-01 01:00:00.000000000 +0100
  2839. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Node/Specificity.php  2014-11-19 15:54:30.960100126 +0100
  2840. @@ -0,0 +1,78 @@
  2841. +<?php
  2842. +
  2843. +/*
  2844. + * This file is part of the Symfony package.
  2845. + *
  2846. + * (c) Fabien Potencier <fabien@symfony.com>
  2847. + *
  2848. + * For the full copyright and license information, please view the LICENSE
  2849. + * file that was distributed with this source code.
  2850. + */
  2851. +
  2852. +namespace Symfony\Component\CssSelector\Node;
  2853. +
  2854. +/**
  2855. + * Represents a node specificity.
  2856. + *
  2857. + * This component is a port of the Python cssselector library,
  2858. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2859. + *
  2860. + * @see http://www.w3.org/TR/selectors/#specificity
  2861. + *
  2862. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2863. + */
  2864. +class Specificity
  2865. +{
  2866. +    const A_FACTOR = 100;
  2867. +    const B_FACTOR = 10;
  2868. +    const C_FACTOR = 1;
  2869. +
  2870. +    /**
  2871. +     * @var int
  2872. +     */
  2873. +    private $a;
  2874. +
  2875. +    /**
  2876. +     * @var int
  2877. +     */
  2878. +    private $b;
  2879. +
  2880. +    /**
  2881. +     * @var int
  2882. +     */
  2883. +    private $c;
  2884. +
  2885. +    /**
  2886. +     * Constructor.
  2887. +     *
  2888. +     * @param int $a
  2889. +     * @param int $b
  2890. +     * @param int $c
  2891. +     */
  2892. +    public function __construct($a, $b, $c)
  2893. +    {
  2894. +        $this->a = $a;
  2895. +        $this->b = $b;
  2896. +        $this->c = $c;
  2897. +    }
  2898. +
  2899. +    /**
  2900. +     * @param Specificity $specificity
  2901. +     *
  2902. +     * @return Specificity
  2903. +     */
  2904. +    public function plus(Specificity $specificity)
  2905. +    {
  2906. +        return new self($this->a + $specificity->a, $this->b + $specificity->b, $this->c + $specificity->c);
  2907. +    }
  2908. +
  2909. +    /**
  2910. +     * Returns global specificity value.
  2911. +     *
  2912. +     * @return int
  2913. +     */
  2914. +    public function getValue()
  2915. +    {
  2916. +        return $this->a * self::A_FACTOR + $this->b * self::B_FACTOR + $this->c * self::C_FACTOR;
  2917. +    }
  2918. +}
  2919. 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
  2920. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php  1970-01-01 01:00:00.000000000 +0100
  2921. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/CommentHandler.php 2014-11-19 15:54:12.840100016 +0100
  2922. @@ -0,0 +1,46 @@
  2923. +<?php
  2924. +
  2925. +/*
  2926. + * This file is part of the Symfony package.
  2927. + *
  2928. + * (c) Fabien Potencier <fabien@symfony.com>
  2929. + *
  2930. + * For the full copyright and license information, please view the LICENSE
  2931. + * file that was distributed with this source code.
  2932. + */
  2933. +
  2934. +namespace Symfony\Component\CssSelector\Parser\Handler;
  2935. +
  2936. +use Symfony\Component\CssSelector\Parser\Reader;
  2937. +use Symfony\Component\CssSelector\Parser\TokenStream;
  2938. +
  2939. +/**
  2940. + * CSS selector comment handler.
  2941. + *
  2942. + * This component is a port of the Python cssselector library,
  2943. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2944. + *
  2945. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2946. + */
  2947. +class CommentHandler implements HandlerInterface
  2948. +{
  2949. +    /**
  2950. +     * {@inheritdoc}
  2951. +     */
  2952. +    public function handle(Reader $reader, TokenStream $stream)
  2953. +    {
  2954. +        if ('/*' !== $reader->getSubstring(2)) {
  2955. +            return false;
  2956. +        }
  2957. +
  2958. +        $offset = $reader->getOffset('*/');
  2959. +
  2960. +        if (false === $offset) {
  2961. +            $reader->moveToEnd();
  2962. +        } else {
  2963. +            $reader->moveForward($offset + 2);
  2964. +        }
  2965. +
  2966. +        return true;
  2967. +    }
  2968. +}
  2969. 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
  2970. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php    1970-01-01 01:00:00.000000000 +0100
  2971. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HandlerInterface.php   2014-11-19 15:54:12.364100013 +0100
  2972. @@ -0,0 +1,34 @@
  2973. +<?php
  2974. +
  2975. +/*
  2976. + * This file is part of the Symfony package.
  2977. + *
  2978. + * (c) Fabien Potencier <fabien@symfony.com>
  2979. + *
  2980. + * For the full copyright and license information, please view the LICENSE
  2981. + * file that was distributed with this source code.
  2982. + */
  2983. +
  2984. +namespace Symfony\Component\CssSelector\Parser\Handler;
  2985. +
  2986. +use Symfony\Component\CssSelector\Parser\Reader;
  2987. +use Symfony\Component\CssSelector\Parser\TokenStream;
  2988. +
  2989. +/**
  2990. + * CSS selector handler interface.
  2991. + *
  2992. + * This component is a port of the Python cssselector library,
  2993. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  2994. + *
  2995. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  2996. + */
  2997. +interface HandlerInterface
  2998. +{
  2999. +    /**
  3000. +     * @param Reader      $reader
  3001. +     * @param TokenStream $stream
  3002. +     *
  3003. +     * @return bool
  3004. +     */
  3005. +    public function handle(Reader $reader, TokenStream $stream);
  3006. +}
  3007. 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
  3008. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php 1970-01-01 01:00:00.000000000 +0100
  3009. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/HashHandler.php    2014-11-19 15:54:12.520100014 +0100
  3010. @@ -0,0 +1,67 @@
  3011. +<?php
  3012. +
  3013. +/*
  3014. + * This file is part of the Symfony package.
  3015. + *
  3016. + * (c) Fabien Potencier <fabien@symfony.com>
  3017. + *
  3018. + * For the full copyright and license information, please view the LICENSE
  3019. + * file that was distributed with this source code.
  3020. + */
  3021. +
  3022. +namespace Symfony\Component\CssSelector\Parser\Handler;
  3023. +
  3024. +use Symfony\Component\CssSelector\Parser\Reader;
  3025. +use Symfony\Component\CssSelector\Parser\Token;
  3026. +use Symfony\Component\CssSelector\Parser\TokenStream;
  3027. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
  3028. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
  3029. +
  3030. +/**
  3031. + * CSS selector comment handler.
  3032. + *
  3033. + * This component is a port of the Python cssselector library,
  3034. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  3035. + *
  3036. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  3037. + */
  3038. +class HashHandler implements HandlerInterface
  3039. +{
  3040. +    /**
  3041. +     * @var TokenizerPatterns
  3042. +     */
  3043. +    private $patterns;
  3044. +
  3045. +    /**
  3046. +     * @var TokenizerEscaping
  3047. +     */
  3048. +    private $escaping;
  3049. +
  3050. +    /**
  3051. +     * @param TokenizerPatterns $patterns
  3052. +     * @param TokenizerEscaping $escaping
  3053. +     */
  3054. +    public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping)
  3055. +    {
  3056. +        $this->patterns = $patterns;
  3057. +        $this->escaping = $escaping;
  3058. +    }
  3059. +
  3060. +    /**
  3061. +     * {@inheritdoc}
  3062. +     */
  3063. +    public function handle(Reader $reader, TokenStream $stream)
  3064. +    {
  3065. +        $match = $reader->findPattern($this->patterns->getHashPattern());
  3066. +
  3067. +        if (!$match) {
  3068. +            return false;
  3069. +        }
  3070. +
  3071. +        $value = $this->escaping->escapeUnicode($match[1]);
  3072. +        $stream->push(new Token(Token::TYPE_HASH, $value, $reader->getPosition()));
  3073. +        $reader->moveForward(strlen($match[0]));
  3074. +
  3075. +        return true;
  3076. +    }
  3077. +}
  3078. 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
  3079. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php   1970-01-01 01:00:00.000000000 +0100
  3080. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/IdentifierHandler.php  2014-11-19 15:54:12.044100011 +0100
  3081. @@ -0,0 +1,67 @@
  3082. +<?php
  3083. +
  3084. +/*
  3085. + * This file is part of the Symfony package.
  3086. + *
  3087. + * (c) Fabien Potencier <fabien@symfony.com>
  3088. + *
  3089. + * For the full copyright and license information, please view the LICENSE
  3090. + * file that was distributed with this source code.
  3091. + */
  3092. +
  3093. +namespace Symfony\Component\CssSelector\Parser\Handler;
  3094. +
  3095. +use Symfony\Component\CssSelector\Parser\Reader;
  3096. +use Symfony\Component\CssSelector\Parser\Token;
  3097. +use Symfony\Component\CssSelector\Parser\TokenStream;
  3098. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
  3099. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
  3100. +
  3101. +/**
  3102. + * CSS selector comment handler.
  3103. + *
  3104. + * This component is a port of the Python cssselector library,
  3105. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  3106. + *
  3107. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  3108. + */
  3109. +class IdentifierHandler implements HandlerInterface
  3110. +{
  3111. +    /**
  3112. +     * @var TokenizerPatterns
  3113. +     */
  3114. +    private $patterns;
  3115. +
  3116. +    /**
  3117. +     * @var TokenizerEscaping
  3118. +     */
  3119. +    private $escaping;
  3120. +
  3121. +    /**
  3122. +     * @param TokenizerPatterns $patterns
  3123. +     * @param TokenizerEscaping $escaping
  3124. +     */
  3125. +    public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping)
  3126. +    {
  3127. +        $this->patterns = $patterns;
  3128. +        $this->escaping = $escaping;
  3129. +    }
  3130. +
  3131. +    /**
  3132. +     * {@inheritdoc}
  3133. +     */
  3134. +    public function handle(Reader $reader, TokenStream $stream)
  3135. +    {
  3136. +        $match = $reader->findPattern($this->patterns->getIdentifierPattern());
  3137. +
  3138. +        if (!$match) {
  3139. +            return false;
  3140. +        }
  3141. +
  3142. +        $value = $this->escaping->escapeUnicode($match[0]);
  3143. +        $stream->push(new Token(Token::TYPE_IDENTIFIER, $value, $reader->getPosition()));
  3144. +        $reader->moveForward(strlen($match[0]));
  3145. +
  3146. +        return true;
  3147. +    }
  3148. +}
  3149. 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
  3150. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php   1970-01-01 01:00:00.000000000 +0100
  3151. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/NumberHandler.php  2014-11-19 15:54:12.204100012 +0100
  3152. @@ -0,0 +1,58 @@
  3153. +<?php
  3154. +
  3155. +/*
  3156. + * This file is part of the Symfony package.
  3157. + *
  3158. + * (c) Fabien Potencier <fabien@symfony.com>
  3159. + *
  3160. + * For the full copyright and license information, please view the LICENSE
  3161. + * file that was distributed with this source code.
  3162. + */
  3163. +
  3164. +namespace Symfony\Component\CssSelector\Parser\Handler;
  3165. +
  3166. +use Symfony\Component\CssSelector\Parser\Reader;
  3167. +use Symfony\Component\CssSelector\Parser\Token;
  3168. +use Symfony\Component\CssSelector\Parser\TokenStream;
  3169. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
  3170. +
  3171. +/**
  3172. + * CSS selector comment handler.
  3173. + *
  3174. + * This component is a port of the Python cssselector library,
  3175. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  3176. + *
  3177. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  3178. + */
  3179. +class NumberHandler implements HandlerInterface
  3180. +{
  3181. +    /**
  3182. +     * @var TokenizerPatterns
  3183. +     */
  3184. +    private $patterns;
  3185. +
  3186. +    /**
  3187. +     * @param TokenizerPatterns $patterns
  3188. +     */
  3189. +    public function __construct(TokenizerPatterns $patterns)
  3190. +    {
  3191. +        $this->patterns = $patterns;
  3192. +    }
  3193. +
  3194. +    /**
  3195. +     * {@inheritdoc}
  3196. +     */
  3197. +    public function handle(Reader $reader, TokenStream $stream)
  3198. +    {
  3199. +        $match = $reader->findPattern($this->patterns->getNumberPattern());
  3200. +
  3201. +        if (!$match) {
  3202. +            return false;
  3203. +        }
  3204. +
  3205. +        $stream->push(new Token(Token::TYPE_NUMBER, $match[0], $reader->getPosition()));
  3206. +        $reader->moveForward(strlen($match[0]));
  3207. +
  3208. +        return true;
  3209. +    }
  3210. +}
  3211. 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
  3212. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php   1970-01-01 01:00:00.000000000 +0100
  3213. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/StringHandler.php  2014-11-19 15:54:12.680100015 +0100
  3214. @@ -0,0 +1,86 @@
  3215. +<?php
  3216. +
  3217. +/*
  3218. + * This file is part of the Symfony package.
  3219. + *
  3220. + * (c) Fabien Potencier <fabien@symfony.com>
  3221. + *
  3222. + * For the full copyright and license information, please view the LICENSE
  3223. + * file that was distributed with this source code.
  3224. + */
  3225. +
  3226. +namespace Symfony\Component\CssSelector\Parser\Handler;
  3227. +
  3228. +use Symfony\Component\CssSelector\Exception\InternalErrorException;
  3229. +use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
  3230. +use Symfony\Component\CssSelector\Parser\Reader;
  3231. +use Symfony\Component\CssSelector\Parser\Token;
  3232. +use Symfony\Component\CssSelector\Parser\TokenStream;
  3233. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
  3234. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
  3235. +
  3236. +/**
  3237. + * CSS selector comment handler.
  3238. + *
  3239. + * This component is a port of the Python cssselector library,
  3240. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  3241. + *
  3242. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  3243. + */
  3244. +class StringHandler implements HandlerInterface
  3245. +{
  3246. +    /**
  3247. +     * @var TokenizerPatterns
  3248. +     */
  3249. +    private $patterns;
  3250. +
  3251. +    /**
  3252. +     * @var TokenizerEscaping
  3253. +     */
  3254. +    private $escaping;
  3255. +
  3256. +    /**
  3257. +     * @param TokenizerPatterns $patterns
  3258. +     * @param TokenizerEscaping $escaping
  3259. +     */
  3260. +    public function __construct(TokenizerPatterns $patterns, TokenizerEscaping $escaping)
  3261. +    {
  3262. +        $this->patterns = $patterns;
  3263. +        $this->escaping = $escaping;
  3264. +    }
  3265. +
  3266. +    /**
  3267. +     * {@inheritdoc}
  3268. +     */
  3269. +    public function handle(Reader $reader, TokenStream $stream)
  3270. +    {
  3271. +        $quote = $reader->getSubstring(1);
  3272. +
  3273. +        if (!in_array($quote, array("'", '"'))) {
  3274. +            return false;
  3275. +        }
  3276. +
  3277. +        $reader->moveForward(1);
  3278. +        $match = $reader->findPattern($this->patterns->getQuotedStringPattern($quote));
  3279. +
  3280. +        if (!$match) {
  3281. +            throw new InternalErrorException(sprintf('Should have found at least an empty match at %s.', $reader->getPosition()));
  3282. +        }
  3283. +
  3284. +        // check unclosed strings
  3285. +        if (strlen($match[0]) === $reader->getRemainingLength()) {
  3286. +            throw SyntaxErrorException::unclosedString($reader->getPosition() - 1);
  3287. +        }
  3288. +
  3289. +        // check quotes pairs validity
  3290. +        if ($quote !== $reader->getSubstring(1, strlen($match[0]))) {
  3291. +            throw SyntaxErrorException::unclosedString($reader->getPosition() - 1);
  3292. +        }
  3293. +
  3294. +        $string = $this->escaping->escapeUnicodeAndNewLine($match[0]);
  3295. +        $stream->push(new Token(Token::TYPE_STRING, $string, $reader->getPosition()));
  3296. +        $reader->moveForward(strlen($match[0]) + 1);
  3297. +
  3298. +        return true;
  3299. +    }
  3300. +}
  3301. 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
  3302. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php   1970-01-01 01:00:00.000000000 +0100
  3303. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Handler/WhitespaceHandler.php  2014-11-19 15:54:13.000100017 +0100
  3304. @@ -0,0 +1,44 @@
  3305. +<?php
  3306. +
  3307. +/*
  3308. + * This file is part of the Symfony package.
  3309. + *
  3310. + * (c) Fabien Potencier <fabien@symfony.com>
  3311. + *
  3312. + * For the full copyright and license information, please view the LICENSE
  3313. + * file that was distributed with this source code.
  3314. + */
  3315. +
  3316. +namespace Symfony\Component\CssSelector\Parser\Handler;
  3317. +
  3318. +use Symfony\Component\CssSelector\Parser\Reader;
  3319. +use Symfony\Component\CssSelector\Parser\Token;
  3320. +use Symfony\Component\CssSelector\Parser\TokenStream;
  3321. +
  3322. +/**
  3323. + * CSS selector whitespace handler.
  3324. + *
  3325. + * This component is a port of the Python cssselector library,
  3326. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  3327. + *
  3328. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  3329. + */
  3330. +class WhitespaceHandler implements HandlerInterface
  3331. +{
  3332. +    /**
  3333. +     * {@inheritdoc}
  3334. +     */
  3335. +    public function handle(Reader $reader, TokenStream $stream)
  3336. +    {
  3337. +        $match = $reader->findPattern('~^[ \t\r\n\f]+~');
  3338. +
  3339. +        if (false === $match) {
  3340. +            return false;
  3341. +        }
  3342. +
  3343. +        $stream->push(new Token(Token::TYPE_WHITESPACE, $match[0], $reader->getPosition()));
  3344. +        $reader->moveForward(strlen($match[0]));
  3345. +
  3346. +        return true;
  3347. +    }
  3348. +}
  3349. 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
  3350. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/ParserInterface.php 1970-01-01 01:00:00.000000000 +0100
  3351. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/ParserInterface.php    2014-11-19 15:54:13.324100019 +0100
  3352. @@ -0,0 +1,34 @@
  3353. +<?php
  3354. +
  3355. +/*
  3356. + * This file is part of the Symfony package.
  3357. + *
  3358. + * (c) Fabien Potencier <fabien@symfony.com>
  3359. + *
  3360. + * For the full copyright and license information, please view the LICENSE
  3361. + * file that was distributed with this source code.
  3362. + */
  3363. +
  3364. +namespace Symfony\Component\CssSelector\Parser;
  3365. +
  3366. +use Symfony\Component\CssSelector\Node\SelectorNode;
  3367. +
  3368. +/**
  3369. + * CSS selector parser interface.
  3370. + *
  3371. + * This component is a port of the Python cssselector library,
  3372. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  3373. + *
  3374. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  3375. + */
  3376. +interface ParserInterface
  3377. +{
  3378. +    /**
  3379. +     * Parses given selector source into an array of tokens.
  3380. +     *
  3381. +     * @param string $source
  3382. +     *
  3383. +     * @return SelectorNode[]
  3384. +     */
  3385. +    public function parse($source);
  3386. +}
  3387. 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
  3388. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Parser.php  1970-01-01 01:00:00.000000000 +0100
  3389. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Parser.php 2014-11-19 15:54:13.496100020 +0100
  3390. @@ -0,0 +1,399 @@
  3391. +<?php
  3392. +
  3393. +/*
  3394. + * This file is part of the Symfony package.
  3395. + *
  3396. + * (c) Fabien Potencier <fabien@symfony.com>
  3397. + *
  3398. + * For the full copyright and license information, please view the LICENSE
  3399. + * file that was distributed with this source code.
  3400. + */
  3401. +
  3402. +namespace Symfony\Component\CssSelector\Parser;
  3403. +
  3404. +use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
  3405. +use Symfony\Component\CssSelector\Node;
  3406. +use Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer;
  3407. +
  3408. +/**
  3409. + * CSS selector parser.
  3410. + *
  3411. + * This component is a port of the Python cssselector library,
  3412. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  3413. + *
  3414. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  3415. + */
  3416. +class Parser implements ParserInterface
  3417. +{
  3418. +    /**
  3419. +     * @var Tokenizer
  3420. +     */
  3421. +    private $tokenizer;
  3422. +
  3423. +    /**
  3424. +     * Constructor.
  3425. +     *
  3426. +     * @param null|Tokenizer $tokenizer
  3427. +     */
  3428. +    public function __construct(Tokenizer $tokenizer = null)
  3429. +    {
  3430. +        $this->tokenizer = $tokenizer ?: new Tokenizer();
  3431. +    }
  3432. +
  3433. +    /**
  3434. +     * {@inheritdoc}
  3435. +     */
  3436. +    public function parse($source)
  3437. +    {
  3438. +        $reader = new Reader($source);
  3439. +        $stream = $this->tokenizer->tokenize($reader);
  3440. +
  3441. +        return $this->parseSelectorList($stream);
  3442. +    }
  3443. +
  3444. +    /**
  3445. +     * Parses the arguments for ":nth-child()" and friends.
  3446. +     *
  3447. +     * @param Token[] $tokens
  3448. +     *
  3449. +     * @throws SyntaxErrorException
  3450. +     *
  3451. +     * @return array
  3452. +     */
  3453. +    public static function parseSeries(array $tokens)
  3454. +    {
  3455. +        foreach ($tokens as $token) {
  3456. +            if ($token->isString()) {
  3457. +                throw SyntaxErrorException::stringAsFunctionArgument();
  3458. +            }
  3459. +        }
  3460. +
  3461. +        $joined = trim(implode('', array_map(function (Token $token) {
  3462. +            return $token->getValue();
  3463. +        }, $tokens)));
  3464. +
  3465. +        $int = function ($string) {
  3466. +            if (!is_numeric($string)) {
  3467. +                throw SyntaxErrorException::stringAsFunctionArgument();
  3468. +            }
  3469. +
  3470. +            return (int) $string;
  3471. +        };
  3472. +
  3473. +        switch (true) {
  3474. +            case 'odd' === $joined:
  3475. +                return array(2, 1);
  3476. +            case 'even' === $joined:
  3477. +                return array(2, 0);
  3478. +            case 'n' === $joined:
  3479. +                return array(1, 0);
  3480. +            case false === strpos($joined, 'n'):
  3481. +                return array(0, $int($joined));
  3482. +        }
  3483. +
  3484. +        $split = explode('n', $joined);
  3485. +        $first = isset($split[0]) ? $split[0] : null;
  3486. +
  3487. +        return array(
  3488. +            $first ? ('-' === $first || '+' === $first ? $int($first.'1') : $int($first)) : 1,
  3489. +            isset($split[1]) && $split[1] ? $int($split[1]) : 0,
  3490. +        );
  3491. +    }
  3492. +
  3493. +    /**
  3494. +     * Parses selector nodes.
  3495. +     *
  3496. +     * @param TokenStream $stream
  3497. +     *
  3498. +     * @return array
  3499. +     */
  3500. +    private function parseSelectorList(TokenStream $stream)
  3501. +    {
  3502. +        $stream->skipWhitespace();
  3503. +        $selectors = array();
  3504. +
  3505. +        while (true) {
  3506. +            $selectors[] = $this->parserSelectorNode($stream);
  3507. +
  3508. +            if ($stream->getPeek()->isDelimiter(array(','))) {
  3509. +                $stream->getNext();
  3510. +                $stream->skipWhitespace();
  3511. +            } else {
  3512. +                break;
  3513. +            }
  3514. +        }
  3515. +
  3516. +        return $selectors;
  3517. +    }
  3518. +
  3519. +    /**
  3520. +     * Parses next selector or combined node.
  3521. +     *
  3522. +     * @param TokenStream $stream
  3523. +     *
  3524. +     * @throws SyntaxErrorException
  3525. +     *
  3526. +     * @return Node\SelectorNode
  3527. +     */
  3528. +    private function parserSelectorNode(TokenStream $stream)
  3529. +    {
  3530. +        list($result, $pseudoElement) = $this->parseSimpleSelector($stream);
  3531. +
  3532. +        while (true) {
  3533. +            $stream->skipWhitespace();
  3534. +            $peek = $stream->getPeek();
  3535. +
  3536. +            if ($peek->isFileEnd() || $peek->isDelimiter(array(','))) {
  3537. +                break;
  3538. +            }
  3539. +
  3540. +            if (null !== $pseudoElement) {
  3541. +                throw SyntaxErrorException::pseudoElementFound($pseudoElement, 'not at the end of a selector');
  3542. +            }
  3543. +
  3544. +            if ($peek->isDelimiter(array('+', '>', '~'))) {
  3545. +                $combinator = $stream->getNext()->getValue();
  3546. +                $stream->skipWhitespace();
  3547. +            } else {
  3548. +                $combinator = ' ';
  3549. +            }
  3550. +
  3551. +            list($nextSelector, $pseudoElement) = $this->parseSimpleSelector($stream);
  3552. +            $result = new Node\CombinedSelectorNode($result, $combinator, $nextSelector);
  3553. +        }
  3554. +
  3555. +        return new Node\SelectorNode($result, $pseudoElement);
  3556. +    }
  3557. +
  3558. +    /**
  3559. +     * Parses next simple node (hash, class, pseudo, negation).
  3560. +     *
  3561. +     * @param TokenStream $stream
  3562. +     * @param bool        $insideNegation
  3563. +     *
  3564. +     * @throws SyntaxErrorException
  3565. +     *
  3566. +     * @return array
  3567. +     */
  3568. +    private function parseSimpleSelector(TokenStream $stream, $insideNegation = false)
  3569. +    {
  3570. +        $stream->skipWhitespace();
  3571. +
  3572. +        $selectorStart = count($stream->getUsed());
  3573. +        $result = $this->parseElementNode($stream);
  3574. +        $pseudoElement = null;
  3575. +
  3576. +        while (true) {
  3577. +            $peek = $stream->getPeek();
  3578. +            if ($peek->isWhitespace()
  3579. +                || $peek->isFileEnd()
  3580. +                || $peek->isDelimiter(array(',', '+', '>', '~'))
  3581. +                || ($insideNegation && $peek->isDelimiter(array(')')))
  3582. +            ) {
  3583. +                break;
  3584. +            }
  3585. +
  3586. +            if (null !== $pseudoElement) {
  3587. +                throw SyntaxErrorException::pseudoElementFound($pseudoElement, 'not at the end of a selector');
  3588. +            }
  3589. +
  3590. +            if ($peek->isHash()) {
  3591. +                $result = new Node\HashNode($result, $stream->getNext()->getValue());
  3592. +            } elseif ($peek->isDelimiter(array('.'))) {
  3593. +                $stream->getNext();
  3594. +                $result = new Node\ClassNode($result, $stream->getNextIdentifier());
  3595. +            } elseif ($peek->isDelimiter(array('['))) {
  3596. +                $stream->getNext();
  3597. +                $result = $this->parseAttributeNode($result, $stream);
  3598. +            } elseif ($peek->isDelimiter(array(':'))) {
  3599. +                $stream->getNext();
  3600. +
  3601. +                if ($stream->getPeek()->isDelimiter(array(':'))) {
  3602. +                    $stream->getNext();
  3603. +                    $pseudoElement = $stream->getNextIdentifier();
  3604. +
  3605. +                    continue;
  3606. +                }
  3607. +
  3608. +                $identifier = $stream->getNextIdentifier();
  3609. +                if (in_array(strtolower($identifier), array('first-line', 'first-letter', 'before', 'after'))) {
  3610. +                    // Special case: CSS 2.1 pseudo-elements can have a single ':'.
  3611. +                    // Any new pseudo-element must have two.
  3612. +                    $pseudoElement = $identifier;
  3613. +
  3614. +                    continue;
  3615. +                }
  3616. +
  3617. +                if (!$stream->getPeek()->isDelimiter(array('('))) {
  3618. +                    $result = new Node\PseudoNode($result, $identifier);
  3619. +
  3620. +                    continue;
  3621. +                }
  3622. +
  3623. +                $stream->getNext();
  3624. +                $stream->skipWhitespace();
  3625. +
  3626. +                if ('not' === strtolower($identifier)) {
  3627. +                    if ($insideNegation) {
  3628. +                        throw SyntaxErrorException::nestedNot();
  3629. +                    }
  3630. +
  3631. +                    list($argument, $argumentPseudoElement) = $this->parseSimpleSelector($stream, true);
  3632. +                    $next = $stream->getNext();
  3633. +
  3634. +                    if (null !== $argumentPseudoElement) {
  3635. +                        throw SyntaxErrorException::pseudoElementFound($argumentPseudoElement, 'inside ::not()');
  3636. +                    }
  3637. +
  3638. +                    if (!$next->isDelimiter(array(')'))) {
  3639. +                        throw SyntaxErrorException::unexpectedToken('")"', $next);
  3640. +                    }
  3641. +
  3642. +                    $result = new Node\NegationNode($result, $argument);
  3643. +                } else {
  3644. +                    $arguments = array();
  3645. +                    $next = null;
  3646. +
  3647. +                    while (true) {
  3648. +                        $stream->skipWhitespace();
  3649. +                        $next = $stream->getNext();
  3650. +
  3651. +                        if ($next->isIdentifier()
  3652. +                            || $next->isString()
  3653. +                            || $next->isNumber()
  3654. +                            || $next->isDelimiter(array('+', '-'))
  3655. +                        ) {
  3656. +                            $arguments[] = $next;
  3657. +                        } elseif ($next->isDelimiter(array(')'))) {
  3658. +                            break;
  3659. +                        } else {
  3660. +                            throw SyntaxErrorException::unexpectedToken('an argument', $next);
  3661. +                        }
  3662. +                    }
  3663. +
  3664. +                    if (empty($arguments)) {
  3665. +                        throw SyntaxErrorException::unexpectedToken('at least one argument', $next);
  3666. +                    }
  3667. +
  3668. +                    $result = new Node\FunctionNode($result, $identifier, $arguments);
  3669. +                }
  3670. +            } else {
  3671. +                throw SyntaxErrorException::unexpectedToken('selector', $peek);
  3672. +            }
  3673. +        }
  3674. +
  3675. +        if (count($stream->getUsed()) === $selectorStart) {
  3676. +            throw SyntaxErrorException::unexpectedToken('selector', $stream->getPeek());
  3677. +        }
  3678. +
  3679. +        return array($result, $pseudoElement);
  3680. +    }
  3681. +
  3682. +    /**
  3683. +     * Parses next element node.
  3684. +     *
  3685. +     * @param TokenStream $stream
  3686. +     *
  3687. +     * @return Node\ElementNode
  3688. +     */
  3689. +    private function parseElementNode(TokenStream $stream)
  3690. +    {
  3691. +        $peek = $stream->getPeek();
  3692. +
  3693. +        if ($peek->isIdentifier() || $peek->isDelimiter(array('*'))) {
  3694. +            if ($peek->isIdentifier()) {
  3695. +                $namespace = $stream->getNext()->getValue();
  3696. +            } else {
  3697. +                $stream->getNext();
  3698. +                $namespace = null;
  3699. +            }
  3700. +
  3701. +            if ($stream->getPeek()->isDelimiter(array('|'))) {
  3702. +                $stream->getNext();
  3703. +                $element = $stream->getNextIdentifierOrStar();
  3704. +            } else {
  3705. +                $element = $namespace;
  3706. +                $namespace = null;
  3707. +            }
  3708. +        } else {
  3709. +            $element = $namespace = null;
  3710. +        }
  3711. +
  3712. +        return new Node\ElementNode($namespace, $element);
  3713. +    }
  3714. +
  3715. +    /**
  3716. +     * Parses next attribute node.
  3717. +     *
  3718. +     * @param Node\NodeInterface $selector
  3719. +     * @param TokenStream        $stream
  3720. +     *
  3721. +     * @throws SyntaxErrorException
  3722. +     *
  3723. +     * @return Node\AttributeNode
  3724. +     */
  3725. +    private function parseAttributeNode(Node\NodeInterface $selector, TokenStream $stream)
  3726. +    {
  3727. +        $stream->skipWhitespace();
  3728. +        $attribute = $stream->getNextIdentifierOrStar();
  3729. +
  3730. +        if (null === $attribute && !$stream->getPeek()->isDelimiter(array('|'))) {
  3731. +            throw SyntaxErrorException::unexpectedToken('"|"', $stream->getPeek());
  3732. +        }
  3733. +
  3734. +        if ($stream->getPeek()->isDelimiter(array('|'))) {
  3735. +            $stream->getNext();
  3736. +
  3737. +            if ($stream->getPeek()->isDelimiter(array('='))) {
  3738. +                $namespace = null;
  3739. +                $stream->getNext();
  3740. +                $operator = '|=';
  3741. +            } else {
  3742. +                $namespace = $attribute;
  3743. +                $attribute = $stream->getNextIdentifier();
  3744. +                $operator = null;
  3745. +            }
  3746. +        } else {
  3747. +            $namespace = $operator = null;
  3748. +        }
  3749. +
  3750. +        if (null === $operator) {
  3751. +            $stream->skipWhitespace();
  3752. +            $next = $stream->getNext();
  3753. +
  3754. +            if ($next->isDelimiter(array(']'))) {
  3755. +                return new Node\AttributeNode($selector, $namespace, $attribute, 'exists', null);
  3756. +            } elseif ($next->isDelimiter(array('='))) {
  3757. +                $operator = '=';
  3758. +            } elseif ($next->isDelimiter(array('^', '$', '*', '~', '|', '!'))
  3759. +                && $stream->getPeek()->isDelimiter(array('='))
  3760. +            ) {
  3761. +                $operator = $next->getValue().'=';
  3762. +                $stream->getNext();
  3763. +            } else {
  3764. +                throw SyntaxErrorException::unexpectedToken('operator', $next);
  3765. +            }
  3766. +        }
  3767. +
  3768. +        $stream->skipWhitespace();
  3769. +        $value = $stream->getNext();
  3770. +
  3771. +        if ($value->isNumber()) {
  3772. +            // if the value is a number, it's casted into a string
  3773. +            $value = new Token(Token::TYPE_STRING, (string) $value->getValue(), $value->getPosition());
  3774. +        }
  3775. +
  3776. +        if (!($value->isIdentifier() || $value->isString())) {
  3777. +            throw SyntaxErrorException::unexpectedToken('string or identifier', $value);
  3778. +        }
  3779. +
  3780. +        $stream->skipWhitespace();
  3781. +        $next = $stream->getNext();
  3782. +
  3783. +        if (!$next->isDelimiter(array(']'))) {
  3784. +            throw SyntaxErrorException::unexpectedToken('"]"', $next);
  3785. +        }
  3786. +
  3787. +        return new Node\AttributeNode($selector, $namespace, $attribute, $operator, $value->getValue());
  3788. +    }
  3789. +}
  3790. 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
  3791. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Reader.php  1970-01-01 01:00:00.000000000 +0100
  3792. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Reader.php 2014-11-19 15:54:15.408100031 +0100
  3793. @@ -0,0 +1,125 @@
  3794. +<?php
  3795. +
  3796. +/*
  3797. + * This file is part of the Symfony package.
  3798. + *
  3799. + * (c) Fabien Potencier <fabien@symfony.com>
  3800. + *
  3801. + * For the full copyright and license information, please view the LICENSE
  3802. + * file that was distributed with this source code.
  3803. + */
  3804. +
  3805. +namespace Symfony\Component\CssSelector\Parser;
  3806. +
  3807. +/**
  3808. + * CSS selector reader.
  3809. + *
  3810. + * This component is a port of the Python cssselector library,
  3811. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  3812. + *
  3813. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  3814. + */
  3815. +class Reader
  3816. +{
  3817. +    /**
  3818. +     * @var string
  3819. +     */
  3820. +    private $source;
  3821. +
  3822. +    /**
  3823. +     * @var int
  3824. +     */
  3825. +    private $length;
  3826. +
  3827. +    /**
  3828. +     * @var int
  3829. +     */
  3830. +    private $position = 0;
  3831. +
  3832. +    /**
  3833. +     * @param string $source
  3834. +     */
  3835. +    public function __construct($source)
  3836. +    {
  3837. +        $this->source = $source;
  3838. +        $this->length = strlen($source);
  3839. +    }
  3840. +
  3841. +    /**
  3842. +     * @return bool
  3843. +     */
  3844. +    public function isEOF()
  3845. +    {
  3846. +        return $this->position >= $this->length;
  3847. +    }
  3848. +
  3849. +    /**
  3850. +     * @return int
  3851. +     */
  3852. +    public function getPosition()
  3853. +    {
  3854. +        return $this->position;
  3855. +    }
  3856. +
  3857. +    /**
  3858. +     * @return int
  3859. +     */
  3860. +    public function getRemainingLength()
  3861. +    {
  3862. +        return $this->length - $this->position;
  3863. +    }
  3864. +
  3865. +    /**
  3866. +     * @param int $length
  3867. +     * @param int $offset
  3868. +     *
  3869. +     * @return string
  3870. +     */
  3871. +    public function getSubstring($length, $offset = 0)
  3872. +    {
  3873. +        return substr($this->source, $this->position + $offset, $length);
  3874. +    }
  3875. +
  3876. +    /**
  3877. +     * @param string $string
  3878. +     *
  3879. +     * @return int
  3880. +     */
  3881. +    public function getOffset($string)
  3882. +    {
  3883. +        $position = strpos($this->source, $string, $this->position);
  3884. +
  3885. +        return false === $position ? false : $position - $this->position;
  3886. +    }
  3887. +
  3888. +    /**
  3889. +     * @param string $pattern
  3890. +     *
  3891. +     * @return bool
  3892. +     */
  3893. +    public function findPattern($pattern)
  3894. +    {
  3895. +        $source = substr($this->source, $this->position);
  3896. +
  3897. +        if (preg_match($pattern, $source, $matches)) {
  3898. +            return $matches;
  3899. +        }
  3900. +
  3901. +        return false;
  3902. +    }
  3903. +
  3904. +    /**
  3905. +     * @param int $length
  3906. +     */
  3907. +    public function moveForward($length)
  3908. +    {
  3909. +        $this->position += $length;
  3910. +    }
  3911. +
  3912. +    /**
  3913. +     */
  3914. +    public function moveToEnd()
  3915. +    {
  3916. +        $this->position = $this->length;
  3917. +    }
  3918. +}
  3919. 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
  3920. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php    1970-01-01 01:00:00.000000000 +0100
  3921. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php   2014-11-19 15:54:15.088100029 +0100
  3922. @@ -0,0 +1,50 @@
  3923. +<?php
  3924. +
  3925. +/*
  3926. + * This file is part of the Symfony package.
  3927. + *
  3928. + * (c) Fabien Potencier <fabien@symfony.com>
  3929. + *
  3930. + * For the full copyright and license information, please view the LICENSE
  3931. + * file that was distributed with this source code.
  3932. + */
  3933. +
  3934. +namespace Symfony\Component\CssSelector\Parser\Shortcut;
  3935. +
  3936. +use Symfony\Component\CssSelector\Node\ClassNode;
  3937. +use Symfony\Component\CssSelector\Node\ElementNode;
  3938. +use Symfony\Component\CssSelector\Node\SelectorNode;
  3939. +use Symfony\Component\CssSelector\Parser\ParserInterface;
  3940. +
  3941. +/**
  3942. + * CSS selector class parser shortcut.
  3943. + *
  3944. + * This component is a port of the Python cssselector library,
  3945. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  3946. + *
  3947. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  3948. + */
  3949. +class ClassParser implements ParserInterface
  3950. +{
  3951. +    /**
  3952. +     * {@inheritdoc}
  3953. +     */
  3954. +    public function parse($source)
  3955. +    {
  3956. +        // Matches an optional namespace, optional element, and required class
  3957. +        // $source = 'test|input.ab6bd_field';
  3958. +        // $matches = array (size=5)
  3959. +        //     0 => string 'test:input.ab6bd_field' (length=22)
  3960. +        //     1 => string 'test:' (length=5)
  3961. +        //     2 => string 'test' (length=4)
  3962. +        //     3 => string 'input' (length=5)
  3963. +        //     4 => string 'ab6bd_field' (length=11)
  3964. +        if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?\.([\w-]+)$/i', trim($source), $matches)) {
  3965. +            return array(
  3966. +                new SelectorNode(new ClassNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])),
  3967. +            );
  3968. +        }
  3969. +
  3970. +        return array();
  3971. +    }
  3972. +}
  3973. 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
  3974. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php  1970-01-01 01:00:00.000000000 +0100
  3975. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php 2014-11-19 15:54:15.248100030 +0100
  3976. @@ -0,0 +1,46 @@
  3977. +<?php
  3978. +
  3979. +/*
  3980. + * This file is part of the Symfony package.
  3981. + *
  3982. + * (c) Fabien Potencier <fabien@symfony.com>
  3983. + *
  3984. + * For the full copyright and license information, please view the LICENSE
  3985. + * file that was distributed with this source code.
  3986. + */
  3987. +
  3988. +namespace Symfony\Component\CssSelector\Parser\Shortcut;
  3989. +
  3990. +use Symfony\Component\CssSelector\Node\ElementNode;
  3991. +use Symfony\Component\CssSelector\Node\SelectorNode;
  3992. +use Symfony\Component\CssSelector\Parser\ParserInterface;
  3993. +
  3994. +/**
  3995. + * CSS selector element parser shortcut.
  3996. + *
  3997. + * This component is a port of the Python cssselector library,
  3998. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  3999. + *
  4000. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  4001. + */
  4002. +class ElementParser implements ParserInterface
  4003. +{
  4004. +    /**
  4005. +     * {@inheritdoc}
  4006. +     */
  4007. +    public function parse($source)
  4008. +    {
  4009. +        // Matches an optional namespace, required element or `*`
  4010. +        // $source = 'testns|testel';
  4011. +        // $matches = array (size=4)
  4012. +        //     0 => string 'testns:testel' (length=13)
  4013. +        //     1 => string 'testns:' (length=7)
  4014. +        //     2 => string 'testns' (length=6)
  4015. +        //     3 => string 'testel' (length=6)
  4016. +        if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)$/i', trim($source), $matches)) {
  4017. +            return array(new SelectorNode(new ElementNode($matches[2] ?: null, $matches[3])));
  4018. +        }
  4019. +
  4020. +        return array();
  4021. +    }
  4022. +}
  4023. 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
  4024. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php  1970-01-01 01:00:00.000000000 +0100
  4025. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/EmptyStringParser.php 2014-11-19 15:54:14.768100028 +0100
  4026. @@ -0,0 +1,44 @@
  4027. +<?php
  4028. +
  4029. +/*
  4030. + * This file is part of the Symfony package.
  4031. + *
  4032. + * (c) Fabien Potencier <fabien@symfony.com>
  4033. + *
  4034. + * For the full copyright and license information, please view the LICENSE
  4035. + * file that was distributed with this source code.
  4036. + */
  4037. +
  4038. +namespace Symfony\Component\CssSelector\Parser\Shortcut;
  4039. +
  4040. +use Symfony\Component\CssSelector\Node\ElementNode;
  4041. +use Symfony\Component\CssSelector\Node\SelectorNode;
  4042. +use Symfony\Component\CssSelector\Parser\ParserInterface;
  4043. +
  4044. +/**
  4045. + * CSS selector class parser shortcut.
  4046. + *
  4047. + * This shortcut ensure compatibility with previous version.
  4048. + * - The parser fails to parse an empty string.
  4049. + * - In the previous version, an empty string matches each tags.
  4050. + *
  4051. + * This component is a port of the Python cssselector library,
  4052. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  4053. + *
  4054. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  4055. + */
  4056. +class EmptyStringParser implements ParserInterface
  4057. +{
  4058. +    /**
  4059. +     * {@inheritdoc}
  4060. +     */
  4061. +    public function parse($source)
  4062. +    {
  4063. +        // Matches an empty string
  4064. +        if ($source == '') {
  4065. +            return array(new SelectorNode(new ElementNode(null, '*')));
  4066. +        }
  4067. +
  4068. +        return array();
  4069. +    }
  4070. +}
  4071. 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
  4072. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php 1970-01-01 01:00:00.000000000 +0100
  4073. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php    2014-11-19 15:54:14.928100028 +0100
  4074. @@ -0,0 +1,50 @@
  4075. +<?php
  4076. +
  4077. +/*
  4078. + * This file is part of the Symfony package.
  4079. + *
  4080. + * (c) Fabien Potencier <fabien@symfony.com>
  4081. + *
  4082. + * For the full copyright and license information, please view the LICENSE
  4083. + * file that was distributed with this source code.
  4084. + */
  4085. +
  4086. +namespace Symfony\Component\CssSelector\Parser\Shortcut;
  4087. +
  4088. +use Symfony\Component\CssSelector\Node\ElementNode;
  4089. +use Symfony\Component\CssSelector\Node\HashNode;
  4090. +use Symfony\Component\CssSelector\Node\SelectorNode;
  4091. +use Symfony\Component\CssSelector\Parser\ParserInterface;
  4092. +
  4093. +/**
  4094. + * CSS selector hash parser shortcut.
  4095. + *
  4096. + * This component is a port of the Python cssselector library,
  4097. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  4098. + *
  4099. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  4100. + */
  4101. +class HashParser implements ParserInterface
  4102. +{
  4103. +    /**
  4104. +     * {@inheritdoc}
  4105. +     */
  4106. +    public function parse($source)
  4107. +    {
  4108. +        // Matches an optional namespace, optional element, and required id
  4109. +        // $source = 'test|input#ab6bd_field';
  4110. +        // $matches = array (size=5)
  4111. +        //     0 => string 'test:input#ab6bd_field' (length=22)
  4112. +        //     1 => string 'test:' (length=5)
  4113. +        //     2 => string 'test' (length=4)
  4114. +        //     3 => string 'input' (length=5)
  4115. +        //     4 => string 'ab6bd_field' (length=11)
  4116. +        if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?#([\w-]+)$/i', trim($source), $matches)) {
  4117. +            return array(
  4118. +                new SelectorNode(new HashNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])),
  4119. +            );
  4120. +        }
  4121. +
  4122. +        return array();
  4123. +    }
  4124. +}
  4125. 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
  4126. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php 1970-01-01 01:00:00.000000000 +0100
  4127. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php    2014-11-19 15:54:14.124100024 +0100
  4128. @@ -0,0 +1,82 @@
  4129. +<?php
  4130. +
  4131. +/*
  4132. + * This file is part of the Symfony package.
  4133. + *
  4134. + * (c) Fabien Potencier <fabien@symfony.com>
  4135. + *
  4136. + * For the full copyright and license information, please view the LICENSE
  4137. + * file that was distributed with this source code.
  4138. + */
  4139. +
  4140. +namespace Symfony\Component\CssSelector\Parser\Tokenizer;
  4141. +
  4142. +/**
  4143. + * CSS selector tokenizer escaping applier.
  4144. + *
  4145. + * This component is a port of the Python cssselector library,
  4146. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  4147. + *
  4148. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  4149. + */
  4150. +class TokenizerEscaping
  4151. +{
  4152. +    /**
  4153. +     * @var TokenizerPatterns
  4154. +     */
  4155. +    private $patterns;
  4156. +
  4157. +    /**
  4158. +     * @param TokenizerPatterns $patterns
  4159. +     */
  4160. +    public function __construct(TokenizerPatterns $patterns)
  4161. +    {
  4162. +        $this->patterns = $patterns;
  4163. +    }
  4164. +
  4165. +    /**
  4166. +     * @param string $value
  4167. +     *
  4168. +     * @return string
  4169. +     */
  4170. +    public function escapeUnicode($value)
  4171. +    {
  4172. +        $value = $this->replaceUnicodeSequences($value);
  4173. +
  4174. +        return preg_replace($this->patterns->getSimpleEscapePattern(), '$1', $value);
  4175. +    }
  4176. +
  4177. +    /**
  4178. +     * @param string $value
  4179. +     *
  4180. +     * @return string
  4181. +     */
  4182. +    public function escapeUnicodeAndNewLine($value)
  4183. +    {
  4184. +        $value = preg_replace($this->patterns->getNewLineEscapePattern(), '', $value);
  4185. +
  4186. +        return $this->escapeUnicode($value);
  4187. +    }
  4188. +
  4189. +    /**
  4190. +     * @param string $value
  4191. +     *
  4192. +     * @return string
  4193. +     */
  4194. +    private function replaceUnicodeSequences($value)
  4195. +    {
  4196. +        return preg_replace_callback($this->patterns->getUnicodeEscapePattern(), function ($match) {
  4197. +            $c = hexdec($match[1]);
  4198. +
  4199. +            if (0x80 > $c %= 0x200000) {
  4200. +                return chr($c);
  4201. +            }
  4202. +            if (0x800 > $c) {
  4203. +                return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F);
  4204. +            }
  4205. +            if (0x10000 > $c) {
  4206. +                return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);
  4207. +            }
  4208. +        }, $value);
  4209. +    }
  4210. +}
  4211. 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
  4212. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php 1970-01-01 01:00:00.000000000 +0100
  4213. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerPatterns.php    2014-11-19 15:54:14.288100025 +0100
  4214. @@ -0,0 +1,160 @@
  4215. +<?php
  4216. +
  4217. +/*
  4218. + * This file is part of the Symfony package.
  4219. + *
  4220. + * (c) Fabien Potencier <fabien@symfony.com>
  4221. + *
  4222. + * For the full copyright and license information, please view the LICENSE
  4223. + * file that was distributed with this source code.
  4224. + */
  4225. +
  4226. +namespace Symfony\Component\CssSelector\Parser\Tokenizer;
  4227. +
  4228. +/**
  4229. + * CSS selector tokenizer patterns builder.
  4230. + *
  4231. + * This component is a port of the Python cssselector library,
  4232. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  4233. + *
  4234. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  4235. + */
  4236. +class TokenizerPatterns
  4237. +{
  4238. +    /**
  4239. +     * @var string
  4240. +     */
  4241. +    private $unicodeEscapePattern;
  4242. +
  4243. +    /**
  4244. +     * @var string
  4245. +     */
  4246. +    private $simpleEscapePattern;
  4247. +
  4248. +    /**
  4249. +     * @var string
  4250. +     */
  4251. +    private $newLineEscapePattern;
  4252. +
  4253. +    /**
  4254. +     * @var string
  4255. +     */
  4256. +    private $escapePattern;
  4257. +
  4258. +    /**
  4259. +     * @var string
  4260. +     */
  4261. +    private $stringEscapePattern;
  4262. +
  4263. +    /**
  4264. +     * @var string
  4265. +     */
  4266. +    private $nonAsciiPattern;
  4267. +
  4268. +    /**
  4269. +     * @var string
  4270. +     */
  4271. +    private $nmCharPattern;
  4272. +
  4273. +    /**
  4274. +     * @var string
  4275. +     */
  4276. +    private $nmStartPattern;
  4277. +
  4278. +    /**
  4279. +     * @var string
  4280. +     */
  4281. +    private $identifierPattern;
  4282. +
  4283. +    /**
  4284. +     * @var string
  4285. +     */
  4286. +    private $hashPattern;
  4287. +
  4288. +    /**
  4289. +     * @var string
  4290. +     */
  4291. +    private $numberPattern;
  4292. +
  4293. +    /**
  4294. +     * @var string
  4295. +     */
  4296. +    private $quotedStringPattern;
  4297. +
  4298. +    /**
  4299. +     * Constructor.
  4300. +     */
  4301. +    public function __construct()
  4302. +    {
  4303. +        $this->unicodeEscapePattern = '\\\\([0-9a-f]{1,6})(?:\r\n|[ \n\r\t\f])?';
  4304. +        $this->simpleEscapePattern = '\\\\(.)';
  4305. +        $this->newLineEscapePattern = '\\\\(?:\n|\r\n|\r|\f)';
  4306. +        $this->escapePattern = $this->unicodeEscapePattern.'|\\\\[^\n\r\f0-9a-f]';
  4307. +        $this->stringEscapePattern = $this->newLineEscapePattern.'|'.$this->escapePattern;
  4308. +        $this->nonAsciiPattern = '[^\x00-\x7F]';
  4309. +        $this->nmCharPattern = '[_a-z0-9-]|'.$this->escapePattern.'|'.$this->nonAsciiPattern;
  4310. +        $this->nmStartPattern = '[_a-z]|'.$this->escapePattern.'|'.$this->nonAsciiPattern;
  4311. +        $this->identifierPattern = '(?:'.$this->nmStartPattern.')(?:'.$this->nmCharPattern.')*';
  4312. +        $this->hashPattern = '#((?:'.$this->nmCharPattern.')+)';
  4313. +        $this->numberPattern = '[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)';
  4314. +        $this->quotedStringPattern = '([^\n\r\f%s]|'.$this->stringEscapePattern.')*';
  4315. +    }
  4316. +
  4317. +    /**
  4318. +     * @return string
  4319. +     */
  4320. +    public function getNewLineEscapePattern()
  4321. +    {
  4322. +        return '~^'.$this->newLineEscapePattern.'~';
  4323. +    }
  4324. +
  4325. +    /**
  4326. +     * @return string
  4327. +     */
  4328. +    public function getSimpleEscapePattern()
  4329. +    {
  4330. +        return '~^'.$this->simpleEscapePattern.'~';
  4331. +    }
  4332. +
  4333. +    /**
  4334. +     * @return string
  4335. +     */
  4336. +    public function getUnicodeEscapePattern()
  4337. +    {
  4338. +        return '~^'.$this->unicodeEscapePattern.'~i';
  4339. +    }
  4340. +
  4341. +    /**
  4342. +     * @return string
  4343. +     */
  4344. +    public function getIdentifierPattern()
  4345. +    {
  4346. +        return '~^'.$this->identifierPattern.'~i';
  4347. +    }
  4348. +
  4349. +    /**
  4350. +     * @return string
  4351. +     */
  4352. +    public function getHashPattern()
  4353. +    {
  4354. +        return '~^'.$this->hashPattern.'~i';
  4355. +    }
  4356. +
  4357. +    /**
  4358. +     * @return string
  4359. +     */
  4360. +    public function getNumberPattern()
  4361. +    {
  4362. +        return '~^'.$this->numberPattern.'~';
  4363. +    }
  4364. +
  4365. +    /**
  4366. +     * @param string $quote
  4367. +     *
  4368. +     * @return string
  4369. +     */
  4370. +    public function getQuotedStringPattern($quote)
  4371. +    {
  4372. +        return '~^'.sprintf($this->quotedStringPattern, $quote).'~i';
  4373. +    }
  4374. +}
  4375. 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
  4376. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php 1970-01-01 01:00:00.000000000 +0100
  4377. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Tokenizer/Tokenizer.php    2014-11-19 15:54:13.968100023 +0100
  4378. @@ -0,0 +1,78 @@
  4379. +<?php
  4380. +
  4381. +/*
  4382. + * This file is part of the Symfony package.
  4383. + *
  4384. + * (c) Fabien Potencier <fabien@symfony.com>
  4385. + *
  4386. + * For the full copyright and license information, please view the LICENSE
  4387. + * file that was distributed with this source code.
  4388. + */
  4389. +
  4390. +namespace Symfony\Component\CssSelector\Parser\Tokenizer;
  4391. +
  4392. +use Symfony\Component\CssSelector\Parser\Handler;
  4393. +use Symfony\Component\CssSelector\Parser\Reader;
  4394. +use Symfony\Component\CssSelector\Parser\Token;
  4395. +use Symfony\Component\CssSelector\Parser\TokenStream;
  4396. +
  4397. +/**
  4398. + * CSS selector tokenizer.
  4399. + *
  4400. + * This component is a port of the Python cssselector library,
  4401. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  4402. + *
  4403. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  4404. + */
  4405. +class Tokenizer
  4406. +{
  4407. +    /**
  4408. +     * @var Handler\HandlerInterface[]
  4409. +     */
  4410. +    private $handlers;
  4411. +
  4412. +    /**
  4413. +     * Constructor.
  4414. +     */
  4415. +    public function __construct()
  4416. +    {
  4417. +        $patterns = new TokenizerPatterns();
  4418. +        $escaping = new TokenizerEscaping($patterns);
  4419. +
  4420. +        $this->handlers = array(
  4421. +            new Handler\WhitespaceHandler(),
  4422. +            new Handler\IdentifierHandler($patterns, $escaping),
  4423. +            new Handler\HashHandler($patterns, $escaping),
  4424. +            new Handler\StringHandler($patterns, $escaping),
  4425. +            new Handler\NumberHandler($patterns),
  4426. +            new Handler\CommentHandler(),
  4427. +        );
  4428. +    }
  4429. +
  4430. +    /**
  4431. +     * Tokenize selector source code.
  4432. +     *
  4433. +     * @param Reader $reader
  4434. +     *
  4435. +     * @return TokenStream
  4436. +     */
  4437. +    public function tokenize(Reader $reader)
  4438. +    {
  4439. +        $stream = new TokenStream();
  4440. +
  4441. +        while (!$reader->isEOF()) {
  4442. +            foreach ($this->handlers as $handler) {
  4443. +                if ($handler->handle($reader, $stream)) {
  4444. +                    continue 2;
  4445. +                }
  4446. +            }
  4447. +
  4448. +            $stream->push(new Token(Token::TYPE_DELIMITER, $reader->getSubstring(1), $reader->getPosition()));
  4449. +            $reader->moveForward(1);
  4450. +        }
  4451. +
  4452. +        return $stream
  4453. +            ->push(new Token(Token::TYPE_FILE_END, null, $reader->getPosition()))
  4454. +            ->freeze();
  4455. +    }
  4456. +}
  4457. 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
  4458. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Token.php   1970-01-01 01:00:00.000000000 +0100
  4459. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/Token.php  2014-11-19 15:54:11.568100008 +0100
  4460. @@ -0,0 +1,160 @@
  4461. +<?php
  4462. +
  4463. +/*
  4464. + * This file is part of the Symfony package.
  4465. + *
  4466. + * (c) Fabien Potencier <fabien@symfony.com>
  4467. + *
  4468. + * For the full copyright and license information, please view the LICENSE
  4469. + * file that was distributed with this source code.
  4470. + */
  4471. +
  4472. +namespace Symfony\Component\CssSelector\Parser;
  4473. +
  4474. +/**
  4475. + * CSS selector token.
  4476. + *
  4477. + * This component is a port of the Python cssselector library,
  4478. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  4479. + *
  4480. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  4481. + */
  4482. +class Token
  4483. +{
  4484. +    const TYPE_FILE_END   = 'eof';
  4485. +    const TYPE_DELIMITER  = 'delimiter';
  4486. +    const TYPE_WHITESPACE = 'whitespace';
  4487. +    const TYPE_IDENTIFIER = 'identifier';
  4488. +    const TYPE_HASH       = 'hash';
  4489. +    const TYPE_NUMBER     = 'number';
  4490. +    const TYPE_STRING     = 'string';
  4491. +
  4492. +    /**
  4493. +     * @var int
  4494. +     */
  4495. +    private $type;
  4496. +
  4497. +    /**
  4498. +     * @var string
  4499. +     */
  4500. +    private $value;
  4501. +
  4502. +    /**
  4503. +     * @var int
  4504. +     */
  4505. +    private $position;
  4506. +
  4507. +    /**
  4508. +     * @param int    $type
  4509. +     * @param string $value
  4510. +     * @param int    $position
  4511. +     */
  4512. +    public function __construct($type, $value, $position)
  4513. +    {
  4514. +        $this->type = $type;
  4515. +        $this->value = $value;
  4516. +        $this->position = $position;
  4517. +    }
  4518. +
  4519. +    /**
  4520. +     * @return int
  4521. +     */
  4522. +    public function getType()
  4523. +    {
  4524. +        return $this->type;
  4525. +    }
  4526. +
  4527. +    /**
  4528. +     * @return string
  4529. +     */
  4530. +    public function getValue()
  4531. +    {
  4532. +        return $this->value;
  4533. +    }
  4534. +
  4535. +    /**
  4536. +     * @return int
  4537. +     */
  4538. +    public function getPosition()
  4539. +    {
  4540. +        return $this->position;
  4541. +    }
  4542. +
  4543. +    /**
  4544. +     * @return bool
  4545. +     */
  4546. +    public function isFileEnd()
  4547. +    {
  4548. +        return self::TYPE_FILE_END === $this->type;
  4549. +    }
  4550. +
  4551. +    /**
  4552. +     * @param array $values
  4553. +     *
  4554. +     * @return bool
  4555. +     */
  4556. +    public function isDelimiter(array $values = array())
  4557. +    {
  4558. +        if (self::TYPE_DELIMITER !== $this->type) {
  4559. +            return false;
  4560. +        }
  4561. +
  4562. +        if (empty($values)) {
  4563. +            return true;
  4564. +        }
  4565. +
  4566. +        return in_array($this->value, $values);
  4567. +    }
  4568. +
  4569. +    /**
  4570. +     * @return bool
  4571. +     */
  4572. +    public function isWhitespace()
  4573. +    {
  4574. +        return self::TYPE_WHITESPACE === $this->type;
  4575. +    }
  4576. +
  4577. +    /**
  4578. +     * @return bool
  4579. +     */
  4580. +    public function isIdentifier()
  4581. +    {
  4582. +        return self::TYPE_IDENTIFIER === $this->type;
  4583. +    }
  4584. +
  4585. +    /**
  4586. +     * @return bool
  4587. +     */
  4588. +    public function isHash()
  4589. +    {
  4590. +        return self::TYPE_HASH === $this->type;
  4591. +    }
  4592. +
  4593. +    /**
  4594. +     * @return bool
  4595. +     */
  4596. +    public function isNumber()
  4597. +    {
  4598. +        return self::TYPE_NUMBER === $this->type;
  4599. +    }
  4600. +
  4601. +    /**
  4602. +     * @return bool
  4603. +     */
  4604. +    public function isString()
  4605. +    {
  4606. +        return self::TYPE_STRING === $this->type;
  4607. +    }
  4608. +
  4609. +    /**
  4610. +     * @return string
  4611. +     */
  4612. +    public function __toString()
  4613. +    {
  4614. +        if ($this->value) {
  4615. +            return sprintf('<%s "%s" at %s>', $this->type, $this->value, $this->position);
  4616. +        }
  4617. +
  4618. +        return sprintf('<%s at %s>', $this->type, $this->position);
  4619. +    }
  4620. +}
  4621. 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
  4622. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/TokenStream.php 1970-01-01 01:00:00.000000000 +0100
  4623. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Parser/TokenStream.php    2014-11-19 15:54:13.164100018 +0100
  4624. @@ -0,0 +1,182 @@
  4625. +<?php
  4626. +
  4627. +/*
  4628. + * This file is part of the Symfony package.
  4629. + *
  4630. + * (c) Fabien Potencier <fabien@symfony.com>
  4631. + *
  4632. + * For the full copyright and license information, please view the LICENSE
  4633. + * file that was distributed with this source code.
  4634. + */
  4635. +
  4636. +namespace Symfony\Component\CssSelector\Parser;
  4637. +
  4638. +use Symfony\Component\CssSelector\Exception\InternalErrorException;
  4639. +use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
  4640. +
  4641. +/**
  4642. + * CSS selector token stream.
  4643. + *
  4644. + * This component is a port of the Python cssselector library,
  4645. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  4646. + *
  4647. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  4648. + */
  4649. +class TokenStream
  4650. +{
  4651. +    /**
  4652. +     * @var Token[]
  4653. +     */
  4654. +    private $tokens = array();
  4655. +
  4656. +    /**
  4657. +     * @var bool
  4658. +     */
  4659. +    private $frozen = false;
  4660. +
  4661. +    /**
  4662. +     * @var Token[]
  4663. +     */
  4664. +    private $used = array();
  4665. +
  4666. +    /**
  4667. +     * @var int
  4668. +     */
  4669. +    private $cursor = 0;
  4670. +
  4671. +    /**
  4672. +     * @var Token|null
  4673. +     */
  4674. +    private $peeked = null;
  4675. +
  4676. +    /**
  4677. +     * @var bool
  4678. +     */
  4679. +    private $peeking = false;
  4680. +
  4681. +    /**
  4682. +     * Pushes a token.
  4683. +     *
  4684. +     * @param Token $token
  4685. +     *
  4686. +     * @return TokenStream
  4687. +     */
  4688. +    public function push(Token $token)
  4689. +    {
  4690. +        $this->tokens[] = $token;
  4691. +
  4692. +        return $this;
  4693. +    }
  4694. +
  4695. +    /**
  4696. +     * Freezes stream.
  4697. +     *
  4698. +     * @return TokenStream
  4699. +     */
  4700. +    public function freeze()
  4701. +    {
  4702. +        $this->frozen = true;
  4703. +
  4704. +        return $this;
  4705. +    }
  4706. +
  4707. +    /**
  4708. +     * Returns next token.
  4709. +     *
  4710. +     * @throws InternalErrorException If there is no more token
  4711. +     *
  4712. +     * @return Token
  4713. +     */
  4714. +    public function getNext()
  4715. +    {
  4716. +        if ($this->peeking) {
  4717. +            $this->peeking = false;
  4718. +            $this->used[] = $this->peeked;
  4719. +
  4720. +            return $this->peeked;
  4721. +        }
  4722. +
  4723. +        if (!isset($this->tokens[$this->cursor])) {
  4724. +            throw new InternalErrorException('Unexpected token stream end.');
  4725. +        }
  4726. +
  4727. +        return $this->tokens[$this->cursor ++];
  4728. +    }
  4729. +
  4730. +    /**
  4731. +     * Returns peeked token.
  4732. +     *
  4733. +     * @return Token
  4734. +     */
  4735. +    public function getPeek()
  4736. +    {
  4737. +        if (!$this->peeking) {
  4738. +            $this->peeked = $this->getNext();
  4739. +            $this->peeking = true;
  4740. +        }
  4741. +
  4742. +        return $this->peeked;
  4743. +    }
  4744. +
  4745. +    /**
  4746. +     * Returns used tokens.
  4747. +     *
  4748. +     * @return Token[]
  4749. +     */
  4750. +    public function getUsed()
  4751. +    {
  4752. +        return $this->used;
  4753. +    }
  4754. +
  4755. +    /**
  4756. +     * Returns nex identifier token.
  4757. +     *
  4758. +     * @throws SyntaxErrorException If next token is not an identifier
  4759. +     *
  4760. +     * @return string The identifier token value
  4761. +     */
  4762. +    public function getNextIdentifier()
  4763. +    {
  4764. +        $next = $this->getNext();
  4765. +
  4766. +        if (!$next->isIdentifier()) {
  4767. +            throw SyntaxErrorException::unexpectedToken('identifier', $next);
  4768. +        }
  4769. +
  4770. +        return $next->getValue();
  4771. +    }
  4772. +
  4773. +    /**
  4774. +     * Returns nex identifier or star delimiter token.
  4775. +     *
  4776. +     * @throws SyntaxErrorException If next token is not an identifier or a star delimiter
  4777. +     *
  4778. +     * @return null|string The identifier token value or null if star found
  4779. +     */
  4780. +    public function getNextIdentifierOrStar()
  4781. +    {
  4782. +        $next = $this->getNext();
  4783. +
  4784. +        if ($next->isIdentifier()) {
  4785. +            return $next->getValue();
  4786. +        }
  4787. +
  4788. +        if ($next->isDelimiter(array('*'))) {
  4789. +            return;
  4790. +        }
  4791. +
  4792. +        throw SyntaxErrorException::unexpectedToken('identifier or "*"', $next);
  4793. +    }
  4794. +
  4795. +    /**
  4796. +     * Skips next whitespace if any.
  4797. +     */
  4798. +    public function skipWhitespace()
  4799. +    {
  4800. +        $peek = $this->getPeek();
  4801. +
  4802. +        if ($peek->isWhitespace()) {
  4803. +            $this->getNext();
  4804. +        }
  4805. +    }
  4806. +}
  4807. 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
  4808. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/phpunit.xml.dist   1970-01-01 01:00:00.000000000 +0100
  4809. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/phpunit.xml.dist  2014-11-19 15:54:15.572100032 +0100
  4810. @@ -0,0 +1,25 @@
  4811. +<?xml version="1.0" encoding="UTF-8"?>
  4812. +
  4813. +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4814. +         xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
  4815. +         backupGlobals="false"
  4816. +         colors="true"
  4817. +         bootstrap="vendor/autoload.php"
  4818. +>
  4819. +    <testsuites>
  4820. +        <testsuite name="Symfony CssSelector Component Test Suite">
  4821. +            <directory>./Tests/</directory>
  4822. +        </testsuite>
  4823. +    </testsuites>
  4824. +
  4825. +    <filter>
  4826. +        <whitelist>
  4827. +            <directory>./</directory>
  4828. +            <exclude>
  4829. +                <directory>./Resources</directory>
  4830. +                <directory>./Tests</directory>
  4831. +                <directory>./vendor</directory>
  4832. +            </exclude>
  4833. +        </whitelist>
  4834. +    </filter>
  4835. +</phpunit>
  4836. 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
  4837. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/README.md  1970-01-01 01:00:00.000000000 +0100
  4838. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/README.md 2014-11-19 15:54:15.732100033 +0100
  4839. @@ -0,0 +1,48 @@
  4840. +CssSelector Component
  4841. +=====================
  4842. +
  4843. +CssSelector converts CSS selectors to XPath expressions.
  4844. +
  4845. +The component only goal is to convert CSS selectors to their XPath
  4846. +equivalents:
  4847. +
  4848. +```php
  4849. +use Symfony\Component\CssSelector\CssSelector;
  4850. +
  4851. +print CssSelector::toXPath('div.item > h4 > a');
  4852. +```
  4853. +
  4854. +HTML and XML are different
  4855. +--------------------------
  4856. +
  4857. +The `CssSelector` component comes with an `HTML` extension which is enabled by
  4858. +default. If you need to use this component with `XML` documents, you have to
  4859. +disable this `HTML` extension. That's because, `HTML` tag & attribute names
  4860. +are always lower-cased, but case-sensitive in `XML`:
  4861. +
  4862. +```php
  4863. +// disable `HTML` extension:
  4864. +CssSelector::disableHtmlExtension();
  4865. +
  4866. +// re-enable `HTML` extension:
  4867. +CssSelector::enableHtmlExtension();
  4868. +```
  4869. +
  4870. +When the `HTML` extension is enabled, tag names are lower-cased, attribute
  4871. +names are lower-cased, the following extra pseudo-classes are supported:
  4872. +`checked`, `link`, `disabled`, `enabled`, `selected`, `invalid`, `hover`,
  4873. +`visited`, and the `lang()` function is also added.
  4874. +
  4875. +Resources
  4876. +---------
  4877. +
  4878. +This component is a port of the Python lxml library, which is copyright Infrae
  4879. +and distributed under the BSD license.
  4880. +
  4881. +Current code is a port of https://github.com/SimonSapin/cssselect/releases/tag/v0.7.1
  4882. +
  4883. +You can run the unit tests with the following command:
  4884. +
  4885. +    $ cd path/to/Symfony/Component/CssSelector/
  4886. +    $ composer.phar install
  4887. +    $ phpunit
  4888. 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
  4889. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/CssSelectorTest.php  1970-01-01 01:00:00.000000000 +0100
  4890. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/CssSelectorTest.php 2014-11-19 15:54:07.256099982 +0100
  4891. @@ -0,0 +1,64 @@
  4892. +<?php
  4893. +
  4894. +/*
  4895. + * This file is part of the Symfony package.
  4896. + *
  4897. + * (c) Fabien Potencier <fabien@symfony.com>
  4898. + *
  4899. + * For the full copyright and license information, please view the LICENSE
  4900. + * file that was distributed with this source code.
  4901. + */
  4902. +
  4903. +namespace Symfony\Component\CssSelector\Tests;
  4904. +
  4905. +use Symfony\Component\CssSelector\CssSelector;
  4906. +
  4907. +class CssSelectorTest extends \PHPUnit_Framework_TestCase
  4908. +{
  4909. +    public function testCssToXPath()
  4910. +    {
  4911. +        $this->assertEquals('descendant-or-self::*', CssSelector::toXPath(''));
  4912. +        $this->assertEquals('descendant-or-self::h1', CssSelector::toXPath('h1'));
  4913. +        $this->assertEquals("descendant-or-self::h1[@id = 'foo']", CssSelector::toXPath('h1#foo'));
  4914. +        $this->assertEquals("descendant-or-self::h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", CssSelector::toXPath('h1.foo'));
  4915. +        $this->assertEquals('descendant-or-self::foo:h1', CssSelector::toXPath('foo|h1'));
  4916. +    }
  4917. +
  4918. +    /** @dataProvider getCssToXPathWithoutPrefixTestData */
  4919. +    public function testCssToXPathWithoutPrefix($css, $xpath)
  4920. +    {
  4921. +        $this->assertEquals($xpath, CssSelector::toXPath($css, ''), '->parse() parses an input string and returns a node');
  4922. +    }
  4923. +
  4924. +    public function testParseExceptions()
  4925. +    {
  4926. +        try {
  4927. +            CssSelector::toXPath('h1:');
  4928. +            $this->fail('->parse() throws an Exception if the css selector is not valid');
  4929. +        } catch (\Exception $e) {
  4930. +            $this->assertInstanceOf('\Symfony\Component\CssSelector\Exception\ParseException', $e, '->parse() throws an Exception if the css selector is not valid');
  4931. +            $this->assertEquals("Expected identifier, but <eof at 3> found.", $e->getMessage(), '->parse() throws an Exception if the css selector is not valid');
  4932. +        }
  4933. +    }
  4934. +
  4935. +    public function getCssToXPathWithoutPrefixTestData()
  4936. +    {
  4937. +        return array(
  4938. +            array('h1', "h1"),
  4939. +            array('foo|h1', "foo:h1"),
  4940. +            array('h1, h2, h3', "h1 | h2 | h3"),
  4941. +            array('h1:nth-child(3n+1)', "*/*[name() = 'h1' and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"),
  4942. +            array('h1 > p', "h1/p"),
  4943. +            array('h1#foo', "h1[@id = 'foo']"),
  4944. +            array('h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
  4945. +            array('h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"),
  4946. +            array('h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"),
  4947. +            array('h1[class]', "h1[@class]"),
  4948. +            array('h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
  4949. +            array('h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"),
  4950. +            array('h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"),
  4951. +            array('div>.foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
  4952. +            array('div > .foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
  4953. +        );
  4954. +    }
  4955. +}
  4956. 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
  4957. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php    1970-01-01 01:00:00.000000000 +0100
  4958. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AbstractNodeTest.php   2014-11-19 15:54:05.656099972 +0100
  4959. @@ -0,0 +1,32 @@
  4960. +<?php
  4961. +
  4962. +/*
  4963. + * This file is part of the Symfony package.
  4964. + *
  4965. + * (c) Fabien Potencier <fabien@symfony.com>
  4966. + *
  4967. + * For the full copyright and license information, please view the LICENSE
  4968. + * file that was distributed with this source code.
  4969. + */
  4970. +
  4971. +namespace Symfony\Component\CssSelector\Tests\Node;
  4972. +
  4973. +use Symfony\Component\CssSelector\Node\NodeInterface;
  4974. +
  4975. +abstract class AbstractNodeTest extends \PHPUnit_Framework_TestCase
  4976. +{
  4977. +    /** @dataProvider getToStringConversionTestData */
  4978. +    public function testToStringConversion(NodeInterface $node, $representation)
  4979. +    {
  4980. +        $this->assertEquals($representation, (string) $node);
  4981. +    }
  4982. +
  4983. +    /** @dataProvider getSpecificityValueTestData */
  4984. +    public function testSpecificityValue(NodeInterface $node, $value)
  4985. +    {
  4986. +        $this->assertEquals($value, $node->getSpecificity()->getValue());
  4987. +    }
  4988. +
  4989. +    abstract public function getToStringConversionTestData();
  4990. +    abstract public function getSpecificityValueTestData();
  4991. +}
  4992. 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
  4993. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php   1970-01-01 01:00:00.000000000 +0100
  4994. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/AttributeNodeTest.php  2014-11-19 15:54:06.132099975 +0100
  4995. @@ -0,0 +1,37 @@
  4996. +<?php
  4997. +
  4998. +/*
  4999. + * This file is part of the Symfony package.
  5000. + *
  5001. + * (c) Fabien Potencier <fabien@symfony.com>
  5002. + *
  5003. + * For the full copyright and license information, please view the LICENSE
  5004. + * file that was distributed with this source code.
  5005. + */
  5006. +
  5007. +namespace Symfony\Component\CssSelector\Tests\Node;
  5008. +
  5009. +use Symfony\Component\CssSelector\Node\AttributeNode;
  5010. +use Symfony\Component\CssSelector\Node\ElementNode;
  5011. +
  5012. +class AttributeNodeTest extends AbstractNodeTest
  5013. +{
  5014. +    public function getToStringConversionTestData()
  5015. +    {
  5016. +        return array(
  5017. +            array(new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 'Attribute[Element[*][attribute]]'),
  5018. +            array(new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), "Attribute[Element[*][attribute $= 'value']]"),
  5019. +            array(new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), "Attribute[Element[*][namespace|attribute $= 'value']]"),
  5020. +        );
  5021. +    }
  5022. +
  5023. +    public function getSpecificityValueTestData()
  5024. +    {
  5025. +        return array(
  5026. +            array(new AttributeNode(new ElementNode(), null, 'attribute', 'exists', null), 10),
  5027. +            array(new AttributeNode(new ElementNode(null, 'element'), null, 'attribute', 'exists', null), 11),
  5028. +            array(new AttributeNode(new ElementNode(), null, 'attribute', '$=', 'value'), 10),
  5029. +            array(new AttributeNode(new ElementNode(), 'namespace', 'attribute', '$=', 'value'), 10),
  5030. +        );
  5031. +    }
  5032. +}
  5033. 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
  5034. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php   1970-01-01 01:00:00.000000000 +0100
  5035. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ClassNodeTest.php  2014-11-19 15:54:05.812099973 +0100
  5036. @@ -0,0 +1,33 @@
  5037. +<?php
  5038. +
  5039. +/*
  5040. + * This file is part of the Symfony package.
  5041. + *
  5042. + * (c) Fabien Potencier <fabien@symfony.com>
  5043. + *
  5044. + * For the full copyright and license information, please view the LICENSE
  5045. + * file that was distributed with this source code.
  5046. + */
  5047. +
  5048. +namespace Symfony\Component\CssSelector\Tests\Node;
  5049. +
  5050. +use Symfony\Component\CssSelector\Node\ClassNode;
  5051. +use Symfony\Component\CssSelector\Node\ElementNode;
  5052. +
  5053. +class ClassNodeTest extends AbstractNodeTest
  5054. +{
  5055. +    public function getToStringConversionTestData()
  5056. +    {
  5057. +        return array(
  5058. +            array(new ClassNode(new ElementNode(), 'class'), 'Class[Element[*].class]'),
  5059. +        );
  5060. +    }
  5061. +
  5062. +    public function getSpecificityValueTestData()
  5063. +    {
  5064. +        return array(
  5065. +            array(new ClassNode(new ElementNode(), 'class'), 10),
  5066. +            array(new ClassNode(new ElementNode(null, 'element'), 'class'), 11),
  5067. +        );
  5068. +    }
  5069. +}
  5070. 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
  5071. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php    1970-01-01 01:00:00.000000000 +0100
  5072. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/CombinedSelectorNodeTest.php   2014-11-19 15:54:06.780099979 +0100
  5073. @@ -0,0 +1,35 @@
  5074. +<?php
  5075. +
  5076. +/*
  5077. + * This file is part of the Symfony package.
  5078. + *
  5079. + * (c) Fabien Potencier <fabien@symfony.com>
  5080. + *
  5081. + * For the full copyright and license information, please view the LICENSE
  5082. + * file that was distributed with this source code.
  5083. + */
  5084. +
  5085. +namespace Symfony\Component\CssSelector\Tests\Node;
  5086. +
  5087. +use Symfony\Component\CssSelector\Node\CombinedSelectorNode;
  5088. +use Symfony\Component\CssSelector\Node\ElementNode;
  5089. +
  5090. +class CombinedSelectorNodeTest extends AbstractNodeTest
  5091. +{
  5092. +    public function getToStringConversionTestData()
  5093. +    {
  5094. +        return array(
  5095. +            array(new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 'CombinedSelector[Element[*] > Element[*]]'),
  5096. +            array(new CombinedSelectorNode(new ElementNode(), ' ', new ElementNode()), 'CombinedSelector[Element[*] <followed> Element[*]]'),
  5097. +        );
  5098. +    }
  5099. +
  5100. +    public function getSpecificityValueTestData()
  5101. +    {
  5102. +        return array(
  5103. +            array(new CombinedSelectorNode(new ElementNode(), '>', new ElementNode()), 0),
  5104. +            array(new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode()), 1),
  5105. +            array(new CombinedSelectorNode(new ElementNode(null, 'element'), '>', new ElementNode(null, 'element')), 2),
  5106. +        );
  5107. +    }
  5108. +}
  5109. 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
  5110. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php 1970-01-01 01:00:00.000000000 +0100
  5111. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/ElementNodeTest.php    2014-11-19 15:54:07.096099981 +0100
  5112. @@ -0,0 +1,35 @@
  5113. +<?php
  5114. +
  5115. +/*
  5116. + * This file is part of the Symfony package.
  5117. + *
  5118. + * (c) Fabien Potencier <fabien@symfony.com>
  5119. + *
  5120. + * For the full copyright and license information, please view the LICENSE
  5121. + * file that was distributed with this source code.
  5122. + */
  5123. +
  5124. +namespace Symfony\Component\CssSelector\Tests\Node;
  5125. +
  5126. +use Symfony\Component\CssSelector\Node\ElementNode;
  5127. +
  5128. +class ElementNodeTest extends AbstractNodeTest
  5129. +{
  5130. +    public function getToStringConversionTestData()
  5131. +    {
  5132. +        return array(
  5133. +            array(new ElementNode(), 'Element[*]'),
  5134. +            array(new ElementNode(null, 'element'), 'Element[element]'),
  5135. +            array(new ElementNode('namespace', 'element'), 'Element[namespace|element]'),
  5136. +        );
  5137. +    }
  5138. +
  5139. +    public function getSpecificityValueTestData()
  5140. +    {
  5141. +        return array(
  5142. +            array(new ElementNode(), 0),
  5143. +            array(new ElementNode(null, 'element'), 1),
  5144. +            array(new ElementNode('namespace', 'element'),1),
  5145. +        );
  5146. +    }
  5147. +}
  5148. 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
  5149. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php    1970-01-01 01:00:00.000000000 +0100
  5150. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/FunctionNodeTest.php   2014-11-19 15:54:06.620099978 +0100
  5151. @@ -0,0 +1,47 @@
  5152. +<?php
  5153. +
  5154. +/*
  5155. + * This file is part of the Symfony package.
  5156. + *
  5157. + * (c) Fabien Potencier <fabien@symfony.com>
  5158. + *
  5159. + * For the full copyright and license information, please view the LICENSE
  5160. + * file that was distributed with this source code.
  5161. + */
  5162. +
  5163. +namespace Symfony\Component\CssSelector\Tests\Node;
  5164. +
  5165. +use Symfony\Component\CssSelector\Node\ElementNode;
  5166. +use Symfony\Component\CssSelector\Node\FunctionNode;
  5167. +use Symfony\Component\CssSelector\Parser\Token;
  5168. +
  5169. +class FunctionNodeTest extends AbstractNodeTest
  5170. +{
  5171. +    public function getToStringConversionTestData()
  5172. +    {
  5173. +        return array(
  5174. +            array(new FunctionNode(new ElementNode(), 'function'), 'Function[Element[*]:function()]'),
  5175. +            array(new FunctionNode(new ElementNode(), 'function', array(
  5176. +                new Token(Token::TYPE_IDENTIFIER, 'value', 0),
  5177. +            )), "Function[Element[*]:function(['value'])]"),
  5178. +            array(new FunctionNode(new ElementNode(), 'function', array(
  5179. +                new Token(Token::TYPE_STRING, 'value1', 0),
  5180. +                new Token(Token::TYPE_NUMBER, 'value2', 0),
  5181. +            )), "Function[Element[*]:function(['value1', 'value2'])]"),
  5182. +        );
  5183. +    }
  5184. +
  5185. +    public function getSpecificityValueTestData()
  5186. +    {
  5187. +        return array(
  5188. +            array(new FunctionNode(new ElementNode(), 'function'), 10),
  5189. +            array(new FunctionNode(new ElementNode(), 'function', array(
  5190. +                new Token(Token::TYPE_IDENTIFIER, 'value', 0),
  5191. +            )), 10),
  5192. +            array(new FunctionNode(new ElementNode(), 'function', array(
  5193. +                new Token(Token::TYPE_STRING, 'value1', 0),
  5194. +                new Token(Token::TYPE_NUMBER, 'value2', 0),
  5195. +            )), 10),
  5196. +        );
  5197. +    }
  5198. +}
  5199. 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
  5200. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php    1970-01-01 01:00:00.000000000 +0100
  5201. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/HashNodeTest.php   2014-11-19 15:54:05.972099974 +0100
  5202. @@ -0,0 +1,33 @@
  5203. +<?php
  5204. +
  5205. +/*
  5206. + * This file is part of the Symfony package.
  5207. + *
  5208. + * (c) Fabien Potencier <fabien@symfony.com>
  5209. + *
  5210. + * For the full copyright and license information, please view the LICENSE
  5211. + * file that was distributed with this source code.
  5212. + */
  5213. +
  5214. +namespace Symfony\Component\CssSelector\Tests\Node;
  5215. +
  5216. +use Symfony\Component\CssSelector\Node\HashNode;
  5217. +use Symfony\Component\CssSelector\Node\ElementNode;
  5218. +
  5219. +class HashNodeTest extends AbstractNodeTest
  5220. +{
  5221. +    public function getToStringConversionTestData()
  5222. +    {
  5223. +        return array(
  5224. +            array(new HashNode(new ElementNode(), 'id'), 'Hash[Element[*]#id]'),
  5225. +        );
  5226. +    }
  5227. +
  5228. +    public function getSpecificityValueTestData()
  5229. +    {
  5230. +        return array(
  5231. +            array(new HashNode(new ElementNode(), 'id'), 100),
  5232. +            array(new HashNode(new ElementNode(null, 'id'), 'class'), 101),
  5233. +        );
  5234. +    }
  5235. +}
  5236. 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
  5237. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php    1970-01-01 01:00:00.000000000 +0100
  5238. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/NegationNodeTest.php   2014-11-19 15:54:05.496099971 +0100
  5239. @@ -0,0 +1,33 @@
  5240. +<?php
  5241. +
  5242. +/*
  5243. + * This file is part of the Symfony package.
  5244. + *
  5245. + * (c) Fabien Potencier <fabien@symfony.com>
  5246. + *
  5247. + * For the full copyright and license information, please view the LICENSE
  5248. + * file that was distributed with this source code.
  5249. + */
  5250. +
  5251. +namespace Symfony\Component\CssSelector\Tests\Node;
  5252. +
  5253. +use Symfony\Component\CssSelector\Node\ClassNode;
  5254. +use Symfony\Component\CssSelector\Node\NegationNode;
  5255. +use Symfony\Component\CssSelector\Node\ElementNode;
  5256. +
  5257. +class NegationNodeTest extends AbstractNodeTest
  5258. +{
  5259. +    public function getToStringConversionTestData()
  5260. +    {
  5261. +        return array(
  5262. +            array(new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 'Negation[Element[*]:not(Class[Element[*].class])]'),
  5263. +        );
  5264. +    }
  5265. +
  5266. +    public function getSpecificityValueTestData()
  5267. +    {
  5268. +        return array(
  5269. +            array(new NegationNode(new ElementNode(), new ClassNode(new ElementNode(), 'class')), 10),
  5270. +        );
  5271. +    }
  5272. +}
  5273. 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
  5274. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php  1970-01-01 01:00:00.000000000 +0100
  5275. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/PseudoNodeTest.php 2014-11-19 15:54:06.464099977 +0100
  5276. @@ -0,0 +1,32 @@
  5277. +<?php
  5278. +
  5279. +/*
  5280. + * This file is part of the Symfony package.
  5281. + *
  5282. + * (c) Fabien Potencier <fabien@symfony.com>
  5283. + *
  5284. + * For the full copyright and license information, please view the LICENSE
  5285. + * file that was distributed with this source code.
  5286. + */
  5287. +
  5288. +namespace Symfony\Component\CssSelector\Tests\Node;
  5289. +
  5290. +use Symfony\Component\CssSelector\Node\ElementNode;
  5291. +use Symfony\Component\CssSelector\Node\PseudoNode;
  5292. +
  5293. +class PseudoNodeTest extends AbstractNodeTest
  5294. +{
  5295. +    public function getToStringConversionTestData()
  5296. +    {
  5297. +        return array(
  5298. +            array(new PseudoNode(new ElementNode(), 'pseudo'), 'Pseudo[Element[*]:pseudo]'),
  5299. +        );
  5300. +    }
  5301. +
  5302. +    public function getSpecificityValueTestData()
  5303. +    {
  5304. +        return array(
  5305. +            array(new PseudoNode(new ElementNode(), 'pseudo'), 10),
  5306. +        );
  5307. +    }
  5308. +}
  5309. 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
  5310. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php    1970-01-01 01:00:00.000000000 +0100
  5311. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SelectorNodeTest.php   2014-11-19 15:54:06.940099980 +0100
  5312. @@ -0,0 +1,34 @@
  5313. +<?php
  5314. +
  5315. +/*
  5316. + * This file is part of the Symfony package.
  5317. + *
  5318. + * (c) Fabien Potencier <fabien@symfony.com>
  5319. + *
  5320. + * For the full copyright and license information, please view the LICENSE
  5321. + * file that was distributed with this source code.
  5322. + */
  5323. +
  5324. +namespace Symfony\Component\CssSelector\Tests\Node;
  5325. +
  5326. +use Symfony\Component\CssSelector\Node\ElementNode;
  5327. +use Symfony\Component\CssSelector\Node\SelectorNode;
  5328. +
  5329. +class SelectorNodeTest extends AbstractNodeTest
  5330. +{
  5331. +    public function getToStringConversionTestData()
  5332. +    {
  5333. +        return array(
  5334. +            array(new SelectorNode(new ElementNode()), 'Selector[Element[*]]'),
  5335. +            array(new SelectorNode(new ElementNode(), 'pseudo'), 'Selector[Element[*]::pseudo]'),
  5336. +        );
  5337. +    }
  5338. +
  5339. +    public function getSpecificityValueTestData()
  5340. +    {
  5341. +        return array(
  5342. +            array(new SelectorNode(new ElementNode()), 0),
  5343. +            array(new SelectorNode(new ElementNode(), 'pseudo'), 1),
  5344. +        );
  5345. +    }
  5346. +}
  5347. 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
  5348. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php 1970-01-01 01:00:00.000000000 +0100
  5349. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Node/SpecificityTest.php    2014-11-19 15:54:06.292099976 +0100
  5350. @@ -0,0 +1,40 @@
  5351. +<?php
  5352. +
  5353. +/*
  5354. + * This file is part of the Symfony package.
  5355. + *
  5356. + * (c) Fabien Potencier <fabien@symfony.com>
  5357. + *
  5358. + * For the full copyright and license information, please view the LICENSE
  5359. + * file that was distributed with this source code.
  5360. + */
  5361. +
  5362. +namespace Symfony\Component\CssSelector\Tests\Node;
  5363. +
  5364. +use Symfony\Component\CssSelector\Node\Specificity;
  5365. +
  5366. +class SpecificityTest extends \PHPUnit_Framework_TestCase
  5367. +{
  5368. +    /** @dataProvider getValueTestData */
  5369. +    public function testValue(Specificity $specificity, $value)
  5370. +    {
  5371. +        $this->assertEquals($value, $specificity->getValue());
  5372. +    }
  5373. +
  5374. +    /** @dataProvider getValueTestData */
  5375. +    public function testPlusValue(Specificity $specificity, $value)
  5376. +    {
  5377. +        $this->assertEquals($value + 123, $specificity->plus(new Specificity(1, 2, 3))->getValue());
  5378. +    }
  5379. +
  5380. +    public function getValueTestData()
  5381. +    {
  5382. +        return array(
  5383. +            array(new Specificity(0, 0, 0), 0),
  5384. +            array(new Specificity(0, 0, 2), 2),
  5385. +            array(new Specificity(0, 3, 0), 30),
  5386. +            array(new Specificity(4, 0, 0), 400),
  5387. +            array(new Specificity(4, 3, 2), 432),
  5388. +        );
  5389. +    }
  5390. +}
  5391. 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
  5392. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php   1970-01-01 01:00:00.000000000 +0100
  5393. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/AbstractHandlerTest.php  2014-11-19 15:54:03.416099959 +0100
  5394. @@ -0,0 +1,67 @@
  5395. +<?php
  5396. +
  5397. +/*
  5398. + * This file is part of the Symfony package.
  5399. + *
  5400. + * (c) Fabien Potencier <fabien@symfony.com>
  5401. + *
  5402. + * For the full copyright and license information, please view the LICENSE
  5403. + * file that was distributed with this source code.
  5404. + */
  5405. +
  5406. +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
  5407. +
  5408. +use Symfony\Component\CssSelector\Parser\Reader;
  5409. +use Symfony\Component\CssSelector\Parser\Token;
  5410. +use Symfony\Component\CssSelector\Parser\TokenStream;
  5411. +
  5412. +/**
  5413. + * @author Jean-François Simon <contact@jfsimon.fr>
  5414. + */
  5415. +abstract class AbstractHandlerTest extends \PHPUnit_Framework_TestCase
  5416. +{
  5417. +    /** @dataProvider getHandleValueTestData */
  5418. +    public function testHandleValue($value, Token $expectedToken, $remainingContent)
  5419. +    {
  5420. +        $reader = new Reader($value);
  5421. +        $stream = new TokenStream();
  5422. +
  5423. +        $this->assertTrue($this->generateHandler()->handle($reader, $stream));
  5424. +        $this->assertEquals($expectedToken, $stream->getNext());
  5425. +        $this->assertRemainingContent($reader, $remainingContent);
  5426. +    }
  5427. +
  5428. +    /** @dataProvider getDontHandleValueTestData */
  5429. +    public function testDontHandleValue($value)
  5430. +    {
  5431. +        $reader = new Reader($value);
  5432. +        $stream = new TokenStream();
  5433. +
  5434. +        $this->assertFalse($this->generateHandler()->handle($reader, $stream));
  5435. +        $this->assertStreamEmpty($stream);
  5436. +        $this->assertRemainingContent($reader, $value);
  5437. +    }
  5438. +
  5439. +    abstract public function getHandleValueTestData();
  5440. +    abstract public function getDontHandleValueTestData();
  5441. +    abstract protected function generateHandler();
  5442. +
  5443. +    protected function assertStreamEmpty(TokenStream $stream)
  5444. +    {
  5445. +        $property = new \ReflectionProperty($stream, 'tokens');
  5446. +        $property->setAccessible(true);
  5447. +
  5448. +        $this->assertEquals(array(), $property->getValue($stream));
  5449. +    }
  5450. +
  5451. +    protected function assertRemainingContent(Reader $reader, $remainingContent)
  5452. +    {
  5453. +        if ('' === $remainingContent) {
  5454. +            $this->assertEquals(0, $reader->getRemainingLength());
  5455. +            $this->assertTrue($reader->isEOF());
  5456. +        } else {
  5457. +            $this->assertEquals(strlen($remainingContent), $reader->getRemainingLength());
  5458. +            $this->assertEquals(0, $reader->getOffset($remainingContent));
  5459. +        }
  5460. +    }
  5461. +}
  5462. 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
  5463. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php    1970-01-01 01:00:00.000000000 +0100
  5464. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/CommentHandlerTest.php   2014-11-19 15:54:03.252099958 +0100
  5465. @@ -0,0 +1,55 @@
  5466. +<?php
  5467. +
  5468. +/*
  5469. + * This file is part of the Symfony package.
  5470. + *
  5471. + * (c) Fabien Potencier <fabien@symfony.com>
  5472. + *
  5473. + * For the full copyright and license information, please view the LICENSE
  5474. + * file that was distributed with this source code.
  5475. + */
  5476. +
  5477. +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
  5478. +
  5479. +use Symfony\Component\CssSelector\Parser\Handler\CommentHandler;
  5480. +use Symfony\Component\CssSelector\Parser\Reader;
  5481. +use Symfony\Component\CssSelector\Parser\Token;
  5482. +use Symfony\Component\CssSelector\Parser\TokenStream;
  5483. +
  5484. +class CommentHandlerTest extends AbstractHandlerTest
  5485. +{
  5486. +    /** @dataProvider getHandleValueTestData */
  5487. +    public function testHandleValue($value, Token $unusedArgument, $remainingContent)
  5488. +    {
  5489. +        $reader = new Reader($value);
  5490. +        $stream = new TokenStream();
  5491. +
  5492. +        $this->assertTrue($this->generateHandler()->handle($reader, $stream));
  5493. +        // comments are ignored (not pushed as token in stream)
  5494. +        $this->assertStreamEmpty($stream);
  5495. +        $this->assertRemainingContent($reader, $remainingContent);
  5496. +    }
  5497. +
  5498. +    public function getHandleValueTestData()
  5499. +    {
  5500. +        return array(
  5501. +            // 2nd argument only exists for inherited method compatibility
  5502. +            array('/* comment */', new Token(null, null, null), ''),
  5503. +            array('/* comment */foo', new Token(null, null, null), 'foo'),
  5504. +        );
  5505. +    }
  5506. +
  5507. +    public function getDontHandleValueTestData()
  5508. +    {
  5509. +        return array(
  5510. +            array('>'),
  5511. +            array('+'),
  5512. +            array(' '),
  5513. +        );
  5514. +    }
  5515. +
  5516. +    protected function generateHandler()
  5517. +    {
  5518. +        return new CommentHandler();
  5519. +    }
  5520. +}
  5521. 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
  5522. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php   1970-01-01 01:00:00.000000000 +0100
  5523. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/HashHandlerTest.php  2014-11-19 15:54:03.736099961 +0100
  5524. @@ -0,0 +1,49 @@
  5525. +<?php
  5526. +
  5527. +/*
  5528. + * This file is part of the Symfony package.
  5529. + *
  5530. + * (c) Fabien Potencier <fabien@symfony.com>
  5531. + *
  5532. + * For the full copyright and license information, please view the LICENSE
  5533. + * file that was distributed with this source code.
  5534. + */
  5535. +
  5536. +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
  5537. +
  5538. +use Symfony\Component\CssSelector\Parser\Handler\HashHandler;
  5539. +use Symfony\Component\CssSelector\Parser\Token;
  5540. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
  5541. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
  5542. +
  5543. +class HashHandlerTest extends AbstractHandlerTest
  5544. +{
  5545. +    public function getHandleValueTestData()
  5546. +    {
  5547. +        return array(
  5548. +            array('#id', new Token(Token::TYPE_HASH, 'id', 0), ''),
  5549. +            array('#123', new Token(Token::TYPE_HASH, '123', 0), ''),
  5550. +
  5551. +            array('#id.class', new Token(Token::TYPE_HASH, 'id', 0), '.class'),
  5552. +            array('#id element', new Token(Token::TYPE_HASH, 'id', 0), ' element'),
  5553. +        );
  5554. +    }
  5555. +
  5556. +    public function getDontHandleValueTestData()
  5557. +    {
  5558. +        return array(
  5559. +            array('id'),
  5560. +            array('123'),
  5561. +            array('<'),
  5562. +            array('<'),
  5563. +            array('#'),
  5564. +        );
  5565. +    }
  5566. +
  5567. +    protected function generateHandler()
  5568. +    {
  5569. +        $patterns = new TokenizerPatterns();
  5570. +
  5571. +        return new HashHandler($patterns, new TokenizerEscaping($patterns));
  5572. +    }
  5573. +}
  5574. 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
  5575. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php 1970-01-01 01:00:00.000000000 +0100
  5576. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/IdentifierHandlerTest.php    2014-11-19 15:54:03.092099957 +0100
  5577. @@ -0,0 +1,49 @@
  5578. +<?php
  5579. +
  5580. +/*
  5581. + * This file is part of the Symfony package.
  5582. + *
  5583. + * (c) Fabien Potencier <fabien@symfony.com>
  5584. + *
  5585. + * For the full copyright and license information, please view the LICENSE
  5586. + * file that was distributed with this source code.
  5587. + */
  5588. +
  5589. +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
  5590. +
  5591. +use Symfony\Component\CssSelector\Parser\Handler\IdentifierHandler;
  5592. +use Symfony\Component\CssSelector\Parser\Token;
  5593. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
  5594. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
  5595. +
  5596. +class IdentifierHandlerTest extends AbstractHandlerTest
  5597. +{
  5598. +    public function getHandleValueTestData()
  5599. +    {
  5600. +        return array(
  5601. +            array('foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''),
  5602. +            array('foo|bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '|bar'),
  5603. +            array('foo.class', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '.class'),
  5604. +            array('foo[attr]', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '[attr]'),
  5605. +            array('foo bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ' bar'),
  5606. +        );
  5607. +    }
  5608. +
  5609. +    public function getDontHandleValueTestData()
  5610. +    {
  5611. +        return array(
  5612. +            array('>'),
  5613. +            array('+'),
  5614. +            array(' '),
  5615. +            array('*|foo'),
  5616. +            array('/* comment */'),
  5617. +        );
  5618. +    }
  5619. +
  5620. +    protected function generateHandler()
  5621. +    {
  5622. +        $patterns = new TokenizerPatterns();
  5623. +
  5624. +        return new IdentifierHandler($patterns, new TokenizerEscaping($patterns));
  5625. +    }
  5626. +}
  5627. 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
  5628. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php 1970-01-01 01:00:00.000000000 +0100
  5629. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/NumberHandlerTest.php    2014-11-19 15:54:03.576099960 +0100
  5630. @@ -0,0 +1,50 @@
  5631. +<?php
  5632. +
  5633. +/*
  5634. + * This file is part of the Symfony package.
  5635. + *
  5636. + * (c) Fabien Potencier <fabien@symfony.com>
  5637. + *
  5638. + * For the full copyright and license information, please view the LICENSE
  5639. + * file that was distributed with this source code.
  5640. + */
  5641. +
  5642. +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
  5643. +
  5644. +use Symfony\Component\CssSelector\Parser\Handler\NumberHandler;
  5645. +use Symfony\Component\CssSelector\Parser\Token;
  5646. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
  5647. +
  5648. +class NumberHandlerTest extends AbstractHandlerTest
  5649. +{
  5650. +    public function getHandleValueTestData()
  5651. +    {
  5652. +        return array(
  5653. +            array('12', new Token(Token::TYPE_NUMBER, '12', 0), ''),
  5654. +            array('12.34', new Token(Token::TYPE_NUMBER, '12.34', 0), ''),
  5655. +            array('+12.34', new Token(Token::TYPE_NUMBER, '+12.34', 0), ''),
  5656. +            array('-12.34', new Token(Token::TYPE_NUMBER, '-12.34', 0), ''),
  5657. +
  5658. +            array('12 arg', new Token(Token::TYPE_NUMBER, '12', 0), ' arg'),
  5659. +            array('12]', new Token(Token::TYPE_NUMBER, '12', 0), ']'),
  5660. +        );
  5661. +    }
  5662. +
  5663. +    public function getDontHandleValueTestData()
  5664. +    {
  5665. +        return array(
  5666. +            array('hello'),
  5667. +            array('>'),
  5668. +            array('+'),
  5669. +            array(' '),
  5670. +            array('/* comment */'),
  5671. +        );
  5672. +    }
  5673. +
  5674. +    protected function generateHandler()
  5675. +    {
  5676. +        $patterns = new TokenizerPatterns();
  5677. +
  5678. +        return new NumberHandler($patterns);
  5679. +    }
  5680. +}
  5681. 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
  5682. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php 1970-01-01 01:00:00.000000000 +0100
  5683. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/StringHandlerTest.php    2014-11-19 15:54:02.928099956 +0100
  5684. @@ -0,0 +1,50 @@
  5685. +<?php
  5686. +
  5687. +/*
  5688. + * This file is part of the Symfony package.
  5689. + *
  5690. + * (c) Fabien Potencier <fabien@symfony.com>
  5691. + *
  5692. + * For the full copyright and license information, please view the LICENSE
  5693. + * file that was distributed with this source code.
  5694. + */
  5695. +
  5696. +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
  5697. +
  5698. +use Symfony\Component\CssSelector\Parser\Handler\StringHandler;
  5699. +use Symfony\Component\CssSelector\Parser\Token;
  5700. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
  5701. +use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
  5702. +
  5703. +class StringHandlerTest extends AbstractHandlerTest
  5704. +{
  5705. +    public function getHandleValueTestData()
  5706. +    {
  5707. +        return array(
  5708. +            array('"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''),
  5709. +            array('"1"', new Token(Token::TYPE_STRING, '1', 1), ''),
  5710. +            array('" "', new Token(Token::TYPE_STRING, ' ', 1), ''),
  5711. +            array('""', new Token(Token::TYPE_STRING, '', 1), ''),
  5712. +            array("'hello'", new Token(Token::TYPE_STRING, 'hello', 1), ''),
  5713. +
  5714. +            array("'foo'bar", new Token(Token::TYPE_STRING, 'foo', 1), 'bar'),
  5715. +        );
  5716. +    }
  5717. +
  5718. +    public function getDontHandleValueTestData()
  5719. +    {
  5720. +        return array(
  5721. +            array('hello'),
  5722. +            array('>'),
  5723. +            array('1'),
  5724. +            array(' '),
  5725. +        );
  5726. +    }
  5727. +
  5728. +    protected function generateHandler()
  5729. +    {
  5730. +        $patterns = new TokenizerPatterns();
  5731. +
  5732. +        return new StringHandler($patterns, new TokenizerEscaping($patterns));
  5733. +    }
  5734. +}
  5735. 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
  5736. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php 1970-01-01 01:00:00.000000000 +0100
  5737. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Handler/WhitespaceHandlerTest.php    2014-11-19 15:54:02.768099955 +0100
  5738. @@ -0,0 +1,44 @@
  5739. +<?php
  5740. +
  5741. +/*
  5742. + * This file is part of the Symfony package.
  5743. + *
  5744. + * (c) Fabien Potencier <fabien@symfony.com>
  5745. + *
  5746. + * For the full copyright and license information, please view the LICENSE
  5747. + * file that was distributed with this source code.
  5748. + */
  5749. +
  5750. +namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
  5751. +
  5752. +use Symfony\Component\CssSelector\Parser\Handler\WhitespaceHandler;
  5753. +use Symfony\Component\CssSelector\Parser\Token;
  5754. +
  5755. +class WhitespaceHandlerTest extends AbstractHandlerTest
  5756. +{
  5757. +    public function getHandleValueTestData()
  5758. +    {
  5759. +        return array(
  5760. +            array(' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''),
  5761. +            array("\n", new Token(Token::TYPE_WHITESPACE, "\n", 0), ''),
  5762. +            array("\t", new Token(Token::TYPE_WHITESPACE, "\t", 0), ''),
  5763. +
  5764. +            array(' foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), 'foo'),
  5765. +            array(' .foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), '.foo'),
  5766. +        );
  5767. +    }
  5768. +
  5769. +    public function getDontHandleValueTestData()
  5770. +    {
  5771. +        return array(
  5772. +            array('>'),
  5773. +            array('1'),
  5774. +            array('a'),
  5775. +        );
  5776. +    }
  5777. +
  5778. +    protected function generateHandler()
  5779. +    {
  5780. +        return new WhitespaceHandler();
  5781. +    }
  5782. +}
  5783. 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
  5784. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php    1970-01-01 01:00:00.000000000 +0100
  5785. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ParserTest.php   2014-11-19 15:54:02.292099952 +0100
  5786. @@ -0,0 +1,248 @@
  5787. +<?php
  5788. +
  5789. +/*
  5790. + * This file is part of the Symfony package.
  5791. + *
  5792. + * (c) Fabien Potencier <fabien@symfony.com>
  5793. + *
  5794. + * For the full copyright and license information, please view the LICENSE
  5795. + * file that was distributed with this source code.
  5796. + */
  5797. +
  5798. +namespace Symfony\Component\CssSelector\Tests\Parser;
  5799. +
  5800. +use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
  5801. +use Symfony\Component\CssSelector\Node\FunctionNode;
  5802. +use Symfony\Component\CssSelector\Node\SelectorNode;
  5803. +use Symfony\Component\CssSelector\Parser\Parser;
  5804. +use Symfony\Component\CssSelector\Parser\Token;
  5805. +
  5806. +class ParserTest extends \PHPUnit_Framework_TestCase
  5807. +{
  5808. +    /** @dataProvider getParserTestData */
  5809. +    public function testParser($source, $representation)
  5810. +    {
  5811. +        $parser = new Parser();
  5812. +
  5813. +        $this->assertEquals($representation, array_map(function (SelectorNode $node) {
  5814. +            return (string) $node->getTree();
  5815. +        }, $parser->parse($source)));
  5816. +    }
  5817. +
  5818. +    /** @dataProvider getParserExceptionTestData */
  5819. +    public function testParserException($source, $message)
  5820. +    {
  5821. +        $parser = new Parser();
  5822. +
  5823. +        try {
  5824. +            $parser->parse($source);
  5825. +            $this->fail('Parser should throw a SyntaxErrorException.');
  5826. +        } catch (SyntaxErrorException $e) {
  5827. +            $this->assertEquals($message, $e->getMessage());
  5828. +        }
  5829. +    }
  5830. +
  5831. +    /** @dataProvider getPseudoElementsTestData */
  5832. +    public function testPseudoElements($source, $element, $pseudo)
  5833. +    {
  5834. +        $parser = new Parser();
  5835. +        $selectors = $parser->parse($source);
  5836. +        $this->assertCount(1, $selectors);
  5837. +
  5838. +        /** @var SelectorNode $selector */
  5839. +        $selector = $selectors[0];
  5840. +        $this->assertEquals($element, (string) $selector->getTree());
  5841. +        $this->assertEquals($pseudo, (string) $selector->getPseudoElement());
  5842. +    }
  5843. +
  5844. +    /** @dataProvider getSpecificityTestData */
  5845. +    public function testSpecificity($source, $value)
  5846. +    {
  5847. +        $parser = new Parser();
  5848. +        $selectors = $parser->parse($source);
  5849. +        $this->assertCount(1, $selectors);
  5850. +
  5851. +        /** @var SelectorNode $selector */
  5852. +        $selector = $selectors[0];
  5853. +        $this->assertEquals($value, $selector->getSpecificity()->getValue());
  5854. +    }
  5855. +
  5856. +    /** @dataProvider getParseSeriesTestData */
  5857. +    public function testParseSeries($series, $a, $b)
  5858. +    {
  5859. +        $parser = new Parser();
  5860. +        $selectors = $parser->parse(sprintf(':nth-child(%s)', $series));
  5861. +        $this->assertCount(1, $selectors);
  5862. +
  5863. +        /** @var FunctionNode $function */
  5864. +        $function = $selectors[0]->getTree();
  5865. +        $this->assertEquals(array($a, $b), Parser::parseSeries($function->getArguments()));
  5866. +    }
  5867. +
  5868. +    /** @dataProvider getParseSeriesExceptionTestData */
  5869. +    public function testParseSeriesException($series)
  5870. +    {
  5871. +        $parser = new Parser();
  5872. +        $selectors = $parser->parse(sprintf(':nth-child(%s)', $series));
  5873. +        $this->assertCount(1, $selectors);
  5874. +
  5875. +        /** @var FunctionNode $function */
  5876. +        $function = $selectors[0]->getTree();
  5877. +        $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
  5878. +        Parser::parseSeries($function->getArguments());
  5879. +    }
  5880. +
  5881. +    public function getParserTestData()
  5882. +    {
  5883. +        return array(
  5884. +            array('*', array('Element[*]')),
  5885. +            array('*|*', array('Element[*]')),
  5886. +            array('*|foo', array('Element[foo]')),
  5887. +            array('foo|*', array('Element[foo|*]')),
  5888. +            array('foo|bar', array('Element[foo|bar]')),
  5889. +            array('#foo#bar', array('Hash[Hash[Element[*]#foo]#bar]')),
  5890. +            array('div>.foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')),
  5891. +            array('div> .foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')),
  5892. +            array('div >.foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')),
  5893. +            array('div > .foo', array('CombinedSelector[Element[div] > Class[Element[*].foo]]')),
  5894. +            array("div \n>  \t \t .foo", array('CombinedSelector[Element[div] > Class[Element[*].foo]]')),
  5895. +            array('td.foo,.bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
  5896. +            array('td.foo, .bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
  5897. +            array("td.foo\t\r\n\f ,\t\r\n\f .bar", array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
  5898. +            array('td.foo,.bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
  5899. +            array('td.foo, .bar', array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
  5900. +            array("td.foo\t\r\n\f ,\t\r\n\f .bar", array('Class[Element[td].foo]', 'Class[Element[*].bar]')),
  5901. +            array('div, td.foo, div.bar span', array('Element[div]', 'Class[Element[td].foo]', 'CombinedSelector[Class[Element[div].bar] <followed> Element[span]]')),
  5902. +            array('div > p', array('CombinedSelector[Element[div] > Element[p]]')),
  5903. +            array('td:first', array('Pseudo[Element[td]:first]')),
  5904. +            array('td :first', array('CombinedSelector[Element[td] <followed> Pseudo[Element[*]:first]]')),
  5905. +            array('a[name]', array('Attribute[Element[a][name]]')),
  5906. +            array("a[ name\t]", array('Attribute[Element[a][name]]')),
  5907. +            array('a [name]', array('CombinedSelector[Element[a] <followed> Attribute[Element[*][name]]]')),
  5908. +            array('a[rel="include"]', array("Attribute[Element[a][rel = 'include']]")),
  5909. +            array('a[rel = include]', array("Attribute[Element[a][rel = 'include']]")),
  5910. +            array("a[hreflang |= 'en']", array("Attribute[Element[a][hreflang |= 'en']]")),
  5911. +            array('a[hreflang|=en]', array("Attribute[Element[a][hreflang |= 'en']]")),
  5912. +            array('div:nth-child(10)', array("Function[Element[div]:nth-child(['10'])]")),
  5913. +            array(':nth-child(2n+2)', array("Function[Element[*]:nth-child(['2', 'n', '+2'])]")),
  5914. +            array('div:nth-of-type(10)', array("Function[Element[div]:nth-of-type(['10'])]")),
  5915. +            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]]")),
  5916. +            array('label:only', array('Pseudo[Element[label]:only]')),
  5917. +            array('a:lang(fr)', array("Function[Element[a]:lang(['fr'])]")),
  5918. +            array('div:contains("foo")', array("Function[Element[div]:contains(['foo'])]")),
  5919. +            array('div#foobar', array('Hash[Element[div]#foobar]')),
  5920. +            array('div:not(div.foo)', array('Negation[Element[div]:not(Class[Element[div].foo])]')),
  5921. +            array('td ~ th', array('CombinedSelector[Element[td] ~ Element[th]]')),
  5922. +            array('.foo[data-bar][data-baz=0]', array("Attribute[Attribute[Class[Element[*].foo][data-bar]][data-baz = '0']]")),
  5923. +        );
  5924. +    }
  5925. +
  5926. +    public function getParserExceptionTestData()
  5927. +    {
  5928. +        return array(
  5929. +            array('attributes(href)/html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()),
  5930. +            array('attributes(href)', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '(', 10))->getMessage()),
  5931. +            array('html/body/a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '/', 4))->getMessage()),
  5932. +            array(' ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 1))->getMessage()),
  5933. +            array('div, ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 5))->getMessage()),
  5934. +            array(' , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 1))->getMessage()),
  5935. +            array('p, , div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, ',', 3))->getMessage()),
  5936. +            array('div > ', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_FILE_END, '', 6))->getMessage()),
  5937. +            array('  > div', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '>', 2))->getMessage()),
  5938. +            array('foo|#bar', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_HASH, 'bar', 4))->getMessage()),
  5939. +            array('#.foo', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '#', 0))->getMessage()),
  5940. +            array('.#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()),
  5941. +            array(':#foo', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_HASH, 'foo', 1))->getMessage()),
  5942. +            array('[*]', SyntaxErrorException::unexpectedToken('"|"', new Token(Token::TYPE_DELIMITER, ']', 2))->getMessage()),
  5943. +            array('[foo|]', SyntaxErrorException::unexpectedToken('identifier', new Token(Token::TYPE_DELIMITER, ']', 5))->getMessage()),
  5944. +            array('[#]', SyntaxErrorException::unexpectedToken('identifier or "*"', new Token(Token::TYPE_DELIMITER, '#', 1))->getMessage()),
  5945. +            array('[foo=#]', SyntaxErrorException::unexpectedToken('string or identifier', new Token(Token::TYPE_DELIMITER, '#', 5))->getMessage()),
  5946. +            array(':nth-child()', SyntaxErrorException::unexpectedToken('at least one argument', new Token(Token::TYPE_DELIMITER, ')', 11))->getMessage()),
  5947. +            array('[href]a', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_IDENTIFIER, 'a', 6))->getMessage()),
  5948. +            array('[rel:stylesheet]', SyntaxErrorException::unexpectedToken('operator', new Token(Token::TYPE_DELIMITER, ':', 4))->getMessage()),
  5949. +            array('[rel=stylesheet', SyntaxErrorException::unexpectedToken('"]"', new Token(Token::TYPE_FILE_END, '', 15))->getMessage()),
  5950. +            array(':lang(fr', SyntaxErrorException::unexpectedToken('an argument', new Token(Token::TYPE_FILE_END, '', 8))->getMessage()),
  5951. +            array(':contains("foo', SyntaxErrorException::unclosedString(10)->getMessage()),
  5952. +            array('foo!', SyntaxErrorException::unexpectedToken('selector', new Token(Token::TYPE_DELIMITER, '!', 3))->getMessage()),
  5953. +        );
  5954. +    }
  5955. +
  5956. +    public function getPseudoElementsTestData()
  5957. +    {
  5958. +        return array(
  5959. +            array('foo', 'Element[foo]', ''),
  5960. +            array('*', 'Element[*]', ''),
  5961. +            array(':empty', 'Pseudo[Element[*]:empty]', ''),
  5962. +            array(':BEfore', 'Element[*]', 'before'),
  5963. +            array(':aftER', 'Element[*]', 'after'),
  5964. +            array(':First-Line', 'Element[*]', 'first-line'),
  5965. +            array(':First-Letter', 'Element[*]', 'first-letter'),
  5966. +            array('::befoRE', 'Element[*]', 'before'),
  5967. +            array('::AFter', 'Element[*]', 'after'),
  5968. +            array('::firsT-linE', 'Element[*]', 'first-line'),
  5969. +            array('::firsT-letteR', 'Element[*]', 'first-letter'),
  5970. +            array('::Selection', 'Element[*]', 'selection'),
  5971. +            array('foo:after', 'Element[foo]', 'after'),
  5972. +            array('foo::selection', 'Element[foo]', 'selection'),
  5973. +            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'),
  5974. +        );
  5975. +    }
  5976. +
  5977. +    public function getSpecificityTestData()
  5978. +    {
  5979. +        return array(
  5980. +            array('*', 0),
  5981. +            array(' foo', 1),
  5982. +            array(':empty ', 10),
  5983. +            array(':before', 1),
  5984. +            array('*:before', 1),
  5985. +            array(':nth-child(2)', 10),
  5986. +            array('.bar', 10),
  5987. +            array('[baz]', 10),
  5988. +            array('[baz="4"]', 10),
  5989. +            array('[baz^="4"]', 10),
  5990. +            array('#lipsum', 100),
  5991. +            array(':not(*)', 0),
  5992. +            array(':not(foo)', 1),
  5993. +            array(':not(.foo)', 10),
  5994. +            array(':not([foo])', 10),
  5995. +            array(':not(:empty)', 10),
  5996. +            array(':not(#foo)', 100),
  5997. +            array('foo:empty', 11),
  5998. +            array('foo:before', 2),
  5999. +            array('foo::before', 2),
  6000. +            array('foo:empty::before', 12),
  6001. +            array('#lorem + foo#ipsum:first-child > bar:first-line', 213),
  6002. +        );
  6003. +    }
  6004. +
  6005. +    public function getParseSeriesTestData()
  6006. +    {
  6007. +        return array(
  6008. +            array('1n+3', 1, 3),
  6009. +            array('1n +3', 1, 3),
  6010. +            array('1n + 3', 1, 3),
  6011. +            array('1n+ 3', 1, 3),
  6012. +            array('1n-3', 1, -3),
  6013. +            array('1n -3', 1, -3),
  6014. +            array('1n - 3', 1, -3),
  6015. +            array('1n- 3', 1, -3),
  6016. +            array('n-5', 1, -5),
  6017. +            array('odd', 2, 1),
  6018. +            array('even', 2, 0),
  6019. +            array('3n', 3, 0),
  6020. +            array('n', 1, 0),
  6021. +            array('+n', 1, 0),
  6022. +            array('-n', -1, 0),
  6023. +            array('5', 0, 5),
  6024. +        );
  6025. +    }
  6026. +
  6027. +    public function getParseSeriesExceptionTestData()
  6028. +    {
  6029. +        return array(
  6030. +            array('foo'),
  6031. +            array('n+'),
  6032. +        );
  6033. +    }
  6034. +}
  6035. 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
  6036. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php    1970-01-01 01:00:00.000000000 +0100
  6037. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/ReaderTest.php   2014-11-19 15:54:04.860099968 +0100
  6038. @@ -0,0 +1,101 @@
  6039. +<?php
  6040. +
  6041. +/*
  6042. + * This file is part of the Symfony package.
  6043. + *
  6044. + * (c) Fabien Potencier <fabien@symfony.com>
  6045. + *
  6046. + * For the full copyright and license information, please view the LICENSE
  6047. + * file that was distributed with this source code.
  6048. + */
  6049. +
  6050. +namespace Symfony\Component\CssSelector\Tests\Parser;
  6051. +
  6052. +use Symfony\Component\CssSelector\Parser\Reader;
  6053. +
  6054. +class ReaderTest extends \PHPUnit_Framework_TestCase
  6055. +{
  6056. +    public function testIsEOF()
  6057. +    {
  6058. +        $reader = new Reader('');
  6059. +        $this->assertTrue($reader->isEOF());
  6060. +
  6061. +        $reader = new Reader('hello');
  6062. +        $this->assertFalse($reader->isEOF());
  6063. +
  6064. +        $this->assignPosition($reader, 2);
  6065. +        $this->assertFalse($reader->isEOF());
  6066. +
  6067. +        $this->assignPosition($reader, 5);
  6068. +        $this->assertTrue($reader->isEOF());
  6069. +    }
  6070. +
  6071. +    public function testGetRemainingLength()
  6072. +    {
  6073. +        $reader = new Reader('hello');
  6074. +        $this->assertEquals(5, $reader->getRemainingLength());
  6075. +
  6076. +        $this->assignPosition($reader, 2);
  6077. +        $this->assertEquals(3, $reader->getRemainingLength());
  6078. +
  6079. +        $this->assignPosition($reader, 5);
  6080. +        $this->assertEquals(0, $reader->getRemainingLength());
  6081. +    }
  6082. +
  6083. +    public function testGetSubstring()
  6084. +    {
  6085. +        $reader = new Reader('hello');
  6086. +        $this->assertEquals('he', $reader->getSubstring(2));
  6087. +        $this->assertEquals('el', $reader->getSubstring(2, 1));
  6088. +
  6089. +        $this->assignPosition($reader, 2);
  6090. +        $this->assertEquals('ll', $reader->getSubstring(2));
  6091. +        $this->assertEquals('lo', $reader->getSubstring(2, 1));
  6092. +    }
  6093. +
  6094. +    public function testGetOffset()
  6095. +    {
  6096. +        $reader = new Reader('hello');
  6097. +        $this->assertEquals(2, $reader->getOffset('ll'));
  6098. +        $this->assertFalse($reader->getOffset('w'));
  6099. +
  6100. +        $this->assignPosition($reader, 2);
  6101. +        $this->assertEquals(0, $reader->getOffset('ll'));
  6102. +        $this->assertFalse($reader->getOffset('he'));
  6103. +    }
  6104. +
  6105. +    public function testFindPattern()
  6106. +    {
  6107. +        $reader = new Reader('hello');
  6108. +
  6109. +        $this->assertFalse($reader->findPattern('/world/'));
  6110. +        $this->assertEquals(array('hello', 'h'), $reader->findPattern('/^([a-z]).*/'));
  6111. +
  6112. +        $this->assignPosition($reader, 2);
  6113. +        $this->assertFalse($reader->findPattern('/^h.*/'));
  6114. +        $this->assertEquals(array('llo'), $reader->findPattern('/^llo$/'));
  6115. +    }
  6116. +
  6117. +    public function testMoveForward()
  6118. +    {
  6119. +        $reader = new Reader('hello');
  6120. +        $this->assertEquals(0, $reader->getPosition());
  6121. +
  6122. +        $reader->moveForward(2);
  6123. +        $this->assertEquals(2, $reader->getPosition());
  6124. +    }
  6125. +
  6126. +    public function testToEnd()
  6127. +    {
  6128. +        $reader = new Reader('hello');
  6129. +        $reader->moveToEnd();
  6130. +        $this->assertTrue($reader->isEOF());
  6131. +    }
  6132. +
  6133. +    private function assignPosition(Reader $reader, $value)
  6134. +    {
  6135. +        $position = new \ReflectionProperty($reader, 'position');
  6136. +        $position->setAccessible(true);
  6137. +        $position->setValue($reader, $value);
  6138. +    }
  6139. +}
  6140. 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
  6141. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php  1970-01-01 01:00:00.000000000 +0100
  6142. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ClassParserTest.php 2014-11-19 15:54:04.696099967 +0100
  6143. @@ -0,0 +1,44 @@
  6144. +<?php
  6145. +
  6146. +/*
  6147. + * This file is part of the Symfony package.
  6148. + *
  6149. + * (c) Fabien Potencier <fabien@symfony.com>
  6150. + *
  6151. + * For the full copyright and license information, please view the LICENSE
  6152. + * file that was distributed with this source code.
  6153. + */
  6154. +
  6155. +namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
  6156. +
  6157. +use Symfony\Component\CssSelector\Node\SelectorNode;
  6158. +use Symfony\Component\CssSelector\Parser\Shortcut\ClassParser;
  6159. +
  6160. +/**
  6161. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  6162. + */
  6163. +class ClassParserTest extends \PHPUnit_Framework_TestCase
  6164. +{
  6165. +    /** @dataProvider getParseTestData */
  6166. +    public function testParse($source, $representation)
  6167. +    {
  6168. +        $parser = new ClassParser();
  6169. +        $selectors = $parser->parse($source);
  6170. +        $this->assertCount(1, $selectors);
  6171. +
  6172. +        /** @var SelectorNode $selector */
  6173. +        $selector = $selectors[0];
  6174. +        $this->assertEquals($representation, (string) $selector->getTree());
  6175. +    }
  6176. +
  6177. +    public function getParseTestData()
  6178. +    {
  6179. +        return array(
  6180. +            array('.testclass', 'Class[Element[*].testclass]'),
  6181. +            array('testel.testclass', 'Class[Element[testel].testclass]'),
  6182. +            array('testns|.testclass', 'Class[Element[testns|*].testclass]'),
  6183. +            array('testns|*.testclass', 'Class[Element[testns|*].testclass]'),
  6184. +            array('testns|testel.testclass', 'Class[Element[testns|testel].testclass]'),
  6185. +        );
  6186. +    }
  6187. +}
  6188. 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
  6189. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php    1970-01-01 01:00:00.000000000 +0100
  6190. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/ElementParserTest.php   2014-11-19 15:54:04.216099964 +0100
  6191. @@ -0,0 +1,43 @@
  6192. +<?php
  6193. +
  6194. +/*
  6195. + * This file is part of the Symfony package.
  6196. + *
  6197. + * (c) Fabien Potencier <fabien@symfony.com>
  6198. + *
  6199. + * For the full copyright and license information, please view the LICENSE
  6200. + * file that was distributed with this source code.
  6201. + */
  6202. +
  6203. +namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
  6204. +
  6205. +use Symfony\Component\CssSelector\Node\SelectorNode;
  6206. +use Symfony\Component\CssSelector\Parser\Shortcut\ElementParser;
  6207. +
  6208. +/**
  6209. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  6210. + */
  6211. +class ElementParserTest extends \PHPUnit_Framework_TestCase
  6212. +{
  6213. +    /** @dataProvider getParseTestData */
  6214. +    public function testParse($source, $representation)
  6215. +    {
  6216. +        $parser = new ElementParser();
  6217. +        $selectors = $parser->parse($source);
  6218. +        $this->assertCount(1, $selectors);
  6219. +
  6220. +        /** @var SelectorNode $selector */
  6221. +        $selector = $selectors[0];
  6222. +        $this->assertEquals($representation, (string) $selector->getTree());
  6223. +    }
  6224. +
  6225. +    public function getParseTestData()
  6226. +    {
  6227. +        return array(
  6228. +            array('*', 'Element[*]'),
  6229. +            array('testel', 'Element[testel]'),
  6230. +            array('testns|*', 'Element[testns|*]'),
  6231. +            array('testns|testel', 'Element[testns|testel]'),
  6232. +        );
  6233. +    }
  6234. +}
  6235. 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
  6236. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php    1970-01-01 01:00:00.000000000 +0100
  6237. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/EmptyStringParserTest.php   2014-11-19 15:54:04.536099966 +0100
  6238. @@ -0,0 +1,35 @@
  6239. +<?php
  6240. +
  6241. +/*
  6242. + * This file is part of the Symfony package.
  6243. + *
  6244. + * (c) Fabien Potencier <fabien@symfony.com>
  6245. + *
  6246. + * For the full copyright and license information, please view the LICENSE
  6247. + * file that was distributed with this source code.
  6248. + */
  6249. +
  6250. +namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
  6251. +
  6252. +use Symfony\Component\CssSelector\Node\SelectorNode;
  6253. +use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser;
  6254. +
  6255. +/**
  6256. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  6257. + */
  6258. +class EmptyStringParserTest extends \PHPUnit_Framework_TestCase
  6259. +{
  6260. +    public function testParse()
  6261. +    {
  6262. +        $parser = new EmptyStringParser();
  6263. +        $selectors = $parser->parse('');
  6264. +        $this->assertCount(1, $selectors);
  6265. +
  6266. +        /** @var SelectorNode $selector */
  6267. +        $selector = $selectors[0];
  6268. +        $this->assertEquals('Element[*]', (string) $selector->getTree());
  6269. +
  6270. +        $selectors = $parser->parse('this will produce an empty array');
  6271. +        $this->assertCount(0, $selectors);
  6272. +    }
  6273. +}
  6274. 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
  6275. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php   1970-01-01 01:00:00.000000000 +0100
  6276. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/Shortcut/HashParserTest.php  2014-11-19 15:54:04.376099965 +0100
  6277. @@ -0,0 +1,44 @@
  6278. +<?php
  6279. +
  6280. +/*
  6281. + * This file is part of the Symfony package.
  6282. + *
  6283. + * (c) Fabien Potencier <fabien@symfony.com>
  6284. + *
  6285. + * For the full copyright and license information, please view the LICENSE
  6286. + * file that was distributed with this source code.
  6287. + */
  6288. +
  6289. +namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut;
  6290. +
  6291. +use Symfony\Component\CssSelector\Node\SelectorNode;
  6292. +use Symfony\Component\CssSelector\Parser\Shortcut\HashParser;
  6293. +
  6294. +/**
  6295. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  6296. + */
  6297. +class HashParserTest extends \PHPUnit_Framework_TestCase
  6298. +{
  6299. +    /** @dataProvider getParseTestData */
  6300. +    public function testParse($source, $representation)
  6301. +    {
  6302. +        $parser = new HashParser();
  6303. +        $selectors = $parser->parse($source);
  6304. +        $this->assertCount(1, $selectors);
  6305. +
  6306. +        /** @var SelectorNode $selector */
  6307. +        $selector = $selectors[0];
  6308. +        $this->assertEquals($representation, (string) $selector->getTree());
  6309. +    }
  6310. +
  6311. +    public function getParseTestData()
  6312. +    {
  6313. +        return array(
  6314. +            array('#testid', 'Hash[Element[*]#testid]'),
  6315. +            array('testel#testid', 'Hash[Element[testel]#testid]'),
  6316. +            array('testns|#testid', 'Hash[Element[testns|*]#testid]'),
  6317. +            array('testns|*#testid', 'Hash[Element[testns|*]#testid]'),
  6318. +            array('testns|testel#testid', 'Hash[Element[testns|testel]#testid]'),
  6319. +        );
  6320. +    }
  6321. +}
  6322. 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
  6323. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php   1970-01-01 01:00:00.000000000 +0100
  6324. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/Parser/TokenStreamTest.php  2014-11-19 15:54:05.020099969 +0100
  6325. @@ -0,0 +1,95 @@
  6326. +<?php
  6327. +
  6328. +/*
  6329. + * This file is part of the Symfony package.
  6330. + *
  6331. + * (c) Fabien Potencier <fabien@symfony.com>
  6332. + *
  6333. + * For the full copyright and license information, please view the LICENSE
  6334. + * file that was distributed with this source code.
  6335. + */
  6336. +
  6337. +namespace Symfony\Component\CssSelector\Tests\Parser;
  6338. +
  6339. +use Symfony\Component\CssSelector\Parser\Token;
  6340. +use Symfony\Component\CssSelector\Parser\TokenStream;
  6341. +
  6342. +class TokenStreamTest extends \PHPUnit_Framework_TestCase
  6343. +{
  6344. +    public function testGetNext()
  6345. +    {
  6346. +        $stream = new TokenStream();
  6347. +        $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
  6348. +        $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2));
  6349. +        $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3));
  6350. +
  6351. +        $this->assertSame($t1, $stream->getNext());
  6352. +        $this->assertSame($t2, $stream->getNext());
  6353. +        $this->assertSame($t3, $stream->getNext());
  6354. +    }
  6355. +
  6356. +    public function testGetPeek()
  6357. +    {
  6358. +        $stream = new TokenStream();
  6359. +        $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
  6360. +        $stream->push($t2 = new Token(Token::TYPE_DELIMITER, '.', 2));
  6361. +        $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'title', 3));
  6362. +
  6363. +        $this->assertSame($t1, $stream->getPeek());
  6364. +        $this->assertSame($t1, $stream->getNext());
  6365. +        $this->assertSame($t2, $stream->getPeek());
  6366. +        $this->assertSame($t2, $stream->getPeek());
  6367. +        $this->assertSame($t2, $stream->getNext());
  6368. +    }
  6369. +
  6370. +    public function testGetNextIdentifier()
  6371. +    {
  6372. +        $stream = new TokenStream();
  6373. +        $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
  6374. +
  6375. +        $this->assertEquals('h1', $stream->getNextIdentifier());
  6376. +    }
  6377. +
  6378. +    public function testFailToGetNextIdentifier()
  6379. +    {
  6380. +        $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
  6381. +
  6382. +        $stream = new TokenStream();
  6383. +        $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2));
  6384. +        $stream->getNextIdentifier();
  6385. +    }
  6386. +
  6387. +    public function testGetNextIdentifierOrStar()
  6388. +    {
  6389. +        $stream = new TokenStream();
  6390. +
  6391. +        $stream->push(new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
  6392. +        $this->assertEquals('h1', $stream->getNextIdentifierOrStar());
  6393. +
  6394. +        $stream->push(new Token(Token::TYPE_DELIMITER, '*', 0));
  6395. +        $this->assertNull($stream->getNextIdentifierOrStar());
  6396. +    }
  6397. +
  6398. +    public function testFailToGetNextIdentifierOrStar()
  6399. +    {
  6400. +        $this->setExpectedException('Symfony\Component\CssSelector\Exception\SyntaxErrorException');
  6401. +
  6402. +        $stream = new TokenStream();
  6403. +        $stream->push(new Token(Token::TYPE_DELIMITER, '.', 2));
  6404. +        $stream->getNextIdentifierOrStar();
  6405. +    }
  6406. +
  6407. +    public function testSkipWhitespace()
  6408. +    {
  6409. +        $stream = new TokenStream();
  6410. +        $stream->push($t1 = new Token(Token::TYPE_IDENTIFIER, 'h1', 0));
  6411. +        $stream->push($t2 = new Token(Token::TYPE_WHITESPACE, ' ', 2));
  6412. +        $stream->push($t3 = new Token(Token::TYPE_IDENTIFIER, 'h1', 3));
  6413. +
  6414. +        $stream->skipWhitespace();
  6415. +        $this->assertSame($t1, $stream->getNext());
  6416. +
  6417. +        $stream->skipWhitespace();
  6418. +        $this->assertSame($t3, $stream->getNext());
  6419. +    }
  6420. +}
  6421. 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
  6422. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html  1970-01-01 01:00:00.000000000 +0100
  6423. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/ids.html 2014-11-19 15:54:01.220099946 +0100
  6424. @@ -0,0 +1,48 @@
  6425. +<html id="html"><head>
  6426. +  <link id="link-href" href="foo" />
  6427. +  <link id="link-nohref" />
  6428. +</head><body>
  6429. +<div id="outer-div">
  6430. + <a id="name-anchor" name="foo"></a>
  6431. + <a id="tag-anchor" rel="tag" href="http://localhost/foo">link</a>
  6432. + <a id="nofollow-anchor" rel="nofollow" href="https://example.org">
  6433. +    link</a>
  6434. + <ol id="first-ol" class="a b c">
  6435. +   <li id="first-li">content</li>
  6436. +   <li id="second-li" lang="En-us">
  6437. +     <div id="li-div">
  6438. +     </div>
  6439. +   </li>
  6440. +   <li id="third-li" class="ab c"></li>
  6441. +   <li id="fourth-li" class="ab
  6442. +c"></li>
  6443. +   <li id="fifth-li"></li>
  6444. +   <li id="sixth-li"></li>
  6445. +   <li id="seventh-li">  </li>
  6446. + </ol>
  6447. + <p id="paragraph">
  6448. +   <b id="p-b">hi</b> <em id="p-em">there</em>
  6449. +   <b id="p-b2">guy</b>
  6450. +   <input type="checkbox" id="checkbox-unchecked" />
  6451. +   <input type="checkbox" id="checkbox-disabled" disabled="" />
  6452. +   <input type="text" id="text-checked" checked="checked" />
  6453. +   <input type="hidden" />
  6454. +   <input type="hidden" disabled="disabled" />
  6455. +   <input type="checkbox" id="checkbox-checked" checked="checked" />
  6456. +   <input type="checkbox" id="checkbox-disabled-checked"
  6457. +          disabled="disabled" checked="checked" />
  6458. +   <fieldset id="fieldset" disabled="disabled">
  6459. +     <input type="checkbox" id="checkbox-fieldset-disabled" />
  6460. +     <input type="hidden" />
  6461. +   </fieldset>
  6462. + </p>
  6463. + <ol id="second-ol">
  6464. + </ol>
  6465. + <map name="dummymap">
  6466. +   <area shape="circle" coords="200,250,25" href="foo.html" id="area-href" />
  6467. +   <area shape="default" id="area-nohref" />
  6468. + </map>
  6469. +</div>
  6470. +<div id="foobar-div" foobar="ab bc
  6471. +cde"><span id="foobar-span"></span></div>
  6472. +</body></html>
  6473. 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
  6474. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml  1970-01-01 01:00:00.000000000 +0100
  6475. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/lang.xml 2014-11-19 15:54:01.384099947 +0100
  6476. @@ -0,0 +1,11 @@
  6477. +<test>
  6478. +  <a id="first" xml:lang="en">a</a>
  6479. +  <b id="second" xml:lang="en-US">b</b>
  6480. +  <c id="third" xml:lang="en-Nz">c</c>
  6481. +  <d id="fourth" xml:lang="En-us">d</d>
  6482. +  <e id="fifth" xml:lang="fr">e</e>
  6483. +  <f id="sixth" xml:lang="ru">f</f>
  6484. +  <g id="seventh" xml:lang="de">
  6485. +    <h id="eighth" xml:lang="zh"/>
  6486. +  </g>
  6487. +</test>
  6488. 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
  6489. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html   1970-01-01 01:00:00.000000000 +0100
  6490. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/Fixtures/shakespear.html  2014-11-19 15:54:01.604099948 +0100
  6491. @@ -0,0 +1,308 @@
  6492. +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  6493. +   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  6494. +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" debug="true">
  6495. +<head>
  6496. +   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6497. +</head>
  6498. +<body>
  6499. +   <div id="test">
  6500. +   <div class="dialog">
  6501. +   <h2>As You Like It</h2>
  6502. +   <div id="playwright">
  6503. +     by William Shakespeare
  6504. +   </div>
  6505. +   <div class="dialog scene thirdClass" id="scene1">
  6506. +     <h3>ACT I, SCENE III. A room in the palace.</h3>
  6507. +     <div class="dialog">
  6508. +     <div class="direction">Enter CELIA and ROSALIND</div>
  6509. +     </div>
  6510. +     <div id="speech1" class="character">CELIA</div>
  6511. +     <div class="dialog">
  6512. +     <div id="scene1.3.1">Why, cousin! why, Rosalind! Cupid have mercy! not a word?</div>
  6513. +     </div>
  6514. +     <div id="speech2" class="character">ROSALIND</div>
  6515. +     <div class="dialog">
  6516. +     <div id="scene1.3.2">Not one to throw at a dog.</div>
  6517. +     </div>
  6518. +     <div id="speech3" class="character">CELIA</div>
  6519. +     <div class="dialog">
  6520. +     <div id="scene1.3.3">No, thy words are too precious to be cast away upon</div>
  6521. +     <div id="scene1.3.4">curs; throw some of them at me; come, lame me with reasons.</div>
  6522. +     </div>
  6523. +     <div id="speech4" class="character">ROSALIND</div>
  6524. +     <div id="speech5" class="character">CELIA</div>
  6525. +     <div class="dialog">
  6526. +     <div id="scene1.3.8">But is all this for your father?</div>
  6527. +     </div>
  6528. +     <div class="dialog">
  6529. +     <div id="scene1.3.5">Then there were two cousins laid up; when the one</div>
  6530. +     <div id="scene1.3.6">should be lamed with reasons and the other mad</div>
  6531. +     <div id="scene1.3.7">without any.</div>
  6532. +     </div>
  6533. +     <div id="speech6" class="character">ROSALIND</div>
  6534. +     <div class="dialog">
  6535. +     <div id="scene1.3.9">No, some of it is for my child's father. O, how</div>
  6536. +     <div id="scene1.3.10">full of briers is this working-day world!</div>
  6537. +     </div>
  6538. +     <div id="speech7" class="character">CELIA</div>
  6539. +     <div class="dialog">
  6540. +     <div id="scene1.3.11">They are but burs, cousin, thrown upon thee in</div>
  6541. +     <div id="scene1.3.12">holiday foolery: if we walk not in the trodden</div>
  6542. +     <div id="scene1.3.13">paths our very petticoats will catch them.</div>
  6543. +     </div>
  6544. +     <div id="speech8" class="character">ROSALIND</div>
  6545. +     <div class="dialog">
  6546. +     <div id="scene1.3.14">I could shake them off my coat: these burs are in my heart.</div>
  6547. +     </div>
  6548. +     <div id="speech9" class="character">CELIA</div>
  6549. +     <div class="dialog">
  6550. +     <div id="scene1.3.15">Hem them away.</div>
  6551. +     </div>
  6552. +     <div id="speech10" class="character">ROSALIND</div>
  6553. +     <div class="dialog">
  6554. +     <div id="scene1.3.16">I would try, if I could cry 'hem' and have him.</div>
  6555. +     </div>
  6556. +     <div id="speech11" class="character">CELIA</div>
  6557. +     <div class="dialog">
  6558. +     <div id="scene1.3.17">Come, come, wrestle with thy affections.</div>
  6559. +     </div>
  6560. +     <div id="speech12" class="character">ROSALIND</div>
  6561. +     <div class="dialog">
  6562. +     <div id="scene1.3.18">O, they take the part of a better wrestler than myself!</div>
  6563. +     </div>
  6564. +     <div id="speech13" class="character">CELIA</div>
  6565. +     <div class="dialog">
  6566. +     <div id="scene1.3.19">O, a good wish upon you! you will try in time, in</div>
  6567. +     <div id="scene1.3.20">despite of a fall. But, turning these jests out of</div>
  6568. +     <div id="scene1.3.21">service, let us talk in good earnest: is it</div>
  6569. +     <div id="scene1.3.22">possible, on such a sudden, you should fall into so</div>
  6570. +     <div id="scene1.3.23">strong a liking with old Sir Rowland's youngest son?</div>
  6571. +     </div>
  6572. +     <div id="speech14" class="character">ROSALIND</div>
  6573. +     <div class="dialog">
  6574. +     <div id="scene1.3.24">The duke my father loved his father dearly.</div>
  6575. +     </div>
  6576. +     <div id="speech15" class="character">CELIA</div>
  6577. +     <div class="dialog">
  6578. +     <div id="scene1.3.25">Doth it therefore ensue that you should love his son</div>
  6579. +     <div id="scene1.3.26">dearly? By this kind of chase, I should hate him,</div>
  6580. +     <div id="scene1.3.27">for my father hated his father dearly; yet I hate</div>
  6581. +     <div id="scene1.3.28">not Orlando.</div>
  6582. +     </div>
  6583. +     <div id="speech16" class="character">ROSALIND</div>
  6584. +     <div title="wtf" class="dialog">
  6585. +     <div id="scene1.3.29">No, faith, hate him not, for my sake.</div>
  6586. +     </div>
  6587. +     <div id="speech17" class="character">CELIA</div>
  6588. +     <div class="dialog">
  6589. +     <div id="scene1.3.30">Why should I not? doth he not deserve well?</div>
  6590. +     </div>
  6591. +     <div id="speech18" class="character">ROSALIND</div>
  6592. +     <div class="dialog">
  6593. +     <div id="scene1.3.31">Let me love him for that, and do you love him</div>
  6594. +     <div id="scene1.3.32">because I do. Look, here comes the duke.</div>
  6595. +     </div>
  6596. +     <div id="speech19" class="character">CELIA</div>
  6597. +     <div class="dialog">
  6598. +     <div id="scene1.3.33">With his eyes full of anger.</div>
  6599. +     <div class="direction">Enter DUKE FREDERICK, with Lords</div>
  6600. +     </div>
  6601. +     <div id="speech20" class="character">DUKE FREDERICK</div>
  6602. +     <div class="dialog">
  6603. +     <div id="scene1.3.34">Mistress, dispatch you with your safest haste</div>
  6604. +     <div id="scene1.3.35">And get you from our court.</div>
  6605. +     </div>
  6606. +     <div id="speech21" class="character">ROSALIND</div>
  6607. +     <div class="dialog">
  6608. +     <div id="scene1.3.36">Me, uncle?</div>
  6609. +     </div>
  6610. +     <div id="speech22" class="character">DUKE FREDERICK</div>
  6611. +     <div class="dialog">
  6612. +     <div id="scene1.3.37">You, cousin</div>
  6613. +     <div id="scene1.3.38">Within these ten days if that thou be'st found</div>
  6614. +     <div id="scene1.3.39">So near our public court as twenty miles,</div>
  6615. +     <div id="scene1.3.40">Thou diest for it.</div>
  6616. +     </div>
  6617. +     <div id="speech23" class="character">ROSALIND</div>
  6618. +     <div class="dialog">
  6619. +     <div id="scene1.3.41">                  I do beseech your grace,</div>
  6620. +     <div id="scene1.3.42">Let me the knowledge of my fault bear with me:</div>
  6621. +     <div id="scene1.3.43">If with myself I hold intelligence</div>
  6622. +     <div id="scene1.3.44">Or have acquaintance with mine own desires,</div>
  6623. +     <div id="scene1.3.45">If that I do not dream or be not frantic,--</div>
  6624. +     <div id="scene1.3.46">As I do trust I am not--then, dear uncle,</div>
  6625. +     <div id="scene1.3.47">Never so much as in a thought unborn</div>
  6626. +     <div id="scene1.3.48">Did I offend your highness.</div>
  6627. +     </div>
  6628. +     <div id="speech24" class="character">DUKE FREDERICK</div>
  6629. +     <div class="dialog">
  6630. +     <div id="scene1.3.49">Thus do all traitors:</div>
  6631. +     <div id="scene1.3.50">If their purgation did consist in words,</div>
  6632. +     <div id="scene1.3.51">They are as innocent as grace itself:</div>
  6633. +     <div id="scene1.3.52">Let it suffice thee that I trust thee not.</div>
  6634. +     </div>
  6635. +     <div id="speech25" class="character">ROSALIND</div>
  6636. +     <div class="dialog">
  6637. +     <div id="scene1.3.53">Yet your mistrust cannot make me a traitor:</div>
  6638. +     <div id="scene1.3.54">Tell me whereon the likelihood depends.</div>
  6639. +     </div>
  6640. +     <div id="speech26" class="character">DUKE FREDERICK</div>
  6641. +     <div class="dialog">
  6642. +     <div id="scene1.3.55">Thou art thy father's daughter; there's enough.</div>
  6643. +     </div>
  6644. +     <div id="speech27" class="character">ROSALIND</div>
  6645. +     <div class="dialog">
  6646. +     <div id="scene1.3.56">So was I when your highness took his dukedom;</div>
  6647. +     <div id="scene1.3.57">So was I when your highness banish'd him:</div>
  6648. +     <div id="scene1.3.58">Treason is not inherited, my lord;</div>
  6649. +     <div id="scene1.3.59">Or, if we did derive it from our friends,</div>
  6650. +     <div id="scene1.3.60">What's that to me? my father was no traitor:</div>
  6651. +     <div id="scene1.3.61">Then, good my liege, mistake me not so much</div>
  6652. +     <div id="scene1.3.62">To think my poverty is treacherous.</div>
  6653. +     </div>
  6654. +     <div id="speech28" class="character">CELIA</div>
  6655. +     <div class="dialog">
  6656. +     <div id="scene1.3.63">Dear sovereign, hear me speak.</div>
  6657. +     </div>
  6658. +     <div id="speech29" class="character">DUKE FREDERICK</div>
  6659. +     <div class="dialog">
  6660. +     <div id="scene1.3.64">Ay, Celia; we stay'd her for your sake,</div>
  6661. +     <div id="scene1.3.65">Else had she with her father ranged along.</div>
  6662. +     </div>
  6663. +     <div id="speech30" class="character">CELIA</div>
  6664. +     <div class="dialog">
  6665. +     <div id="scene1.3.66">I did not then entreat to have her stay;</div>
  6666. +     <div id="scene1.3.67">It was your pleasure and your own remorse:</div>
  6667. +     <div id="scene1.3.68">I was too young that time to value her;</div>
  6668. +     <div id="scene1.3.69">But now I know her: if she be a traitor,</div>
  6669. +     <div id="scene1.3.70">Why so am I; we still have slept together,</div>
  6670. +     <div id="scene1.3.71">Rose at an instant, learn'd, play'd, eat together,</div>
  6671. +     <div id="scene1.3.72">And wheresoever we went, like Juno's swans,</div>
  6672. +     <div id="scene1.3.73">Still we went coupled and inseparable.</div>
  6673. +     </div>
  6674. +     <div id="speech31" class="character">DUKE FREDERICK</div>
  6675. +     <div class="dialog">
  6676. +     <div id="scene1.3.74">She is too subtle for thee; and her smoothness,</div>
  6677. +     <div id="scene1.3.75">Her very silence and her patience</div>
  6678. +     <div id="scene1.3.76">Speak to the people, and they pity her.</div>
  6679. +     <div id="scene1.3.77">Thou art a fool: she robs thee of thy name;</div>
  6680. +     <div id="scene1.3.78">And thou wilt show more bright and seem more virtuous</div>
  6681. +     <div id="scene1.3.79">When she is gone. Then open not thy lips:</div>
  6682. +     <div id="scene1.3.80">Firm and irrevocable is my doom</div>
  6683. +     <div id="scene1.3.81">Which I have pass'd upon her; she is banish'd.</div>
  6684. +     </div>
  6685. +     <div id="speech32" class="character">CELIA</div>
  6686. +     <div class="dialog">
  6687. +     <div id="scene1.3.82">Pronounce that sentence then on me, my liege:</div>
  6688. +     <div id="scene1.3.83">I cannot live out of her company.</div>
  6689. +     </div>
  6690. +     <div id="speech33" class="character">DUKE FREDERICK</div>
  6691. +     <div class="dialog">
  6692. +     <div id="scene1.3.84">You are a fool. You, niece, provide yourself:</div>
  6693. +     <div id="scene1.3.85">If you outstay the time, upon mine honour,</div>
  6694. +     <div id="scene1.3.86">And in the greatness of my word, you die.</div>
  6695. +     <div class="direction">Exeunt DUKE FREDERICK and Lords</div>
  6696. +     </div>
  6697. +     <div id="speech34" class="character">CELIA</div>
  6698. +     <div class="dialog">
  6699. +     <div id="scene1.3.87">O my poor Rosalind, whither wilt thou go?</div>
  6700. +     <div id="scene1.3.88">Wilt thou change fathers? I will give thee mine.</div>
  6701. +     <div id="scene1.3.89">I charge thee, be not thou more grieved than I am.</div>
  6702. +     </div>
  6703. +     <div id="speech35" class="character">ROSALIND</div>
  6704. +     <div class="dialog">
  6705. +     <div id="scene1.3.90">I have more cause.</div>
  6706. +     </div>
  6707. +     <div id="speech36" class="character">CELIA</div>
  6708. +     <div class="dialog">
  6709. +     <div id="scene1.3.91">                  Thou hast not, cousin;</div>
  6710. +     <div id="scene1.3.92">Prithee be cheerful: know'st thou not, the duke</div>
  6711. +     <div id="scene1.3.93">Hath banish'd me, his daughter?</div>
  6712. +     </div>
  6713. +     <div id="speech37" class="character">ROSALIND</div>
  6714. +     <div class="dialog">
  6715. +     <div id="scene1.3.94">That he hath not.</div>
  6716. +     </div>
  6717. +     <div id="speech38" class="character">CELIA</div>
  6718. +     <div class="dialog">
  6719. +     <div id="scene1.3.95">No, hath not? Rosalind lacks then the love</div>
  6720. +     <div id="scene1.3.96">Which teacheth thee that thou and I am one:</div>
  6721. +     <div id="scene1.3.97">Shall we be sunder'd? shall we part, sweet girl?</div>
  6722. +     <div id="scene1.3.98">No: let my father seek another heir.</div>
  6723. +     <div id="scene1.3.99">Therefore devise with me how we may fly,</div>
  6724. +     <div id="scene1.3.100">Whither to go and what to bear with us;</div>
  6725. +     <div id="scene1.3.101">And do not seek to take your change upon you,</div>
  6726. +     <div id="scene1.3.102">To bear your griefs yourself and leave me out;</div>
  6727. +     <div id="scene1.3.103">For, by this heaven, now at our sorrows pale,</div>
  6728. +     <div id="scene1.3.104">Say what thou canst, I'll go along with thee.</div>
  6729. +     </div>
  6730. +     <div id="speech39" class="character">ROSALIND</div>
  6731. +     <div class="dialog">
  6732. +     <div id="scene1.3.105">Why, whither shall we go?</div>
  6733. +     </div>
  6734. +     <div id="speech40" class="character">CELIA</div>
  6735. +     <div class="dialog">
  6736. +     <div id="scene1.3.106">To seek my uncle in the forest of Arden.</div>
  6737. +     </div>
  6738. +     <div id="speech41" class="character">ROSALIND</div>
  6739. +     <div class="dialog">
  6740. +     <div id="scene1.3.107">Alas, what danger will it be to us,</div>
  6741. +     <div id="scene1.3.108">Maids as we are, to travel forth so far!</div>
  6742. +     <div id="scene1.3.109">Beauty provoketh thieves sooner than gold.</div>
  6743. +     </div>
  6744. +     <div id="speech42" class="character">CELIA</div>
  6745. +     <div class="dialog">
  6746. +     <div id="scene1.3.110">I'll put myself in poor and mean attire</div>
  6747. +     <div id="scene1.3.111">And with a kind of umber smirch my face;</div>
  6748. +     <div id="scene1.3.112">The like do you: so shall we pass along</div>
  6749. +     <div id="scene1.3.113">And never stir assailants.</div>
  6750. +     </div>
  6751. +     <div id="speech43" class="character">ROSALIND</div>
  6752. +     <div class="dialog">
  6753. +     <div id="scene1.3.114">Were it not better,</div>
  6754. +     <div id="scene1.3.115">Because that I am more than common tall,</div>
  6755. +     <div id="scene1.3.116">That I did suit me all points like a man?</div>
  6756. +     <div id="scene1.3.117">A gallant curtle-axe upon my thigh,</div>
  6757. +     <div id="scene1.3.118">A boar-spear in my hand; and--in my heart</div>
  6758. +     <div id="scene1.3.119">Lie there what hidden woman's fear there will--</div>
  6759. +     <div id="scene1.3.120">We'll have a swashing and a martial outside,</div>
  6760. +     <div id="scene1.3.121">As many other mannish cowards have</div>
  6761. +     <div id="scene1.3.122">That do outface it with their semblances.</div>
  6762. +     </div>
  6763. +     <div id="speech44" class="character">CELIA</div>
  6764. +     <div class="dialog">
  6765. +     <div id="scene1.3.123">What shall I call thee when thou art a man?</div>
  6766. +     </div>
  6767. +     <div id="speech45" class="character">ROSALIND</div>
  6768. +     <div class="dialog">
  6769. +     <div id="scene1.3.124">I'll have no worse a name than Jove's own page;</div>
  6770. +     <div id="scene1.3.125">And therefore look you call me Ganymede.</div>
  6771. +     <div id="scene1.3.126">But what will you be call'd?</div>
  6772. +     </div>
  6773. +     <div id="speech46" class="character">CELIA</div>
  6774. +     <div class="dialog">
  6775. +     <div id="scene1.3.127">Something that hath a reference to my state</div>
  6776. +     <div id="scene1.3.128">No longer Celia, but Aliena.</div>
  6777. +     </div>
  6778. +     <div id="speech47" class="character">ROSALIND</div>
  6779. +     <div class="dialog">
  6780. +     <div id="scene1.3.129">But, cousin, what if we assay'd to steal</div>
  6781. +     <div id="scene1.3.130">The clownish fool out of your father's court?</div>
  6782. +     <div id="scene1.3.131">Would he not be a comfort to our travel?</div>
  6783. +     </div>
  6784. +     <div id="speech48" class="character">CELIA</div>
  6785. +     <div class="dialog">
  6786. +     <div id="scene1.3.132">He'll go along o'er the wide world with me;</div>
  6787. +     <div id="scene1.3.133">Leave me alone to woo him. Let's away,</div>
  6788. +     <div id="scene1.3.134">And get our jewels and our wealth together,</div>
  6789. +     <div id="scene1.3.135">Devise the fittest time and safest way</div>
  6790. +     <div id="scene1.3.136">To hide us from pursuit that will be made</div>
  6791. +     <div id="scene1.3.137">After my flight. Now go we in content</div>
  6792. +     <div id="scene1.3.138">To liberty and not to banishment.</div>
  6793. +     <div class="direction">Exeunt</div>
  6794. +     </div>
  6795. +   </div>
  6796. +   </div>
  6797. +</div>
  6798. +</body>
  6799. +</html>
  6800. 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
  6801. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php 1970-01-01 01:00:00.000000000 +0100
  6802. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php    2014-11-19 15:54:01.808099949 +0100
  6803. @@ -0,0 +1,324 @@
  6804. +<?php
  6805. +
  6806. +/*
  6807. + * This file is part of the Symfony package.
  6808. + *
  6809. + * (c) Fabien Potencier <fabien@symfony.com>
  6810. + *
  6811. + * For the full copyright and license information, please view the LICENSE
  6812. + * file that was distributed with this source code.
  6813. + */
  6814. +
  6815. +namespace Symfony\Component\CssSelector\Tests\XPath;
  6816. +
  6817. +use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension;
  6818. +use Symfony\Component\CssSelector\XPath\Translator;
  6819. +
  6820. +class TranslatorTest extends \PHPUnit_Framework_TestCase
  6821. +{
  6822. +    /** @dataProvider getXpathLiteralTestData */
  6823. +    public function testXpathLiteral($value, $literal)
  6824. +    {
  6825. +        $this->assertEquals($literal, Translator::getXpathLiteral($value));
  6826. +    }
  6827. +
  6828. +    /** @dataProvider getCssToXPathTestData */
  6829. +    public function testCssToXPath($css, $xpath)
  6830. +    {
  6831. +        $translator = new Translator();
  6832. +        $translator->registerExtension(new HtmlExtension($translator));
  6833. +        $this->assertEquals($xpath, $translator->cssToXPath($css, ''));
  6834. +    }
  6835. +
  6836. +    /** @dataProvider getXmlLangTestData */
  6837. +    public function testXmlLang($css, array $elementsId)
  6838. +    {
  6839. +        $translator = new Translator();
  6840. +        $document = new \SimpleXMLElement(file_get_contents(__DIR__.'/Fixtures/lang.xml'));
  6841. +        $elements = $document->xpath($translator->cssToXPath($css));
  6842. +        $this->assertEquals(count($elementsId), count($elements));
  6843. +        foreach ($elements as $element) {
  6844. +            $this->assertTrue(in_array($element->attributes()->id, $elementsId));
  6845. +        }
  6846. +    }
  6847. +
  6848. +    /** @dataProvider getHtmlIdsTestData */
  6849. +    public function testHtmlIds($css, array $elementsId)
  6850. +    {
  6851. +        $translator = new Translator();
  6852. +        $translator->registerExtension(new HtmlExtension($translator));
  6853. +        $document = new \DOMDocument();
  6854. +        $document->strictErrorChecking = false;
  6855. +        $internalErrors = libxml_use_internal_errors(true);
  6856. +        $document->loadHTMLFile(__DIR__.'/Fixtures/ids.html');
  6857. +        $document = simplexml_import_dom($document);
  6858. +        $elements = $document->xpath($translator->cssToXPath($css));
  6859. +        $this->assertCount(count($elementsId), $elementsId);
  6860. +        foreach ($elements as $element) {
  6861. +            if (null !== $element->attributes()->id) {
  6862. +                $this->assertTrue(in_array($element->attributes()->id, $elementsId));
  6863. +            }
  6864. +        }
  6865. +        libxml_clear_errors();
  6866. +        libxml_use_internal_errors($internalErrors);
  6867. +    }
  6868. +
  6869. +    /** @dataProvider getHtmlShakespearTestData */
  6870. +    public function testHtmlShakespear($css, $count)
  6871. +    {
  6872. +        $translator = new Translator();
  6873. +        $translator->registerExtension(new HtmlExtension($translator));
  6874. +        $document = new \DOMDocument();
  6875. +        $document->strictErrorChecking = false;
  6876. +        $document->loadHTMLFile(__DIR__.'/Fixtures/shakespear.html');
  6877. +        $document = simplexml_import_dom($document);
  6878. +        $bodies = $document->xpath('//body');
  6879. +        $elements = $bodies[0]->xpath($translator->cssToXPath($css));
  6880. +        $this->assertEquals($count, count($elements));
  6881. +    }
  6882. +
  6883. +    public function getXpathLiteralTestData()
  6884. +    {
  6885. +        return array(
  6886. +            array('foo', "'foo'"),
  6887. +            array("foo's bar", '"foo\'s bar"'),
  6888. +            array("foo's \"middle\" bar", 'concat(\'foo\', "\'", \'s "middle" bar\')'),
  6889. +            array("foo's 'middle' \"bar\"", 'concat(\'foo\', "\'", \'s \', "\'", \'middle\', "\'", \' "bar"\')'),
  6890. +        );
  6891. +    }
  6892. +
  6893. +    public function getCssToXPathTestData()
  6894. +    {
  6895. +        return array(
  6896. +            array('*', "*"),
  6897. +            array('e', "e"),
  6898. +            array('*|e', "e"),
  6899. +            array('e|f', "e:f"),
  6900. +            array('e[foo]', "e[@foo]"),
  6901. +            array('e[foo|bar]', "e[@foo:bar]"),
  6902. +            array('e[foo="bar"]', "e[@foo = 'bar']"),
  6903. +            array('e[foo~="bar"]', "e[@foo and contains(concat(' ', normalize-space(@foo), ' '), ' bar ')]"),
  6904. +            array('e[foo^="bar"]', "e[@foo and starts-with(@foo, 'bar')]"),
  6905. +            array('e[foo$="bar"]', "e[@foo and substring(@foo, string-length(@foo)-2) = 'bar']"),
  6906. +            array('e[foo*="bar"]', "e[@foo and contains(@foo, 'bar')]"),
  6907. +            array('e[hreflang|="en"]', "e[@hreflang and (@hreflang = 'en' or starts-with(@hreflang, 'en-'))]"),
  6908. +            array('e:nth-child(1)', "*/*[name() = 'e' and (position() = 1)]"),
  6909. +            array('e:nth-last-child(1)', "*/*[name() = 'e' and (position() = last() - 0)]"),
  6910. +            array('e:nth-last-child(2n+2)', "*/*[name() = 'e' and (last() - position() - 1 >= 0 and (last() - position() - 1) mod 2 = 0)]"),
  6911. +            array('e:nth-of-type(1)', "*/e[position() = 1]"),
  6912. +            array('e:nth-last-of-type(1)', "*/e[position() = last() - 0]"),
  6913. +            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 ')]"),
  6914. +            array('e:first-child', "*/*[name() = 'e' and (position() = 1)]"),
  6915. +            array('e:last-child', "*/*[name() = 'e' and (position() = last())]"),
  6916. +            array('e:first-of-type', "*/e[position() = 1]"),
  6917. +            array('e:last-of-type', "*/e[position() = last()]"),
  6918. +            array('e:only-child', "*/*[name() = 'e' and (last() = 1)]"),
  6919. +            array('e:only-of-type', "e[last() = 1]"),
  6920. +            array('e:empty', "e[not(*) and not(string-length())]"),
  6921. +            array('e:EmPTY', "e[not(*) and not(string-length())]"),
  6922. +            array('e:root', "e[not(parent::*)]"),
  6923. +            array('e:hover', "e[0]"),
  6924. +            array('e:contains("foo")', "e[contains(string(.), 'foo')]"),
  6925. +            array('e:ConTains(foo)', "e[contains(string(.), 'foo')]"),
  6926. +            array('e.warning', "e[@class and contains(concat(' ', normalize-space(@class), ' '), ' warning ')]"),
  6927. +            array('e#myid', "e[@id = 'myid']"),
  6928. +            array('e:not(:nth-child(odd))', "e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]"),
  6929. +            array('e:nOT(*)', "e[0]"),
  6930. +            array('e f', "e/descendant-or-self::*/f"),
  6931. +            array('e > f', "e/f"),
  6932. +            array('e + f', "e/following-sibling::*[name() = 'f' and (position() = 1)]"),
  6933. +            array('e ~ f', "e/following-sibling::f"),
  6934. +            array('div#container p', "div[@id = 'container']/descendant-or-self::*/p"),
  6935. +        );
  6936. +    }
  6937. +
  6938. +    public function getXmlLangTestData()
  6939. +    {
  6940. +        return array(
  6941. +            array(':lang("EN")', array('first', 'second', 'third', 'fourth')),
  6942. +            array(':lang("en-us")', array('second', 'fourth')),
  6943. +            array(':lang(en-nz)', array('third')),
  6944. +            array(':lang(fr)', array('fifth')),
  6945. +            array(':lang(ru)', array('sixth')),
  6946. +            array(":lang('ZH')", array('eighth')),
  6947. +            array(':lang(de) :lang(zh)', array('eighth')),
  6948. +            array(':lang(en), :lang(zh)', array('first', 'second', 'third', 'fourth', 'eighth')),
  6949. +            array(':lang(es)', array()),
  6950. +        );
  6951. +    }
  6952. +
  6953. +    public function getHtmlIdsTestData()
  6954. +    {
  6955. +        return array(
  6956. +            array('div', array('outer-div', 'li-div', 'foobar-div')),
  6957. +            array('DIV', array('outer-div', 'li-div', 'foobar-div')),  // case-insensitive in HTML
  6958. +            array('div div', array('li-div')),
  6959. +            array('div, div div', array('outer-div', 'li-div', 'foobar-div')),
  6960. +            array('a[name]', array('name-anchor')),
  6961. +            array('a[NAme]', array('name-anchor')), // case-insensitive in HTML:
  6962. +            array('a[rel]', array('tag-anchor', 'nofollow-anchor')),
  6963. +            array('a[rel="tag"]', array('tag-anchor')),
  6964. +            array('a[href*="localhost"]', array('tag-anchor')),
  6965. +            array('a[href*=""]', array()),
  6966. +            array('a[href^="http"]', array('tag-anchor', 'nofollow-anchor')),
  6967. +            array('a[href^="http:"]', array('tag-anchor')),
  6968. +            array('a[href^=""]', array()),
  6969. +            array('a[href$="org"]', array('nofollow-anchor')),
  6970. +            array('a[href$=""]', array()),
  6971. +            array('div[foobar~="bc"]', array('foobar-div')),
  6972. +            array('div[foobar~="cde"]', array('foobar-div')),
  6973. +            array('[foobar~="ab bc"]', array('foobar-div')),
  6974. +            array('[foobar~=""]', array()),
  6975. +            array('[foobar~=" \t"]', array()),
  6976. +            array('div[foobar~="cd"]', array()),
  6977. +            array('*[lang|="En"]', array('second-li')),
  6978. +            array('[lang|="En-us"]', array('second-li')),
  6979. +            // Attribute values are case sensitive
  6980. +            array('*[lang|="en"]', array()),
  6981. +            array('[lang|="en-US"]', array()),
  6982. +            array('*[lang|="e"]', array()),
  6983. +            // ... :lang() is not.
  6984. +            array(':lang("EN")', array('second-li', 'li-div')),
  6985. +            array('*:lang(en-US)', array('second-li', 'li-div')),
  6986. +            array(':lang("e")', array()),
  6987. +            array('li:nth-child(3)', array('third-li')),
  6988. +            array('li:nth-child(10)', array()),
  6989. +            array('li:nth-child(2n)', array('second-li', 'fourth-li', 'sixth-li')),
  6990. +            array('li:nth-child(even)', array('second-li', 'fourth-li', 'sixth-li')),
  6991. +            array('li:nth-child(2n+0)', array('second-li', 'fourth-li', 'sixth-li')),
  6992. +            array('li:nth-child(+2n+1)', array('first-li', 'third-li', 'fifth-li', 'seventh-li')),
  6993. +            array('li:nth-child(odd)', array('first-li', 'third-li', 'fifth-li', 'seventh-li')),
  6994. +            array('li:nth-child(2n+4)', array('fourth-li', 'sixth-li')),
  6995. +            array('li:nth-child(3n+1)', array('first-li', 'fourth-li', 'seventh-li')),
  6996. +            array('li:nth-child(n)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
  6997. +            array('li:nth-child(n-1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
  6998. +            array('li:nth-child(n+1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
  6999. +            array('li:nth-child(n+3)', array('third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
  7000. +            array('li:nth-child(-n)', array()),
  7001. +            array('li:nth-child(-n-1)', array()),
  7002. +            array('li:nth-child(-n+1)', array('first-li')),
  7003. +            array('li:nth-child(-n+3)', array('first-li', 'second-li', 'third-li')),
  7004. +            array('li:nth-last-child(0)', array()),
  7005. +            array('li:nth-last-child(2n)', array('second-li', 'fourth-li', 'sixth-li')),
  7006. +            array('li:nth-last-child(even)', array('second-li', 'fourth-li', 'sixth-li')),
  7007. +            array('li:nth-last-child(2n+2)', array('second-li', 'fourth-li', 'sixth-li')),
  7008. +            array('li:nth-last-child(n)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
  7009. +            array('li:nth-last-child(n-1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
  7010. +            array('li:nth-last-child(n-3)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
  7011. +            array('li:nth-last-child(n+1)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li', 'sixth-li', 'seventh-li')),
  7012. +            array('li:nth-last-child(n+3)', array('first-li', 'second-li', 'third-li', 'fourth-li', 'fifth-li')),
  7013. +            array('li:nth-last-child(-n)', array()),
  7014. +            array('li:nth-last-child(-n-1)', array()),
  7015. +            array('li:nth-last-child(-n+1)', array('seventh-li')),
  7016. +            array('li:nth-last-child(-n+3)', array('fifth-li', 'sixth-li', 'seventh-li')),
  7017. +            array('ol:first-of-type', array('first-ol')),
  7018. +            array('ol:nth-child(1)', array('first-ol')),
  7019. +            array('ol:nth-of-type(2)', array('second-ol')),
  7020. +            array('ol:nth-last-of-type(1)', array('second-ol')),
  7021. +            array('span:only-child', array('foobar-span')),
  7022. +            array('li div:only-child', array('li-div')),
  7023. +            array('div *:only-child', array('li-div', 'foobar-span')),
  7024. +            array('p:only-of-type', array('paragraph')),
  7025. +            array('a:empty', array('name-anchor')),
  7026. +            array('a:EMpty', array('name-anchor')),
  7027. +            array('li:empty', array('third-li', 'fourth-li', 'fifth-li', 'sixth-li')),
  7028. +            array(':root', array('html')),
  7029. +            array('html:root', array('html')),
  7030. +            array('li:root', array()),
  7031. +            array('* :root', array()),
  7032. +            array('*:contains("link")', array('html', 'outer-div', 'tag-anchor', 'nofollow-anchor')),
  7033. +            array(':CONtains("link")', array('html', 'outer-div', 'tag-anchor', 'nofollow-anchor')),
  7034. +            array('*:contains("LInk")', array()),  // case sensitive
  7035. +            array('*:contains("e")', array('html', 'nil', 'outer-div', 'first-ol', 'first-li', 'paragraph', 'p-em')),
  7036. +            array('*:contains("E")', array()),  // case-sensitive
  7037. +            array('.a', array('first-ol')),
  7038. +            array('.b', array('first-ol')),
  7039. +            array('*.a', array('first-ol')),
  7040. +            array('ol.a', array('first-ol')),
  7041. +            array('.c', array('first-ol', 'third-li', 'fourth-li')),
  7042. +            array('*.c', array('first-ol', 'third-li', 'fourth-li')),
  7043. +            array('ol *.c', array('third-li', 'fourth-li')),
  7044. +            array('ol li.c', array('third-li', 'fourth-li')),
  7045. +            array('li ~ li.c', array('third-li', 'fourth-li')),
  7046. +            array('ol > li.c', array('third-li', 'fourth-li')),
  7047. +            array('#first-li', array('first-li')),
  7048. +            array('li#first-li', array('first-li')),
  7049. +            array('*#first-li', array('first-li')),
  7050. +            array('li div', array('li-div')),
  7051. +            array('li > div', array('li-div')),
  7052. +            array('div div', array('li-div')),
  7053. +            array('div > div', array()),
  7054. +            array('div>.c', array('first-ol')),
  7055. +            array('div > .c', array('first-ol')),
  7056. +            array('div + div', array('foobar-div')),
  7057. +            array('a ~ a', array('tag-anchor', 'nofollow-anchor')),
  7058. +            array('a[rel="tag"] ~ a', array('nofollow-anchor')),
  7059. +            array('ol#first-ol li:last-child', array('seventh-li')),
  7060. +            array('ol#first-ol *:last-child', array('li-div', 'seventh-li')),
  7061. +            array('#outer-div:first-child', array('outer-div')),
  7062. +            array('#outer-div :first-child', array('name-anchor', 'first-li', 'li-div', 'p-b', 'checkbox-fieldset-disabled', 'area-href')),
  7063. +            array('a[href]', array('tag-anchor', 'nofollow-anchor')),
  7064. +            array(':not(*)', array()),
  7065. +            array('a:not([href])', array('name-anchor')),
  7066. +            array('ol :Not(li[class])', array('first-li', 'second-li', 'li-div', 'fifth-li', 'sixth-li', 'seventh-li')),
  7067. +            // HTML-specific
  7068. +            array(':link', array('link-href', 'tag-anchor', 'nofollow-anchor', 'area-href')),
  7069. +            array(':visited', array()),
  7070. +            array(':enabled', array('link-href', 'tag-anchor', 'nofollow-anchor', 'checkbox-unchecked', 'text-checked', 'checkbox-checked', 'area-href')),
  7071. +            array(':disabled', array('checkbox-disabled', 'checkbox-disabled-checked', 'fieldset', 'checkbox-fieldset-disabled')),
  7072. +            array(':checked', array('checkbox-checked', 'checkbox-disabled-checked')),
  7073. +        );
  7074. +    }
  7075. +
  7076. +    public function getHtmlShakespearTestData()
  7077. +    {
  7078. +        return array(
  7079. +            array('*', 246),
  7080. +            array('div:contains(CELIA)', 26),
  7081. +            array('div:only-child', 22), // ?
  7082. +            array('div:nth-child(even)', 106),
  7083. +            array('div:nth-child(2n)', 106),
  7084. +            array('div:nth-child(odd)', 137),
  7085. +            array('div:nth-child(2n+1)', 137),
  7086. +            array('div:nth-child(n)', 243),
  7087. +            array('div:last-child', 53),
  7088. +            array('div:first-child', 51),
  7089. +            array('div > div', 242),
  7090. +            array('div + div', 190),
  7091. +            array('div ~ div', 190),
  7092. +            array('body', 1),
  7093. +            array('body div', 243),
  7094. +            array('div', 243),
  7095. +            array('div div', 242),
  7096. +            array('div div div', 241),
  7097. +            array('div, div, div', 243),
  7098. +            array('div, a, span', 243),
  7099. +            array('.dialog', 51),
  7100. +            array('div.dialog', 51),
  7101. +            array('div .dialog', 51),
  7102. +            array('div.character, div.dialog', 99),
  7103. +            array('div.direction.dialog', 0),
  7104. +            array('div.dialog.direction', 0),
  7105. +            array('div.dialog.scene', 1),
  7106. +            array('div.scene.scene', 1),
  7107. +            array('div.scene .scene', 0),
  7108. +            array('div.direction .dialog ', 0),
  7109. +            array('div .dialog .direction', 4),
  7110. +            array('div.dialog .dialog .direction', 4),
  7111. +            array('#speech5', 1),
  7112. +            array('div#speech5', 1),
  7113. +            array('div #speech5', 1),
  7114. +            array('div.scene div.dialog', 49),
  7115. +            array('div#scene1 div.dialog div', 142),
  7116. +            array('#scene1 #speech1', 1),
  7117. +            array('div[class]', 103),
  7118. +            array('div[class=dialog]', 50),
  7119. +            array('div[class^=dia]', 51),
  7120. +            array('div[class$=log]', 50),
  7121. +            array('div[class*=sce]', 1),
  7122. +            array('div[class|=dialog]', 50), // ? Seems right
  7123. +            array('div[class!=madeup]', 243), // ? Seems right
  7124. +            array('div[class~=dialog]', 51), // ? Seems right
  7125. +        );
  7126. +    }
  7127. +}
  7128. 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
  7129. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php  1970-01-01 01:00:00.000000000 +0100
  7130. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AbstractExtension.php 2014-11-19 15:54:09.496099996 +0100
  7131. @@ -0,0 +1,63 @@
  7132. +<?php
  7133. +
  7134. +/*
  7135. + * This file is part of the Symfony package.
  7136. + *
  7137. + * (c) Fabien Potencier <fabien@symfony.com>
  7138. + *
  7139. + * For the full copyright and license information, please view the LICENSE
  7140. + * file that was distributed with this source code.
  7141. + */
  7142. +
  7143. +namespace Symfony\Component\CssSelector\XPath\Extension;
  7144. +
  7145. +/**
  7146. + * XPath expression translator abstract extension.
  7147. + *
  7148. + * This component is a port of the Python cssselector library,
  7149. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  7150. + *
  7151. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  7152. + */
  7153. +abstract class AbstractExtension implements ExtensionInterface
  7154. +{
  7155. +    /**
  7156. +     * {@inheritdoc}
  7157. +     */
  7158. +    public function getNodeTranslators()
  7159. +    {
  7160. +        return array();
  7161. +    }
  7162. +
  7163. +    /**
  7164. +     * {@inheritdoc}
  7165. +     */
  7166. +    public function getCombinationTranslators()
  7167. +    {
  7168. +        return array();
  7169. +    }
  7170. +
  7171. +    /**
  7172. +     * {@inheritdoc}
  7173. +     */
  7174. +    public function getFunctionTranslators()
  7175. +    {
  7176. +        return array();
  7177. +    }
  7178. +
  7179. +    /**
  7180. +     * {@inheritdoc}
  7181. +     */
  7182. +    public function getPseudoClassTranslators()
  7183. +    {
  7184. +        return array();
  7185. +    }
  7186. +
  7187. +    /**
  7188. +     * {@inheritdoc}
  7189. +     */
  7190. +    public function getAttributeMatchingTranslators()
  7191. +    {
  7192. +        return array();
  7193. +    }
  7194. +}
  7195. 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
  7196. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php 1970-01-01 01:00:00.000000000 +0100
  7197. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/AttributeMatchingExtension.php    2014-11-19 15:54:09.820099998 +0100
  7198. @@ -0,0 +1,173 @@
  7199. +<?php
  7200. +
  7201. +/*
  7202. + * This file is part of the Symfony package.
  7203. + *
  7204. + * (c) Fabien Potencier <fabien@symfony.com>
  7205. + *
  7206. + * For the full copyright and license information, please view the LICENSE
  7207. + * file that was distributed with this source code.
  7208. + */
  7209. +
  7210. +namespace Symfony\Component\CssSelector\XPath\Extension;
  7211. +
  7212. +use Symfony\Component\CssSelector\XPath\Translator;
  7213. +use Symfony\Component\CssSelector\XPath\XPathExpr;
  7214. +
  7215. +/**
  7216. + * XPath expression translator attribute extension.
  7217. + *
  7218. + * This component is a port of the Python cssselector library,
  7219. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  7220. + *
  7221. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  7222. + */
  7223. +class AttributeMatchingExtension extends AbstractExtension
  7224. +{
  7225. +    /**
  7226. +     * {@inheritdoc}
  7227. +     */
  7228. +    public function getAttributeMatchingTranslators()
  7229. +    {
  7230. +        return array(
  7231. +            'exists' => array($this, 'translateExists'),
  7232. +            '='      => array($this, 'translateEquals'),
  7233. +            '~='     => array($this, 'translateIncludes'),
  7234. +            '|='     => array($this, 'translateDashMatch'),
  7235. +            '^='     => array($this, 'translatePrefixMatch'),
  7236. +            '$='     => array($this, 'translateSuffixMatch'),
  7237. +            '*='     => array($this, 'translateSubstringMatch'),
  7238. +            '!='     => array($this, 'translateDifferent'),
  7239. +        );
  7240. +    }
  7241. +
  7242. +    /**
  7243. +     * @param XPathExpr $xpath
  7244. +     * @param string    $attribute
  7245. +     * @param string    $value
  7246. +     *
  7247. +     * @return XPathExpr
  7248. +     */
  7249. +    public function translateExists(XPathExpr $xpath, $attribute, $value)
  7250. +    {
  7251. +        return $xpath->addCondition($attribute);
  7252. +    }
  7253. +
  7254. +    /**
  7255. +     * @param XPathExpr $xpath
  7256. +     * @param string    $attribute
  7257. +     * @param string    $value
  7258. +     *
  7259. +     * @return XPathExpr
  7260. +     */
  7261. +    public function translateEquals(XPathExpr $xpath, $attribute, $value)
  7262. +    {
  7263. +        return $xpath->addCondition(sprintf('%s = %s', $attribute, Translator::getXpathLiteral($value)));
  7264. +    }
  7265. +
  7266. +    /**
  7267. +     * @param XPathExpr $xpath
  7268. +     * @param string    $attribute
  7269. +     * @param string    $value
  7270. +     *
  7271. +     * @return XPathExpr
  7272. +     */
  7273. +    public function translateIncludes(XPathExpr $xpath, $attribute, $value)
  7274. +    {
  7275. +        return $xpath->addCondition($value ? sprintf(
  7276. +            '%1$s and contains(concat(\' \', normalize-space(%1$s), \' \'), %2$s)',
  7277. +            $attribute,
  7278. +            Translator::getXpathLiteral(' '.$value.' ')
  7279. +        ) : '0');
  7280. +    }
  7281. +
  7282. +    /**
  7283. +     * @param XPathExpr $xpath
  7284. +     * @param string    $attribute
  7285. +     * @param string    $value
  7286. +     *
  7287. +     * @return XPathExpr
  7288. +     */
  7289. +    public function translateDashMatch(XPathExpr $xpath, $attribute, $value)
  7290. +    {
  7291. +        return $xpath->addCondition(sprintf(
  7292. +            '%1$s and (%1$s = %2$s or starts-with(%1$s, %3$s))',
  7293. +            $attribute,
  7294. +            Translator::getXpathLiteral($value),
  7295. +            Translator::getXpathLiteral($value.'-')
  7296. +        ));
  7297. +    }
  7298. +
  7299. +    /**
  7300. +     * @param XPathExpr $xpath
  7301. +     * @param string    $attribute
  7302. +     * @param string    $value
  7303. +     *
  7304. +     * @return XPathExpr
  7305. +     */
  7306. +    public function translatePrefixMatch(XPathExpr $xpath, $attribute, $value)
  7307. +    {
  7308. +        return $xpath->addCondition($value ? sprintf(
  7309. +            '%1$s and starts-with(%1$s, %2$s)',
  7310. +            $attribute,
  7311. +            Translator::getXpathLiteral($value)
  7312. +        ) : '0');
  7313. +    }
  7314. +
  7315. +    /**
  7316. +     * @param XPathExpr $xpath
  7317. +     * @param string    $attribute
  7318. +     * @param string    $value
  7319. +     *
  7320. +     * @return XPathExpr
  7321. +     */
  7322. +    public function translateSuffixMatch(XPathExpr $xpath, $attribute, $value)
  7323. +    {
  7324. +        return $xpath->addCondition($value ? sprintf(
  7325. +            '%1$s and substring(%1$s, string-length(%1$s)-%2$s) = %3$s',
  7326. +            $attribute,
  7327. +            strlen($value) - 1,
  7328. +            Translator::getXpathLiteral($value)
  7329. +        ) : '0');
  7330. +    }
  7331. +
  7332. +    /**
  7333. +     * @param XPathExpr $xpath
  7334. +     * @param string    $attribute
  7335. +     * @param string    $value
  7336. +     *
  7337. +     * @return XPathExpr
  7338. +     */
  7339. +    public function translateSubstringMatch(XPathExpr $xpath, $attribute, $value)
  7340. +    {
  7341. +        return $xpath->addCondition($value ? sprintf(
  7342. +            '%1$s and contains(%1$s, %2$s)',
  7343. +            $attribute,
  7344. +            Translator::getXpathLiteral($value)
  7345. +        ) : '0');
  7346. +    }
  7347. +
  7348. +    /**
  7349. +     * @param XPathExpr $xpath
  7350. +     * @param string    $attribute
  7351. +     * @param string    $value
  7352. +     *
  7353. +     * @return XPathExpr
  7354. +     */
  7355. +    public function translateDifferent(XPathExpr $xpath, $attribute, $value)
  7356. +    {
  7357. +        return $xpath->addCondition(sprintf(
  7358. +            $value ? 'not(%1$s) or %1$s != %2$s' : '%s != %s',
  7359. +            $attribute,
  7360. +            Translator::getXpathLiteral($value)
  7361. +        ));
  7362. +    }
  7363. +
  7364. +    /**
  7365. +     * {@inheritdoc}
  7366. +     */
  7367. +    public function getName()
  7368. +    {
  7369. +        return 'attribute-matching';
  7370. +    }
  7371. +}
  7372. 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
  7373. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php   1970-01-01 01:00:00.000000000 +0100
  7374. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/CombinationExtension.php  2014-11-19 15:54:08.852099992 +0100
  7375. @@ -0,0 +1,93 @@
  7376. +<?php
  7377. +
  7378. +/*
  7379. + * This file is part of the Symfony package.
  7380. + *
  7381. + * (c) Fabien Potencier <fabien@symfony.com>
  7382. + *
  7383. + * For the full copyright and license information, please view the LICENSE
  7384. + * file that was distributed with this source code.
  7385. + */
  7386. +
  7387. +namespace Symfony\Component\CssSelector\XPath\Extension;
  7388. +
  7389. +use Symfony\Component\CssSelector\XPath\XPathExpr;
  7390. +
  7391. +/**
  7392. + * XPath expression translator combination extension.
  7393. + *
  7394. + * This component is a port of the Python cssselector library,
  7395. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  7396. + *
  7397. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  7398. + */
  7399. +class CombinationExtension extends AbstractExtension
  7400. +{
  7401. +    /**
  7402. +     * {@inheritdoc}
  7403. +     */
  7404. +    public function getCombinationTranslators()
  7405. +    {
  7406. +        return array(
  7407. +            ' ' => array($this, 'translateDescendant'),
  7408. +            '>' => array($this, 'translateChild'),
  7409. +            '+' => array($this, 'translateDirectAdjacent'),
  7410. +            '~' => array($this, 'translateIndirectAdjacent'),
  7411. +        );
  7412. +    }
  7413. +
  7414. +    /**
  7415. +     * @param XPathExpr $xpath
  7416. +     * @param XPathExpr $combinedXpath
  7417. +     *
  7418. +     * @return XPathExpr
  7419. +     */
  7420. +    public function translateDescendant(XPathExpr $xpath, XPathExpr $combinedXpath)
  7421. +    {
  7422. +        return $xpath->join('/descendant-or-self::*/', $combinedXpath);
  7423. +    }
  7424. +
  7425. +    /**
  7426. +     * @param XPathExpr $xpath
  7427. +     * @param XPathExpr $combinedXpath
  7428. +     *
  7429. +     * @return XPathExpr
  7430. +     */
  7431. +    public function translateChild(XPathExpr $xpath, XPathExpr $combinedXpath)
  7432. +    {
  7433. +        return $xpath->join('/', $combinedXpath);
  7434. +    }
  7435. +
  7436. +    /**
  7437. +     * @param XPathExpr $xpath
  7438. +     * @param XPathExpr $combinedXpath
  7439. +     *
  7440. +     * @return XPathExpr
  7441. +     */
  7442. +    public function translateDirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath)
  7443. +    {
  7444. +        return $xpath
  7445. +            ->join('/following-sibling::', $combinedXpath)
  7446. +            ->addNameTest()
  7447. +            ->addCondition('position() = 1');
  7448. +    }
  7449. +
  7450. +    /**
  7451. +     * @param XPathExpr $xpath
  7452. +     * @param XPathExpr $combinedXpath
  7453. +     *
  7454. +     * @return XPathExpr
  7455. +     */
  7456. +    public function translateIndirectAdjacent(XPathExpr $xpath, XPathExpr $combinedXpath)
  7457. +    {
  7458. +        return $xpath->join('/following-sibling::', $combinedXpath);
  7459. +    }
  7460. +
  7461. +    /**
  7462. +     * {@inheritdoc}
  7463. +     */
  7464. +    public function getName()
  7465. +    {
  7466. +        return 'combination';
  7467. +    }
  7468. +}
  7469. 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
  7470. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php 1970-01-01 01:00:00.000000000 +0100
  7471. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/ExtensionInterface.php    2014-11-19 15:54:09.172099994 +0100
  7472. @@ -0,0 +1,67 @@
  7473. +<?php
  7474. +
  7475. +/*
  7476. + * This file is part of the Symfony package.
  7477. + *
  7478. + * (c) Fabien Potencier <fabien@symfony.com>
  7479. + *
  7480. + * For the full copyright and license information, please view the LICENSE
  7481. + * file that was distributed with this source code.
  7482. + */
  7483. +
  7484. +namespace Symfony\Component\CssSelector\XPath\Extension;
  7485. +
  7486. +/**
  7487. + * XPath expression translator extension interface.
  7488. + *
  7489. + * This component is a port of the Python cssselector library,
  7490. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  7491. + *
  7492. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  7493. + */
  7494. +interface ExtensionInterface
  7495. +{
  7496. +    /**
  7497. +     * Returns node translators.
  7498. +     *
  7499. +     * These callables will receive the node as first argument and the translator as second argument.
  7500. +     *
  7501. +     * @return callable[]
  7502. +     */
  7503. +    public function getNodeTranslators();
  7504. +
  7505. +    /**
  7506. +     * Returns combination translators.
  7507. +     *
  7508. +     * @return callable[]
  7509. +     */
  7510. +    public function getCombinationTranslators();
  7511. +
  7512. +    /**
  7513. +     * Returns function translators.
  7514. +     *
  7515. +     * @return callable[]
  7516. +     */
  7517. +    public function getFunctionTranslators();
  7518. +
  7519. +    /**
  7520. +     * Returns pseudo-class translators.
  7521. +     *
  7522. +     * @return callable[]
  7523. +     */
  7524. +    public function getPseudoClassTranslators();
  7525. +
  7526. +    /**
  7527. +     * Returns attribute operation translators.
  7528. +     *
  7529. +     * @return callable[]
  7530. +     */
  7531. +    public function getAttributeMatchingTranslators();
  7532. +
  7533. +    /**
  7534. +     * Returns extension name.
  7535. +     *
  7536. +     * @return string
  7537. +     */
  7538. +    public function getName();
  7539. +}
  7540. 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
  7541. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php  1970-01-01 01:00:00.000000000 +0100
  7542. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php 2014-11-19 15:54:08.692099991 +0100
  7543. @@ -0,0 +1,209 @@
  7544. +<?php
  7545. +
  7546. +/*
  7547. + * This file is part of the Symfony package.
  7548. + *
  7549. + * (c) Fabien Potencier <fabien@symfony.com>
  7550. + *
  7551. + * For the full copyright and license information, please view the LICENSE
  7552. + * file that was distributed with this source code.
  7553. + */
  7554. +
  7555. +namespace Symfony\Component\CssSelector\XPath\Extension;
  7556. +
  7557. +use Symfony\Component\CssSelector\Exception\ExpressionErrorException;
  7558. +use Symfony\Component\CssSelector\Exception\SyntaxErrorException;
  7559. +use Symfony\Component\CssSelector\Node\FunctionNode;
  7560. +use Symfony\Component\CssSelector\Parser\Parser;
  7561. +use Symfony\Component\CssSelector\XPath\Translator;
  7562. +use Symfony\Component\CssSelector\XPath\XPathExpr;
  7563. +
  7564. +/**
  7565. + * XPath expression translator function extension.
  7566. + *
  7567. + * This component is a port of the Python cssselector library,
  7568. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  7569. + *
  7570. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  7571. + */
  7572. +class FunctionExtension extends AbstractExtension
  7573. +{
  7574. +    /**
  7575. +     * {@inheritdoc}
  7576. +     */
  7577. +    public function getFunctionTranslators()
  7578. +    {
  7579. +        return array(
  7580. +            'nth-child'        => array($this, 'translateNthChild'),
  7581. +            'nth-last-child'   => array($this, 'translateNthLastChild'),
  7582. +            'nth-of-type'      => array($this, 'translateNthOfType'),
  7583. +            'nth-last-of-type' => array($this, 'translateNthLastOfType'),
  7584. +            'contains'         => array($this, 'translateContains'),
  7585. +            'lang'             => array($this, 'translateLang'),
  7586. +        );
  7587. +    }
  7588. +
  7589. +    /**
  7590. +     * @param XPathExpr    $xpath
  7591. +     * @param FunctionNode $function
  7592. +     * @param bool         $last
  7593. +     * @param bool         $addNameTest
  7594. +     *
  7595. +     * @return XPathExpr
  7596. +     *
  7597. +     * @throws ExpressionErrorException
  7598. +     */
  7599. +    public function translateNthChild(XPathExpr $xpath, FunctionNode $function, $last = false, $addNameTest = true)
  7600. +    {
  7601. +        try {
  7602. +            list($a, $b) = Parser::parseSeries($function->getArguments());
  7603. +        } catch (SyntaxErrorException $e) {
  7604. +            throw new ExpressionErrorException(sprintf('Invalid series: %s', implode(', ', $function->getArguments())), 0, $e);
  7605. +        }
  7606. +
  7607. +        $xpath->addStarPrefix();
  7608. +        if ($addNameTest) {
  7609. +            $xpath->addNameTest();
  7610. +        }
  7611. +
  7612. +        if (0 === $a) {
  7613. +            return $xpath->addCondition('position() = '.($last ? 'last() - '.($b - 1) : $b));
  7614. +        }
  7615. +
  7616. +        if ($a < 0) {
  7617. +            if ($b < 1) {
  7618. +                return $xpath->addCondition('false()');
  7619. +            }
  7620. +
  7621. +            $sign = '<=';
  7622. +        } else {
  7623. +            $sign = '>=';
  7624. +        }
  7625. +
  7626. +        $expr = 'position()';
  7627. +
  7628. +        if ($last) {
  7629. +            $expr = 'last() - '.$expr;
  7630. +            $b--;
  7631. +        }
  7632. +
  7633. +        if (0 !== $b) {
  7634. +            $expr .= ' - '.$b;
  7635. +        }
  7636. +
  7637. +        $conditions = array(sprintf('%s %s 0', $expr, $sign));
  7638. +
  7639. +        if (1 !== $a && -1 !== $a) {
  7640. +            $conditions[] = sprintf('(%s) mod %d = 0', $expr, $a);
  7641. +        }
  7642. +
  7643. +        return $xpath->addCondition(implode(' and ', $conditions));
  7644. +
  7645. +        // todo: handle an+b, odd, even
  7646. +        // an+b means every-a, plus b, e.g., 2n+1 means odd
  7647. +        // 0n+b means b
  7648. +        // n+0 means a=1, i.e., all elements
  7649. +        // an means every a elements, i.e., 2n means even
  7650. +        // -n means -1n
  7651. +        // -1n+6 means elements 6 and previous
  7652. +    }
  7653. +
  7654. +    /**
  7655. +     * @param XPathExpr    $xpath
  7656. +     * @param FunctionNode $function
  7657. +     *
  7658. +     * @return XPathExpr
  7659. +     */
  7660. +    public function translateNthLastChild(XPathExpr $xpath, FunctionNode $function)
  7661. +    {
  7662. +        return $this->translateNthChild($xpath, $function, true);
  7663. +    }
  7664. +
  7665. +    /**
  7666. +     * @param XPathExpr    $xpath
  7667. +     * @param FunctionNode $function
  7668. +     *
  7669. +     * @return XPathExpr
  7670. +     */
  7671. +    public function translateNthOfType(XPathExpr $xpath, FunctionNode $function)
  7672. +    {
  7673. +        return $this->translateNthChild($xpath, $function, false, false);
  7674. +    }
  7675. +
  7676. +    /**
  7677. +     * @param XPathExpr    $xpath
  7678. +     * @param FunctionNode $function
  7679. +     *
  7680. +     * @return XPathExpr
  7681. +     *
  7682. +     * @throws ExpressionErrorException
  7683. +     */
  7684. +    public function translateNthLastOfType(XPathExpr $xpath, FunctionNode $function)
  7685. +    {
  7686. +        if ('*' === $xpath->getElement()) {
  7687. +            throw new ExpressionErrorException('"*:nth-of-type()" is not implemented.');
  7688. +        }
  7689. +
  7690. +        return $this->translateNthChild($xpath, $function, true, false);
  7691. +    }
  7692. +
  7693. +    /**
  7694. +     * @param XPathExpr    $xpath
  7695. +     * @param FunctionNode $function
  7696. +     *
  7697. +     * @return XPathExpr
  7698. +     *
  7699. +     * @throws ExpressionErrorException
  7700. +     */
  7701. +    public function translateContains(XPathExpr $xpath, FunctionNode $function)
  7702. +    {
  7703. +        $arguments = $function->getArguments();
  7704. +        foreach ($arguments as $token) {
  7705. +            if (!($token->isString() || $token->isIdentifier())) {
  7706. +                throw new ExpressionErrorException(
  7707. +                    'Expected a single string or identifier for :contains(), got '
  7708. +                    .implode(', ', $arguments)
  7709. +                );
  7710. +            }
  7711. +        }
  7712. +
  7713. +        return $xpath->addCondition(sprintf(
  7714. +            'contains(string(.), %s)',
  7715. +            Translator::getXpathLiteral($arguments[0]->getValue())
  7716. +        ));
  7717. +    }
  7718. +
  7719. +    /**
  7720. +     * @param XPathExpr    $xpath
  7721. +     * @param FunctionNode $function
  7722. +     *
  7723. +     * @return XPathExpr
  7724. +     *
  7725. +     * @throws ExpressionErrorException
  7726. +     */
  7727. +    public function translateLang(XPathExpr $xpath, FunctionNode $function)
  7728. +    {
  7729. +        $arguments = $function->getArguments();
  7730. +        foreach ($arguments as $token) {
  7731. +            if (!($token->isString() || $token->isIdentifier())) {
  7732. +                throw new ExpressionErrorException(
  7733. +                    'Expected a single string or identifier for :lang(), got '
  7734. +                    .implode(', ', $arguments)
  7735. +                );
  7736. +            }
  7737. +        }
  7738. +
  7739. +        return $xpath->addCondition(sprintf(
  7740. +            'lang(%s)',
  7741. +            Translator::getXpathLiteral($arguments[0]->getValue())
  7742. +        ));
  7743. +    }
  7744. +
  7745. +    /**
  7746. +     * {@inheritdoc}
  7747. +     */
  7748. +    public function getName()
  7749. +    {
  7750. +        return 'function';
  7751. +    }
  7752. +}
  7753. 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
  7754. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php  1970-01-01 01:00:00.000000000 +0100
  7755. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php 2014-11-19 15:54:09.016099993 +0100
  7756. @@ -0,0 +1,238 @@
  7757. +<?php
  7758. +
  7759. +/*
  7760. + * This file is part of the Symfony package.
  7761. + *
  7762. + * (c) Fabien Potencier <fabien@symfony.com>
  7763. + *
  7764. + * For the full copyright and license information, please view the LICENSE
  7765. + * file that was distributed with this source code.
  7766. + */
  7767. +
  7768. +namespace Symfony\Component\CssSelector\XPath\Extension;
  7769. +
  7770. +use Symfony\Component\CssSelector\Exception\ExpressionErrorException;
  7771. +use Symfony\Component\CssSelector\Node\FunctionNode;
  7772. +use Symfony\Component\CssSelector\XPath\Translator;
  7773. +use Symfony\Component\CssSelector\XPath\XPathExpr;
  7774. +
  7775. +/**
  7776. + * XPath expression translator HTML extension.
  7777. + *
  7778. + * This component is a port of the Python cssselector library,
  7779. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  7780. + *
  7781. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  7782. + */
  7783. +class HtmlExtension extends AbstractExtension
  7784. +{
  7785. +    /**
  7786. +     * Constructor.
  7787. +     *
  7788. +     * @param Translator $translator
  7789. +     */
  7790. +    public function __construct(Translator $translator)
  7791. +    {
  7792. +        $translator
  7793. +            ->getExtension('node')
  7794. +            ->setFlag(NodeExtension::ELEMENT_NAME_IN_LOWER_CASE, true)
  7795. +            ->setFlag(NodeExtension::ATTRIBUTE_NAME_IN_LOWER_CASE, true);
  7796. +    }
  7797. +
  7798. +    /**
  7799. +     * {@inheritdoc}
  7800. +     */
  7801. +    public function getPseudoClassTranslators()
  7802. +    {
  7803. +        return array(
  7804. +            'checked'  => array($this, 'translateChecked'),
  7805. +            'link'     => array($this, 'translateLink'),
  7806. +            'disabled' => array($this, 'translateDisabled'),
  7807. +            'enabled'  => array($this, 'translateEnabled'),
  7808. +            'selected' => array($this, 'translateSelected'),
  7809. +            'invalid'  => array($this, 'translateInvalid'),
  7810. +            'hover'    => array($this, 'translateHover'),
  7811. +            'visited'  => array($this, 'translateVisited'),
  7812. +        );
  7813. +    }
  7814. +
  7815. +    /**
  7816. +     * {@inheritdoc}
  7817. +     */
  7818. +    public function getFunctionTranslators()
  7819. +    {
  7820. +        return array(
  7821. +            'lang' => array($this, 'translateLang'),
  7822. +        );
  7823. +    }
  7824. +
  7825. +    /**
  7826. +     * @param XPathExpr $xpath
  7827. +     *
  7828. +     * @return XPathExpr
  7829. +     */
  7830. +    public function translateChecked(XPathExpr $xpath)
  7831. +    {
  7832. +        return $xpath->addCondition(
  7833. +            '(@checked '
  7834. +            ."and (name(.) = 'input' or name(.) = 'command')"
  7835. +            ."and (@type = 'checkbox' or @type = 'radio'))"
  7836. +        );
  7837. +    }
  7838. +
  7839. +    /**
  7840. +     * @param XPathExpr $xpath
  7841. +     *
  7842. +     * @return XPathExpr
  7843. +     */
  7844. +    public function translateLink(XPathExpr $xpath)
  7845. +    {
  7846. +        return $xpath->addCondition("@href and (name(.) = 'a' or name(.) = 'link' or name(.) = 'area')");
  7847. +    }
  7848. +
  7849. +    /**
  7850. +     * @param XPathExpr $xpath
  7851. +     *
  7852. +     * @return XPathExpr
  7853. +     */
  7854. +    public function translateDisabled(XPathExpr $xpath)
  7855. +    {
  7856. +        return $xpath->addCondition(
  7857. +            "("
  7858. +                ."@disabled and"
  7859. +                ."("
  7860. +                    ."(name(.) = 'input' and @type != 'hidden')"
  7861. +                    ." or name(.) = 'button'"
  7862. +                    ." or name(.) = 'select'"
  7863. +                    ." or name(.) = 'textarea'"
  7864. +                    ." or name(.) = 'command'"
  7865. +                    ." or name(.) = 'fieldset'"
  7866. +                    ." or name(.) = 'optgroup'"
  7867. +                    ." or name(.) = 'option'"
  7868. +                .")"
  7869. +            .") or ("
  7870. +                ."(name(.) = 'input' and @type != 'hidden')"
  7871. +                ." or name(.) = 'button'"
  7872. +                ." or name(.) = 'select'"
  7873. +                ." or name(.) = 'textarea'"
  7874. +            .")"
  7875. +            ." and ancestor::fieldset[@disabled]"
  7876. +        );
  7877. +        // todo: in the second half, add "and is not a descendant of that fieldset element's first legend element child, if any."
  7878. +    }
  7879. +
  7880. +    /**
  7881. +     * @param XPathExpr $xpath
  7882. +     *
  7883. +     * @return XPathExpr
  7884. +     */
  7885. +    public function translateEnabled(XPathExpr $xpath)
  7886. +    {
  7887. +        return $xpath->addCondition(
  7888. +            '('
  7889. +                .'@href and ('
  7890. +                    ."name(.) = 'a'"
  7891. +                    ." or name(.) = 'link'"
  7892. +                    ." or name(.) = 'area'"
  7893. +                .')'
  7894. +            .') or ('
  7895. +                .'('
  7896. +                    ."name(.) = 'command'"
  7897. +                    ." or name(.) = 'fieldset'"
  7898. +                    ." or name(.) = 'optgroup'"
  7899. +                .')'
  7900. +                .' and not(@disabled)'
  7901. +            .') or ('
  7902. +                .'('
  7903. +                    ."(name(.) = 'input' and @type != 'hidden')"
  7904. +                    ." or name(.) = 'button'"
  7905. +                    ." or name(.) = 'select'"
  7906. +                    ." or name(.) = 'textarea'"
  7907. +                    ." or name(.) = 'keygen'"
  7908. +                .')'
  7909. +                ." and not (@disabled or ancestor::fieldset[@disabled])"
  7910. +            .') or ('
  7911. +                ."name(.) = 'option' and not("
  7912. +                    ."@disabled or ancestor::optgroup[@disabled]"
  7913. +                .')'
  7914. +            .')'
  7915. +        );
  7916. +    }
  7917. +
  7918. +    /**
  7919. +     * @param XPathExpr    $xpath
  7920. +     * @param FunctionNode $function
  7921. +     *
  7922. +     * @return XPathExpr
  7923. +     *
  7924. +     * @throws ExpressionErrorException
  7925. +     */
  7926. +    public function translateLang(XPathExpr $xpath, FunctionNode $function)
  7927. +    {
  7928. +        $arguments = $function->getArguments();
  7929. +        foreach ($arguments as $token) {
  7930. +            if (!($token->isString() || $token->isIdentifier())) {
  7931. +                throw new ExpressionErrorException(
  7932. +                    'Expected a single string or identifier for :lang(), got '
  7933. +                    .implode(', ', $arguments)
  7934. +                );
  7935. +            }
  7936. +        }
  7937. +
  7938. +        return $xpath->addCondition(sprintf(
  7939. +            'ancestor-or-self::*[@lang][1][starts-with(concat('
  7940. +            ."translate(@%s, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), '-')"
  7941. +            .', %s)]',
  7942. +            'lang',
  7943. +            Translator::getXpathLiteral(strtolower($arguments[0]->getValue()).'-')
  7944. +        ));
  7945. +    }
  7946. +
  7947. +    /**
  7948. +     * @param XPathExpr $xpath
  7949. +     *
  7950. +     * @return XPathExpr
  7951. +     */
  7952. +    public function translateSelected(XPathExpr $xpath)
  7953. +    {
  7954. +        return $xpath->addCondition("(@selected and name(.) = 'option')");
  7955. +    }
  7956. +
  7957. +    /**
  7958. +     * @param XPathExpr $xpath
  7959. +     *
  7960. +     * @return XPathExpr
  7961. +     */
  7962. +    public function translateInvalid(XPathExpr $xpath)
  7963. +    {
  7964. +        return $xpath->addCondition('0');
  7965. +    }
  7966. +
  7967. +    /**
  7968. +     * @param XPathExpr $xpath
  7969. +     *
  7970. +     * @return XPathExpr
  7971. +     */
  7972. +    public function translateHover(XPathExpr $xpath)
  7973. +    {
  7974. +        return $xpath->addCondition('0');
  7975. +    }
  7976. +
  7977. +    /**
  7978. +     * @param XPathExpr $xpath
  7979. +     *
  7980. +     * @return XPathExpr
  7981. +     */
  7982. +    public function translateVisited(XPathExpr $xpath)
  7983. +    {
  7984. +        return $xpath->addCondition('0');
  7985. +    }
  7986. +
  7987. +    /**
  7988. +     * {@inheritdoc}
  7989. +     */
  7990. +    public function getName()
  7991. +    {
  7992. +        return 'html';
  7993. +    }
  7994. +}
  7995. 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
  7996. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php  1970-01-01 01:00:00.000000000 +0100
  7997. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php 2014-11-19 15:54:09.660099997 +0100
  7998. @@ -0,0 +1,271 @@
  7999. +<?php
  8000. +
  8001. +/*
  8002. + * This file is part of the Symfony package.
  8003. + *
  8004. + * (c) Fabien Potencier <fabien@symfony.com>
  8005. + *
  8006. + * For the full copyright and license information, please view the LICENSE
  8007. + * file that was distributed with this source code.
  8008. + */
  8009. +
  8010. +namespace Symfony\Component\CssSelector\XPath\Extension;
  8011. +
  8012. +use Symfony\Component\CssSelector\Node;
  8013. +use Symfony\Component\CssSelector\XPath\Translator;
  8014. +use Symfony\Component\CssSelector\XPath\XPathExpr;
  8015. +
  8016. +/**
  8017. + * XPath expression translator node extension.
  8018. + *
  8019. + * This component is a port of the Python cssselector library,
  8020. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  8021. + *
  8022. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  8023. + */
  8024. +class NodeExtension extends AbstractExtension
  8025. +{
  8026. +    const ELEMENT_NAME_IN_LOWER_CASE    = 1;
  8027. +    const ATTRIBUTE_NAME_IN_LOWER_CASE  = 2;
  8028. +    const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4;
  8029. +
  8030. +    /**
  8031. +     * @var int
  8032. +     */
  8033. +    private $flags;
  8034. +
  8035. +    /**
  8036. +     * Constructor.
  8037. +     *
  8038. +     * @param int $flags
  8039. +     */
  8040. +    public function __construct($flags = 0)
  8041. +    {
  8042. +        $this->flags = $flags;
  8043. +    }
  8044. +
  8045. +    /**
  8046. +     * @param int     $flag
  8047. +     * @param bool    $on
  8048. +     *
  8049. +     * @return NodeExtension
  8050. +     */
  8051. +    public function setFlag($flag, $on)
  8052. +    {
  8053. +        if ($on && !$this->hasFlag($flag)) {
  8054. +            $this->flags += $flag;
  8055. +        }
  8056. +
  8057. +        if (!$on && $this->hasFlag($flag)) {
  8058. +            $this->flags -= $flag;
  8059. +        }
  8060. +
  8061. +        return $this;
  8062. +    }
  8063. +
  8064. +    /**
  8065. +     * @param int $flag
  8066. +     *
  8067. +     * @return bool
  8068. +     */
  8069. +    public function hasFlag($flag)
  8070. +    {
  8071. +        return $this->flags & $flag;
  8072. +    }
  8073. +
  8074. +    /**
  8075. +     * {@inheritdoc}
  8076. +     */
  8077. +    public function getNodeTranslators()
  8078. +    {
  8079. +        return array(
  8080. +            'Selector'         => array($this, 'translateSelector'),
  8081. +            'CombinedSelector' => array($this, 'translateCombinedSelector'),
  8082. +            'Negation'         => array($this, 'translateNegation'),
  8083. +            'Function'         => array($this, 'translateFunction'),
  8084. +            'Pseudo'           => array($this, 'translatePseudo'),
  8085. +            'Attribute'        => array($this, 'translateAttribute'),
  8086. +            'Class'            => array($this, 'translateClass'),
  8087. +            'Hash'             => array($this, 'translateHash'),
  8088. +            'Element'          => array($this, 'translateElement'),
  8089. +        );
  8090. +    }
  8091. +
  8092. +    /**
  8093. +     * @param Node\SelectorNode $node
  8094. +     * @param Translator        $translator
  8095. +     *
  8096. +     * @return XPathExpr
  8097. +     */
  8098. +    public function translateSelector(Node\SelectorNode $node, Translator $translator)
  8099. +    {
  8100. +        return $translator->nodeToXPath($node->getTree());
  8101. +    }
  8102. +
  8103. +    /**
  8104. +     * @param Node\CombinedSelectorNode $node
  8105. +     * @param Translator                $translator
  8106. +     *
  8107. +     * @return XPathExpr
  8108. +     */
  8109. +    public function translateCombinedSelector(Node\CombinedSelectorNode $node, Translator $translator)
  8110. +    {
  8111. +        return $translator->addCombination($node->getCombinator(), $node->getSelector(), $node->getSubSelector());
  8112. +    }
  8113. +
  8114. +    /**
  8115. +     * @param Node\NegationNode $node
  8116. +     * @param Translator        $translator
  8117. +     *
  8118. +     * @return XPathExpr
  8119. +     */
  8120. +    public function translateNegation(Node\NegationNode $node, Translator $translator)
  8121. +    {
  8122. +        $xpath = $translator->nodeToXPath($node->getSelector());
  8123. +        $subXpath = $translator->nodeToXPath($node->getSubSelector());
  8124. +        $subXpath->addNameTest();
  8125. +
  8126. +        if ($subXpath->getCondition()) {
  8127. +            return $xpath->addCondition(sprintf('not(%s)', $subXpath->getCondition()));
  8128. +        }
  8129. +
  8130. +        return $xpath->addCondition('0');
  8131. +    }
  8132. +
  8133. +    /**
  8134. +     * @param Node\FunctionNode $node
  8135. +     * @param Translator        $translator
  8136. +     *
  8137. +     * @return XPathExpr
  8138. +     */
  8139. +    public function translateFunction(Node\FunctionNode $node, Translator $translator)
  8140. +    {
  8141. +        $xpath = $translator->nodeToXPath($node->getSelector());
  8142. +
  8143. +        return $translator->addFunction($xpath, $node);
  8144. +    }
  8145. +
  8146. +    /**
  8147. +     * @param Node\PseudoNode $node
  8148. +     * @param Translator      $translator
  8149. +     *
  8150. +     * @return XPathExpr
  8151. +     */
  8152. +    public function translatePseudo(Node\PseudoNode $node, Translator $translator)
  8153. +    {
  8154. +        $xpath = $translator->nodeToXPath($node->getSelector());
  8155. +
  8156. +        return $translator->addPseudoClass($xpath, $node->getIdentifier());
  8157. +    }
  8158. +
  8159. +    /**
  8160. +     * @param Node\AttributeNode $node
  8161. +     * @param Translator         $translator
  8162. +     *
  8163. +     * @return XPathExpr
  8164. +     */
  8165. +    public function translateAttribute(Node\AttributeNode $node, Translator $translator)
  8166. +    {
  8167. +        $name = $node->getAttribute();
  8168. +        $safe = $this->isSafeName($name);
  8169. +
  8170. +        if ($this->hasFlag(self::ATTRIBUTE_NAME_IN_LOWER_CASE)) {
  8171. +            $name = strtolower($name);
  8172. +        }
  8173. +
  8174. +        if ($node->getNamespace()) {
  8175. +            $name = sprintf('%s:%s', $node->getNamespace(), $name);
  8176. +            $safe = $safe && $this->isSafeName($node->getNamespace());
  8177. +        }
  8178. +
  8179. +        $attribute = $safe ? '@'.$name : sprintf('attribute::*[name() = %s]', Translator::getXpathLiteral($name));
  8180. +        $value = $node->getValue();
  8181. +        $xpath = $translator->nodeToXPath($node->getSelector());
  8182. +
  8183. +        if ($this->hasFlag(self::ATTRIBUTE_VALUE_IN_LOWER_CASE)) {
  8184. +            $value = strtolower($value);
  8185. +        }
  8186. +
  8187. +        return $translator->addAttributeMatching($xpath, $node->getOperator(), $attribute, $value);
  8188. +    }
  8189. +
  8190. +    /**
  8191. +     * @param Node\ClassNode $node
  8192. +     * @param Translator     $translator
  8193. +     *
  8194. +     * @return XPathExpr
  8195. +     */
  8196. +    public function translateClass(Node\ClassNode $node, Translator $translator)
  8197. +    {
  8198. +        $xpath = $translator->nodeToXPath($node->getSelector());
  8199. +
  8200. +        return $translator->addAttributeMatching($xpath, '~=', '@class', $node->getName());
  8201. +    }
  8202. +
  8203. +    /**
  8204. +     * @param Node\HashNode $node
  8205. +     * @param Translator    $translator
  8206. +     *
  8207. +     * @return XPathExpr
  8208. +     */
  8209. +    public function translateHash(Node\HashNode $node, Translator $translator)
  8210. +    {
  8211. +        $xpath = $translator->nodeToXPath($node->getSelector());
  8212. +
  8213. +        return $translator->addAttributeMatching($xpath, '=', '@id', $node->getId());
  8214. +    }
  8215. +
  8216. +    /**
  8217. +     * @param Node\ElementNode $node
  8218. +     *
  8219. +     * @return XPathExpr
  8220. +     */
  8221. +    public function translateElement(Node\ElementNode $node)
  8222. +    {
  8223. +        $element = $node->getElement();
  8224. +
  8225. +        if ($this->hasFlag(self::ELEMENT_NAME_IN_LOWER_CASE)) {
  8226. +            $element = strtolower($element);
  8227. +        }
  8228. +
  8229. +        if ($element) {
  8230. +            $safe = $this->isSafeName($element);
  8231. +        } else {
  8232. +            $element = '*';
  8233. +            $safe = true;
  8234. +        }
  8235. +
  8236. +        if ($node->getNamespace()) {
  8237. +            $element = sprintf('%s:%s', $node->getNamespace(), $element);
  8238. +            $safe = $safe && $this->isSafeName($node->getNamespace());
  8239. +        }
  8240. +
  8241. +        $xpath = new XPathExpr('', $element);
  8242. +
  8243. +        if (!$safe) {
  8244. +            $xpath->addNameTest();
  8245. +        }
  8246. +
  8247. +        return $xpath;
  8248. +    }
  8249. +
  8250. +    /**
  8251. +     * {@inheritdoc}
  8252. +     */
  8253. +    public function getName()
  8254. +    {
  8255. +        return 'node';
  8256. +    }
  8257. +
  8258. +    /**
  8259. +     * Tests if given name is safe.
  8260. +     *
  8261. +     * @param string $name
  8262. +     *
  8263. +     * @return bool
  8264. +     */
  8265. +    private function isSafeName($name)
  8266. +    {
  8267. +        return 0 < preg_match('~^[a-zA-Z_][a-zA-Z0-9_.-]*$~', $name);
  8268. +    }
  8269. +}
  8270. 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
  8271. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php   1970-01-01 01:00:00.000000000 +0100
  8272. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Extension/PseudoClassExtension.php  2014-11-19 15:54:09.332099995 +0100
  8273. @@ -0,0 +1,162 @@
  8274. +<?php
  8275. +
  8276. +/*
  8277. + * This file is part of the Symfony package.
  8278. + *
  8279. + * (c) Fabien Potencier <fabien@symfony.com>
  8280. + *
  8281. + * For the full copyright and license information, please view the LICENSE
  8282. + * file that was distributed with this source code.
  8283. + */
  8284. +
  8285. +namespace Symfony\Component\CssSelector\XPath\Extension;
  8286. +
  8287. +use Symfony\Component\CssSelector\Exception\ExpressionErrorException;
  8288. +use Symfony\Component\CssSelector\XPath\XPathExpr;
  8289. +
  8290. +/**
  8291. + * XPath expression translator pseudo-class extension.
  8292. + *
  8293. + * This component is a port of the Python cssselector library,
  8294. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  8295. + *
  8296. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  8297. + */
  8298. +class PseudoClassExtension extends AbstractExtension
  8299. +{
  8300. +    /**
  8301. +     * {@inheritdoc}
  8302. +     */
  8303. +    public function getPseudoClassTranslators()
  8304. +    {
  8305. +        return array(
  8306. +            'root'          => array($this, 'translateRoot'),
  8307. +            'first-child'   => array($this, 'translateFirstChild'),
  8308. +            'last-child'    => array($this, 'translateLastChild'),
  8309. +            'first-of-type' => array($this, 'translateFirstOfType'),
  8310. +            'last-of-type'  => array($this, 'translateLastOfType'),
  8311. +            'only-child'    => array($this, 'translateOnlyChild'),
  8312. +            'only-of-type'  => array($this, 'translateOnlyOfType'),
  8313. +            'empty'         => array($this, 'translateEmpty'),
  8314. +        );
  8315. +    }
  8316. +
  8317. +    /**
  8318. +     * @param XPathExpr $xpath
  8319. +     *
  8320. +     * @return XPathExpr
  8321. +     */
  8322. +    public function translateRoot(XPathExpr $xpath)
  8323. +    {
  8324. +        return $xpath->addCondition('not(parent::*)');
  8325. +    }
  8326. +
  8327. +    /**
  8328. +     * @param XPathExpr $xpath
  8329. +     *
  8330. +     * @return XPathExpr
  8331. +     */
  8332. +    public function translateFirstChild(XPathExpr $xpath)
  8333. +    {
  8334. +        return $xpath
  8335. +            ->addStarPrefix()
  8336. +            ->addNameTest()
  8337. +            ->addCondition('position() = 1');
  8338. +    }
  8339. +
  8340. +    /**
  8341. +     * @param XPathExpr $xpath
  8342. +     *
  8343. +     * @return XPathExpr
  8344. +     */
  8345. +    public function translateLastChild(XPathExpr $xpath)
  8346. +    {
  8347. +        return $xpath
  8348. +            ->addStarPrefix()
  8349. +            ->addNameTest()
  8350. +            ->addCondition('position() = last()');
  8351. +    }
  8352. +
  8353. +    /**
  8354. +     * @param XPathExpr $xpath
  8355. +     *
  8356. +     * @return XPathExpr
  8357. +     *
  8358. +     * @throws ExpressionErrorException
  8359. +     */
  8360. +    public function translateFirstOfType(XPathExpr $xpath)
  8361. +    {
  8362. +        if ('*' === $xpath->getElement()) {
  8363. +            throw new ExpressionErrorException('"*:first-of-type" is not implemented.');
  8364. +        }
  8365. +
  8366. +        return $xpath
  8367. +            ->addStarPrefix()
  8368. +            ->addCondition('position() = 1');
  8369. +    }
  8370. +
  8371. +    /**
  8372. +     * @param XPathExpr $xpath
  8373. +     *
  8374. +     * @return XPathExpr
  8375. +     *
  8376. +     * @throws ExpressionErrorException
  8377. +     */
  8378. +    public function translateLastOfType(XPathExpr $xpath)
  8379. +    {
  8380. +        if ('*' === $xpath->getElement()) {
  8381. +            throw new ExpressionErrorException('"*:last-of-type" is not implemented.');
  8382. +        }
  8383. +
  8384. +        return $xpath
  8385. +            ->addStarPrefix()
  8386. +            ->addCondition('position() = last()');
  8387. +    }
  8388. +
  8389. +    /**
  8390. +     * @param XPathExpr $xpath
  8391. +     *
  8392. +     * @return XPathExpr
  8393. +     */
  8394. +    public function translateOnlyChild(XPathExpr $xpath)
  8395. +    {
  8396. +        return $xpath
  8397. +            ->addStarPrefix()
  8398. +            ->addNameTest()
  8399. +            ->addCondition('last() = 1');
  8400. +    }
  8401. +
  8402. +    /**
  8403. +     * @param XPathExpr $xpath
  8404. +     *
  8405. +     * @return XPathExpr
  8406. +     *
  8407. +     * @throws ExpressionErrorException
  8408. +     */
  8409. +    public function translateOnlyOfType(XPathExpr $xpath)
  8410. +    {
  8411. +        if ('*' === $xpath->getElement()) {
  8412. +            throw new ExpressionErrorException('"*:only-of-type" is not implemented.');
  8413. +        }
  8414. +
  8415. +        return $xpath->addCondition('last() = 1');
  8416. +    }
  8417. +
  8418. +    /**
  8419. +     * @param XPathExpr $xpath
  8420. +     *
  8421. +     * @return XPathExpr
  8422. +     */
  8423. +    public function translateEmpty(XPathExpr $xpath)
  8424. +    {
  8425. +        return $xpath->addCondition('not(*) and not(string-length())');
  8426. +    }
  8427. +
  8428. +    /**
  8429. +     * {@inheritdoc}
  8430. +     */
  8431. +    public function getName()
  8432. +    {
  8433. +        return 'pseudo-class';
  8434. +    }
  8435. +}
  8436. 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
  8437. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/TranslatorInterface.php  1970-01-01 01:00:00.000000000 +0100
  8438. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/TranslatorInterface.php 2014-11-19 15:54:08.212099988 +0100
  8439. @@ -0,0 +1,45 @@
  8440. +<?php
  8441. +
  8442. +/*
  8443. + * This file is part of the Symfony package.
  8444. + *
  8445. + * (c) Fabien Potencier <fabien@symfony.com>
  8446. + *
  8447. + * For the full copyright and license information, please view the LICENSE
  8448. + * file that was distributed with this source code.
  8449. + */
  8450. +
  8451. +namespace Symfony\Component\CssSelector\XPath;
  8452. +
  8453. +use Symfony\Component\CssSelector\Node\SelectorNode;
  8454. +
  8455. +/**
  8456. + * XPath expression translator interface.
  8457. + *
  8458. + * This component is a port of the Python cssselector library,
  8459. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  8460. + *
  8461. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  8462. + */
  8463. +interface TranslatorInterface
  8464. +{
  8465. +    /**
  8466. +     * Translates a CSS selector to an XPath expression.
  8467. +     *
  8468. +     * @param string $cssExpr
  8469. +     * @param string $prefix
  8470. +     *
  8471. +     * @return XPathExpr
  8472. +     */
  8473. +    public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::');
  8474. +
  8475. +    /**
  8476. +     * Translates a parsed selector node to an XPath expression
  8477. +     *
  8478. +     * @param SelectorNode $selector
  8479. +     * @param string       $prefix
  8480. +     *
  8481. +     * @return XPathExpr
  8482. +     */
  8483. +    public function selectorToXPath(SelectorNode $selector, $prefix = 'descendant-or-self::');
  8484. +}
  8485. 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
  8486. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Translator.php   1970-01-01 01:00:00.000000000 +0100
  8487. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/Translator.php  2014-11-19 15:54:08.052099987 +0100
  8488. @@ -0,0 +1,299 @@
  8489. +<?php
  8490. +
  8491. +/*
  8492. + * This file is part of the Symfony package.
  8493. + *
  8494. + * (c) Fabien Potencier <fabien@symfony.com>
  8495. + *
  8496. + * For the full copyright and license information, please view the LICENSE
  8497. + * file that was distributed with this source code.
  8498. + */
  8499. +
  8500. +namespace Symfony\Component\CssSelector\XPath;
  8501. +
  8502. +use Symfony\Component\CssSelector\Exception\ExpressionErrorException;
  8503. +use Symfony\Component\CssSelector\Node\FunctionNode;
  8504. +use Symfony\Component\CssSelector\Node\NodeInterface;
  8505. +use Symfony\Component\CssSelector\Node\SelectorNode;
  8506. +use Symfony\Component\CssSelector\Parser\Parser;
  8507. +use Symfony\Component\CssSelector\Parser\ParserInterface;
  8508. +
  8509. +/**
  8510. + * XPath expression translator interface.
  8511. + *
  8512. + * This component is a port of the Python cssselector library,
  8513. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  8514. + *
  8515. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  8516. + */
  8517. +class Translator implements TranslatorInterface
  8518. +{
  8519. +    /**
  8520. +     * @var ParserInterface
  8521. +     */
  8522. +    private $mainParser;
  8523. +
  8524. +    /**
  8525. +     * @var ParserInterface[]
  8526. +     */
  8527. +    private $shortcutParsers = array();
  8528. +
  8529. +    /**
  8530. +     * @var Extension\ExtensionInterface
  8531. +     */
  8532. +    private $extensions = array();
  8533. +
  8534. +    /**
  8535. +     * @var array
  8536. +     */
  8537. +    private $nodeTranslators = array();
  8538. +
  8539. +    /**
  8540. +     * @var array
  8541. +     */
  8542. +    private $combinationTranslators = array();
  8543. +
  8544. +    /**
  8545. +     * @var array
  8546. +     */
  8547. +    private $functionTranslators = array();
  8548. +
  8549. +    /**
  8550. +     * @var array
  8551. +     */
  8552. +    private $pseudoClassTranslators = array();
  8553. +
  8554. +    /**
  8555. +     * @var array
  8556. +     */
  8557. +    private $attributeMatchingTranslators = array();
  8558. +
  8559. +    /**
  8560. +     * Constructor.
  8561. +     */
  8562. +    public function __construct(ParserInterface $parser = null)
  8563. +    {
  8564. +        $this->mainParser = $parser ?: new Parser();
  8565. +
  8566. +        $this
  8567. +            ->registerExtension(new Extension\NodeExtension())
  8568. +            ->registerExtension(new Extension\CombinationExtension())
  8569. +            ->registerExtension(new Extension\FunctionExtension())
  8570. +            ->registerExtension(new Extension\PseudoClassExtension())
  8571. +            ->registerExtension(new Extension\AttributeMatchingExtension())
  8572. +        ;
  8573. +    }
  8574. +
  8575. +    /**
  8576. +     * @param string $element
  8577. +     *
  8578. +     * @return string
  8579. +     */
  8580. +    public static function getXpathLiteral($element)
  8581. +    {
  8582. +        if (false === strpos($element, "'")) {
  8583. +            return "'".$element."'";
  8584. +        }
  8585. +
  8586. +        if (false === strpos($element, '"')) {
  8587. +            return '"'.$element.'"';
  8588. +        }
  8589. +
  8590. +        $string = $element;
  8591. +        $parts = array();
  8592. +        while (true) {
  8593. +            if (false !== $pos = strpos($string, "'")) {
  8594. +                $parts[] = sprintf("'%s'", substr($string, 0, $pos));
  8595. +                $parts[] = "\"'\"";
  8596. +                $string = substr($string, $pos + 1);
  8597. +            } else {
  8598. +                $parts[] = "'$string'";
  8599. +                break;
  8600. +            }
  8601. +        }
  8602. +
  8603. +        return sprintf('concat(%s)', implode($parts, ', '));
  8604. +    }
  8605. +
  8606. +    /**
  8607. +     * {@inheritdoc}
  8608. +     */
  8609. +    public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::')
  8610. +    {
  8611. +        $selectors = $this->parseSelectors($cssExpr);
  8612. +
  8613. +        /** @var SelectorNode $selector */
  8614. +        foreach ($selectors as $index => $selector) {
  8615. +            if (null !== $selector->getPseudoElement()) {
  8616. +                throw new ExpressionErrorException('Pseudo-elements are not supported.');
  8617. +            }
  8618. +
  8619. +            $selectors[$index] = $this->selectorToXPath($selector, $prefix);
  8620. +        }
  8621. +
  8622. +        return implode(' | ', $selectors);
  8623. +    }
  8624. +
  8625. +    /**
  8626. +     * {@inheritdoc}
  8627. +     */
  8628. +    public function selectorToXPath(SelectorNode $selector, $prefix = 'descendant-or-self::')
  8629. +    {
  8630. +        return ($prefix ?: '').$this->nodeToXPath($selector);
  8631. +    }
  8632. +
  8633. +    /**
  8634. +     * Registers an extension.
  8635. +     *
  8636. +     * @param Extension\ExtensionInterface $extension
  8637. +     *
  8638. +     * @return Translator
  8639. +     */
  8640. +    public function registerExtension(Extension\ExtensionInterface $extension)
  8641. +    {
  8642. +        $this->extensions[$extension->getName()] = $extension;
  8643. +
  8644. +        $this->nodeTranslators = array_merge($this->nodeTranslators, $extension->getNodeTranslators());
  8645. +        $this->combinationTranslators = array_merge($this->combinationTranslators, $extension->getCombinationTranslators());
  8646. +        $this->functionTranslators = array_merge($this->functionTranslators, $extension->getFunctionTranslators());
  8647. +        $this->pseudoClassTranslators = array_merge($this->pseudoClassTranslators, $extension->getPseudoClassTranslators());
  8648. +        $this->attributeMatchingTranslators = array_merge($this->attributeMatchingTranslators, $extension->getAttributeMatchingTranslators());
  8649. +
  8650. +        return $this;
  8651. +    }
  8652. +
  8653. +    /**
  8654. +     * @param string $name
  8655. +     *
  8656. +     * @return Extension\ExtensionInterface
  8657. +     *
  8658. +     * @throws ExpressionErrorException
  8659. +     */
  8660. +    public function getExtension($name)
  8661. +    {
  8662. +        if (!isset($this->extensions[$name])) {
  8663. +            throw new ExpressionErrorException(sprintf('Extension "%s" not registered.', $name));
  8664. +        }
  8665. +
  8666. +        return $this->extensions[$name];
  8667. +    }
  8668. +
  8669. +    /**
  8670. +     * Registers a shortcut parser.
  8671. +     *
  8672. +     * @param ParserInterface $shortcut
  8673. +     *
  8674. +     * @return Translator
  8675. +     */
  8676. +    public function registerParserShortcut(ParserInterface $shortcut)
  8677. +    {
  8678. +        $this->shortcutParsers[] = $shortcut;
  8679. +
  8680. +        return $this;
  8681. +    }
  8682. +
  8683. +    /**
  8684. +     * @param NodeInterface $node
  8685. +     *
  8686. +     * @return XPathExpr
  8687. +     *
  8688. +     * @throws ExpressionErrorException
  8689. +     */
  8690. +    public function nodeToXPath(NodeInterface $node)
  8691. +    {
  8692. +        if (!isset($this->nodeTranslators[$node->getNodeName()])) {
  8693. +            throw new ExpressionErrorException(sprintf('Node "%s" not supported.', $node->getNodeName()));
  8694. +        }
  8695. +
  8696. +        return call_user_func($this->nodeTranslators[$node->getNodeName()], $node, $this);
  8697. +    }
  8698. +
  8699. +    /**
  8700. +     * @param string        $combiner
  8701. +     * @param NodeInterface $xpath
  8702. +     * @param NodeInterface $combinedXpath
  8703. +     *
  8704. +     * @return XPathExpr
  8705. +     *
  8706. +     * @throws ExpressionErrorException
  8707. +     */
  8708. +    public function addCombination($combiner, NodeInterface $xpath, NodeInterface $combinedXpath)
  8709. +    {
  8710. +        if (!isset($this->combinationTranslators[$combiner])) {
  8711. +            throw new ExpressionErrorException(sprintf('Combiner "%s" not supported.', $combiner));
  8712. +        }
  8713. +
  8714. +        return call_user_func($this->combinationTranslators[$combiner], $this->nodeToXPath($xpath), $this->nodeToXPath($combinedXpath));
  8715. +    }
  8716. +
  8717. +    /**
  8718. +     * @param XPathExpr $xpath
  8719. +     * @param FunctionNode $function
  8720. +     *
  8721. +     * @return XPathExpr
  8722. +     *
  8723. +     * @throws ExpressionErrorException
  8724. +     */
  8725. +    public function addFunction(XPathExpr $xpath, FunctionNode $function)
  8726. +    {
  8727. +        if (!isset($this->functionTranslators[$function->getName()])) {
  8728. +            throw new ExpressionErrorException(sprintf('Function "%s" not supported.', $function->getName()));
  8729. +        }
  8730. +
  8731. +        return call_user_func($this->functionTranslators[$function->getName()], $xpath, $function);
  8732. +    }
  8733. +
  8734. +    /**
  8735. +     * @param XPathExpr $xpath
  8736. +     * @param string    $pseudoClass
  8737. +     *
  8738. +     * @return XPathExpr
  8739. +     *
  8740. +     * @throws ExpressionErrorException
  8741. +     */
  8742. +    public function addPseudoClass(XPathExpr $xpath, $pseudoClass)
  8743. +    {
  8744. +        if (!isset($this->pseudoClassTranslators[$pseudoClass])) {
  8745. +            throw new ExpressionErrorException(sprintf('Pseudo-class "%s" not supported.', $pseudoClass));
  8746. +        }
  8747. +
  8748. +        return call_user_func($this->pseudoClassTranslators[$pseudoClass], $xpath);
  8749. +    }
  8750. +
  8751. +    /**
  8752. +     * @param XPathExpr $xpath
  8753. +     * @param string    $operator
  8754. +     * @param string    $attribute
  8755. +     * @param string    $value
  8756. +     *
  8757. +     * @throws ExpressionErrorException
  8758. +     *
  8759. +     * @return XPathExpr
  8760. +     */
  8761. +    public function addAttributeMatching(XPathExpr $xpath, $operator, $attribute, $value)
  8762. +    {
  8763. +        if (!isset($this->attributeMatchingTranslators[$operator])) {
  8764. +            throw new ExpressionErrorException(sprintf('Attribute matcher operator "%s" not supported.', $operator));
  8765. +        }
  8766. +
  8767. +        return call_user_func($this->attributeMatchingTranslators[$operator], $xpath, $attribute, $value);
  8768. +    }
  8769. +
  8770. +    /**
  8771. +     * @param string $css
  8772. +     *
  8773. +     * @return SelectorNode[]
  8774. +     */
  8775. +    private function parseSelectors($css)
  8776. +    {
  8777. +        foreach ($this->shortcutParsers as $shortcut) {
  8778. +            $tokens = $shortcut->parse($css);
  8779. +
  8780. +            if (!empty($tokens)) {
  8781. +                return $tokens;
  8782. +            }
  8783. +        }
  8784. +
  8785. +        return $this->mainParser->parse($css);
  8786. +    }
  8787. +}
  8788. 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
  8789. --- sendy/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/XPathExpr.php    1970-01-01 01:00:00.000000000 +0100
  8790. +++ sendy-modified/includes/vendor/symfony/css-selector/Symfony/Component/CssSelector/XPath/XPathExpr.php   2014-11-19 15:54:07.884099986 +0100
  8791. @@ -0,0 +1,140 @@
  8792. +<?php
  8793. +
  8794. +/*
  8795. + * This file is part of the Symfony package.
  8796. + *
  8797. + * (c) Fabien Potencier <fabien@symfony.com>
  8798. + *
  8799. + * For the full copyright and license information, please view the LICENSE
  8800. + * file that was distributed with this source code.
  8801. + */
  8802. +
  8803. +namespace Symfony\Component\CssSelector\XPath;
  8804. +
  8805. +/**
  8806. + * XPath expression translator interface.
  8807. + *
  8808. + * This component is a port of the Python cssselector library,
  8809. + * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
  8810. + *
  8811. + * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  8812. + */
  8813. +class XPathExpr
  8814. +{
  8815. +    /**
  8816. +     * @var string
  8817. +     */
  8818. +    private $path;
  8819. +
  8820. +    /**
  8821. +     * @var string
  8822. +     */
  8823. +    private $element;
  8824. +
  8825. +    /**
  8826. +     * @var string
  8827. +     */
  8828. +    private $condition;
  8829. +
  8830. +    /**
  8831. +     * @param string  $path
  8832. +     * @param string  $element
  8833. +     * @param string  $condition
  8834. +     * @param bool    $starPrefix
  8835. +     */
  8836. +    public function __construct($path = '', $element = '*', $condition = '', $starPrefix = false)
  8837. +    {
  8838. +        $this->path = $path;
  8839. +        $this->element = $element;
  8840. +        $this->condition = $condition;
  8841. +
  8842. +        if ($starPrefix) {
  8843. +            $this->addStarPrefix();
  8844. +        }
  8845. +    }
  8846. +
  8847. +    /**
  8848. +     * @return string
  8849. +     */
  8850. +    public function getElement()
  8851. +    {
  8852. +        return $this->element;
  8853. +    }
  8854. +
  8855. +    /**
  8856. +     * @param $condition
  8857. +     *
  8858. +     * @return XPathExpr
  8859. +     */
  8860. +    public function addCondition($condition)
  8861. +    {
  8862. +        $this->condition = $this->condition ? sprintf('%s and (%s)', $this->condition, $condition) : $condition;
  8863. +
  8864. +        return $this;
  8865. +    }
  8866. +
  8867. +    /**
  8868. +     * @return string
  8869. +     */
  8870. +    public function getCondition()
  8871. +    {
  8872. +        return $this->condition;
  8873. +    }
  8874. +
  8875. +    /**
  8876. +     * @return XPathExpr
  8877. +     */
  8878. +    public function addNameTest()
  8879. +    {
  8880. +        if ('*' !== $this->element) {
  8881. +            $this->addCondition('name() = '.Translator::getXpathLiteral($this->element));
  8882. +            $this->element = '*';
  8883. +        }
  8884. +
  8885. +        return $this;
  8886. +    }
  8887. +
  8888. +    /**
  8889. +     * @return XPathExpr
  8890. +     */
  8891. +    public function addStarPrefix()
  8892. +    {
  8893. +        $this->path .= '*/';
  8894. +
  8895. +        return $this;
  8896. +    }
  8897. +
  8898. +    /**
  8899. +     * Joins another XPathExpr with a combiner.
  8900. +     *
  8901. +     * @param string    $combiner
  8902. +     * @param XPathExpr $expr
  8903. +     *
  8904. +     * @return XPathExpr
  8905. +     */
  8906. +    public function join($combiner, XPathExpr $expr)
  8907. +    {
  8908. +        $path = $this->__toString().$combiner;
  8909. +
  8910. +        if ('*/' !== $expr->path) {
  8911. +            $path .= $expr->path;
  8912. +        }
  8913. +
  8914. +        $this->path = $path;
  8915. +        $this->element = $expr->element;
  8916. +        $this->condition = $expr->condition;
  8917. +
  8918. +        return $this;
  8919. +    }
  8920. +
  8921. +    /**
  8922. +     * @return string
  8923. +     */
  8924. +    public function __toString()
  8925. +    {
  8926. +        $path = $this->path.$this->element;
  8927. +        $condition = null === $this->condition || '' === $this->condition ? '' : '['.$this->condition.']';
  8928. +
  8929. +        return $path.$condition;
  8930. +    }
  8931. +}
  8932. diff -uNr sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/composer.json sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/composer.json
  8933. --- sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/composer.json   1970-01-01 01:00:00.000000000 +0100
  8934. +++ sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/composer.json  2014-11-19 15:53:56.256099915 +0100
  8935. @@ -0,0 +1,31 @@
  8936. +{
  8937. +  "name":        "tijsverkoyen/css-to-inline-styles",
  8938. +  "type":        "library",
  8939. +  "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.",
  8940. +  "homepage":    "https://github.com/tijsverkoyen/CssToInlineStyles",
  8941. +  "license":     "BSD",
  8942. +  "authors":     [
  8943. +    {
  8944. +      "name":  "Tijs Verkoyen",
  8945. +      "email": "css_to_inline_styles@verkoyen.eu",
  8946. +      "role":  "Developer"
  8947. +    }
  8948. +  ],
  8949. +  "require":     {
  8950. +    "php":                  ">=5.3.0",
  8951. +    "symfony/css-selector": "~2.1"
  8952. +  },
  8953. +  "require-dev": {
  8954. +    "phpunit/phpunit":      "~4.0"
  8955. +  },
  8956. +  "autoload":    {
  8957. +    "psr-4": {
  8958. +      "TijsVerkoyen\\CssToInlineStyles\\": "src"
  8959. +    }
  8960. +  },
  8961. +  "extra":       {
  8962. +    "branch-alias": {
  8963. +      "dev-master": "1.5.x-dev"
  8964. +    }
  8965. +  }
  8966. +}
  8967. diff -uNr sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/LICENSE.md sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/LICENSE.md
  8968. --- sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/LICENSE.md  1970-01-01 01:00:00.000000000 +0100
  8969. +++ sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/LICENSE.md 2014-11-19 15:53:57.252099922 +0100
  8970. @@ -0,0 +1,22 @@
  8971. +Copyright (c) Tijs Verkoyen. All rights reserved.
  8972. +Redistribution and use in source and binary forms, with or without
  8973. +modification, are permitted provided that the following conditions are met:
  8974. +
  8975. +1. Redistributions of source code must retain the above copyright notice, this
  8976. +   list of conditions and the following disclaimer.
  8977. +2. Redistributions in binary form must reproduce the above copyright notice,
  8978. +   this list of conditions and the following disclaimer in the documentation
  8979. +   and/or other materials provided with the distribution.
  8980. +3. The name of the author may not be used to endorse or promote products
  8981. +   derived from this software without specific prior written permission.
  8982. +
  8983. +This software is provided by the author "as is" and any express or implied
  8984. +warranties, including, but not limited to, the implied warranties of
  8985. +merchantability and fitness for a particular purpose are disclaimed. In no event
  8986. +shall the author be liable for any direct, indirect, incidental, special,
  8987. +exemplary, or consequential damages (including, but not limited to, procurement
  8988. +of substitute goods or services; loss of use, data, or profits; or business
  8989. +interruption) however caused and on any theory of liability, whether in
  8990. +contract, strict liability, or tort (including negligence or otherwise) arising
  8991. +in any way out of the use of this software, even if advised of the possibility
  8992. +of such damage.
  8993. 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
  8994. --- sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/src/CssToInlineStyles.php   1970-01-01 01:00:00.000000000 +0100
  8995. +++ sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/src/CssToInlineStyles.php  2014-11-19 15:53:56.768099919 +0100
  8996. @@ -0,0 +1,670 @@
  8997. +<?php
  8998. +namespace TijsVerkoyen\CssToInlineStyles;
  8999. +
  9000. +use Symfony\Component\CssSelector\CssSelector;
  9001. +use Symfony\Component\CssSelector\Exception\ExceptionInterface;
  9002. +
  9003. +/**
  9004. + * CSS to Inline Styles class
  9005. + *
  9006. + * @author         Tijs Verkoyen <php-css-to-inline-styles@verkoyen.eu>
  9007. + * @version        1.5.2
  9008. + * @copyright      Copyright (c), Tijs Verkoyen. All rights reserved.
  9009. + * @license        BSD License
  9010. + */
  9011. +class CssToInlineStyles
  9012. +{
  9013. +    /**
  9014. +     * The CSS to use
  9015. +     *
  9016. +     * @var    string
  9017. +     */
  9018. +    private $css;
  9019. +
  9020. +    /**
  9021. +     * The processed CSS rules
  9022. +     *
  9023. +     * @var    array
  9024. +     */
  9025. +    private $cssRules;
  9026. +
  9027. +    /**
  9028. +     * Should the generated HTML be cleaned
  9029. +     *
  9030. +     * @var    bool
  9031. +     */
  9032. +    private $cleanup = false;
  9033. +
  9034. +    /**
  9035. +     * The encoding to use.
  9036. +     *
  9037. +     * @var    string
  9038. +     */
  9039. +    private $encoding = 'UTF-8';
  9040. +
  9041. +    /**
  9042. +     * The HTML to process
  9043. +     *
  9044. +     * @var    string
  9045. +     */
  9046. +    private $html;
  9047. +
  9048. +    /**
  9049. +     * Use inline-styles block as CSS
  9050. +     *
  9051. +     * @var    bool
  9052. +     */
  9053. +    private $useInlineStylesBlock = false;
  9054. +
  9055. +    /**
  9056. +     * Strip original style tags
  9057. +     *
  9058. +     * @var bool
  9059. +     */
  9060. +    private $stripOriginalStyleTags = false;
  9061. +
  9062. +    /**
  9063. +     * Exclude the media queries from the inlined styles
  9064. +     *
  9065. +     * @var bool
  9066. +     */
  9067. +    private $excludeMediaQueries = true;
  9068. +
  9069. +    /**
  9070. +     * Creates an instance, you could set the HTML and CSS here, or load it
  9071. +     * later.
  9072. +     *
  9073. +     * @return void
  9074. +     * @param  string [optional] $html The HTML to process.
  9075. +     * @param  string [optional] $css  The CSS to use.
  9076. +     */
  9077. +    public function __construct($html = null, $css = null)
  9078. +    {
  9079. +        if ($html !== null) {
  9080. +            $this->setHTML($html);
  9081. +        }
  9082. +        if ($css !== null) {
  9083. +            $this->setCSS($css);
  9084. +        }
  9085. +    }
  9086. +
  9087. +    /**
  9088. +     * Cleanup the generated HTML
  9089. +     *
  9090. +     * @return string
  9091. +     * @param  string $html The HTML to cleanup.
  9092. +     */
  9093. +    private function cleanupHTML($html)
  9094. +    {
  9095. +        // remove classes
  9096. +        $html = preg_replace('/(\s)+class="(.*)"(\s)*/U', ' ', $html);
  9097. +
  9098. +        // remove IDs
  9099. +        $html = preg_replace('/(\s)+id="(.*)"(\s)*/U', ' ', $html);
  9100. +
  9101. +        // return
  9102. +        return $html;
  9103. +    }
  9104. +
  9105. +    /**
  9106. +     * Converts the loaded HTML into an HTML-string with inline styles based on the loaded CSS
  9107. +     *
  9108. +     * @return string
  9109. +     * @param  bool [optional] $outputXHTML Should we output valid XHTML?
  9110. +     */
  9111. +    public function convert($outputXHTML = false)
  9112. +    {
  9113. +        // redefine
  9114. +        $outputXHTML = (bool) $outputXHTML;
  9115. +
  9116. +        // validate
  9117. +        if ($this->html == null) {
  9118. +            throw new Exception('No HTML provided.');
  9119. +        }
  9120. +
  9121. +        // should we use inline style-block
  9122. +        if ($this->useInlineStylesBlock) {
  9123. +            // init var
  9124. +            $matches = array();
  9125. +
  9126. +            // match the style blocks
  9127. +            preg_match_all('|<style(.*)>(.*)</style>|isU', $this->html, $matches);
  9128. +
  9129. +            // any style-blocks found?
  9130. +            if (!empty($matches[2])) {
  9131. +                // add
  9132. +                foreach ($matches[2] as $match) {
  9133. +                    $this->css .= trim($match) . "\n";
  9134. +                }
  9135. +            }
  9136. +        }
  9137. +
  9138. +        // process css
  9139. +        $this->processCSS();
  9140. +
  9141. +        // create new DOMDocument
  9142. +        $document = new \DOMDocument('1.0', $this->getEncoding());
  9143. +
  9144. +        // set error level
  9145. +        libxml_use_internal_errors(true);
  9146. +
  9147. +        // load HTML
  9148. +        $document->loadHTML($this->html);
  9149. +
  9150. +        // create new XPath
  9151. +        $xPath = new \DOMXPath($document);
  9152. +
  9153. +        // any rules?
  9154. +        if (!empty($this->cssRules)) {
  9155. +            // loop rules
  9156. +            foreach ($this->cssRules as $rule) {
  9157. +                try {
  9158. +                    $query = CssSelector::toXPath($rule['selector']);
  9159. +                } catch (ExceptionInterface $e) {
  9160. +                    continue;
  9161. +                }
  9162. +
  9163. +                // search elements
  9164. +                $elements = $xPath->query($query);
  9165. +
  9166. +                // validate elements
  9167. +                if ($elements === false) {
  9168. +                    continue;
  9169. +                }
  9170. +
  9171. +                // loop found elements
  9172. +                foreach ($elements as $element) {
  9173. +                    // no styles stored?
  9174. +                    if ($element->attributes->getNamedItem(
  9175. +                            'data-css-to-inline-styles-original-styles'
  9176. +                        ) == null
  9177. +                    ) {
  9178. +                        // init var
  9179. +                        $originalStyle = '';
  9180. +                        if ($element->attributes->getNamedItem('style') !== null) {
  9181. +                            $originalStyle = $element->attributes->getNamedItem('style')->value;
  9182. +                        }
  9183. +
  9184. +                        // store original styles
  9185. +                        $element->setAttribute(
  9186. +                            'data-css-to-inline-styles-original-styles',
  9187. +                            $originalStyle
  9188. +                        );
  9189. +
  9190. +                        // clear the styles
  9191. +                        $element->setAttribute('style', '');
  9192. +                    }
  9193. +
  9194. +                    // init var
  9195. +                    $properties = array();
  9196. +
  9197. +                    // get current styles
  9198. +                    $stylesAttribute = $element->attributes->getNamedItem('style');
  9199. +
  9200. +                    // any styles defined before?
  9201. +                    if ($stylesAttribute !== null) {
  9202. +                        // get value for the styles attribute
  9203. +                        $definedStyles = (string) $stylesAttribute->value;
  9204. +
  9205. +                        // split into properties
  9206. +                        $definedProperties = (array) explode(';', $definedStyles);
  9207. +
  9208. +                        // loop properties
  9209. +                        foreach ($definedProperties as $property) {
  9210. +                            // validate property
  9211. +                            if ($property == '') {
  9212. +                                continue;
  9213. +                            }
  9214. +
  9215. +                            // split into chunks
  9216. +                            $chunks = (array) explode(':', trim($property), 2);
  9217. +
  9218. +                            // validate
  9219. +                            if (!isset($chunks[1])) {
  9220. +                                continue;
  9221. +                            }
  9222. +
  9223. +                            // loop chunks
  9224. +                            $properties[$chunks[0]] = trim($chunks[1]);
  9225. +                        }
  9226. +                    }
  9227. +
  9228. +                    // add new properties into the list
  9229. +                    foreach ($rule['properties'] as $key => $value) {
  9230. +                        // If one of the rules is already set and is !important, don't apply it,
  9231. +                        // except if the new rule is also important.
  9232. +                        if (
  9233. +                            !isset($properties[$key])
  9234. +                            || stristr($properties[$key], '!important') === false
  9235. +                            || (stristr(implode('', $value), '!important') !== false)
  9236. +                        ) {
  9237. +                            $properties[$key] = $value;
  9238. +                        }
  9239. +                    }
  9240. +
  9241. +                    // build string
  9242. +                    $propertyChunks = array();
  9243. +
  9244. +                    // build chunks
  9245. +                    foreach ($properties as $key => $values) {
  9246. +                        foreach ((array) $values as $value) {
  9247. +                            $propertyChunks[] = $key . ': ' . $value . ';';
  9248. +                        }
  9249. +                    }
  9250. +
  9251. +                    // build properties string
  9252. +                    $propertiesString = implode(' ', $propertyChunks);
  9253. +
  9254. +                    // set attribute
  9255. +                    if ($propertiesString != '') {
  9256. +                        $element->setAttribute('style', $propertiesString);
  9257. +                    }
  9258. +                }
  9259. +            }
  9260. +
  9261. +            // reapply original styles
  9262. +            // search elements
  9263. +            $elements = $xPath->query('//*[@data-css-to-inline-styles-original-styles]');
  9264. +
  9265. +            // loop found elements
  9266. +            foreach ($elements as $element) {
  9267. +                // get the original styles
  9268. +                $originalStyle = $element->attributes->getNamedItem(
  9269. +                    'data-css-to-inline-styles-original-styles'
  9270. +                )->value;
  9271. +
  9272. +                if ($originalStyle != '') {
  9273. +                    $originalProperties = array();
  9274. +                    $originalStyles = (array) explode(';', $originalStyle);
  9275. +
  9276. +                    foreach ($originalStyles as $property) {
  9277. +                        // validate property
  9278. +                        if ($property == '') {
  9279. +                            continue;
  9280. +                        }
  9281. +
  9282. +                        // split into chunks
  9283. +                        $chunks = (array) explode(':', trim($property), 2);
  9284. +
  9285. +                        // validate
  9286. +                        if (!isset($chunks[1])) {
  9287. +                            continue;
  9288. +                        }
  9289. +
  9290. +                        // loop chunks
  9291. +                        $originalProperties[$chunks[0]] = trim($chunks[1]);
  9292. +                    }
  9293. +
  9294. +                    // get current styles
  9295. +                    $stylesAttribute = $element->attributes->getNamedItem('style');
  9296. +                    $properties = array();
  9297. +
  9298. +                    // any styles defined before?
  9299. +                    if ($stylesAttribute !== null) {
  9300. +                        // get value for the styles attribute
  9301. +                        $definedStyles = (string) $stylesAttribute->value;
  9302. +
  9303. +                        // split into properties
  9304. +                        $definedProperties = (array) explode(';', $definedStyles);
  9305. +
  9306. +                        // loop properties
  9307. +                        foreach ($definedProperties as $property) {
  9308. +                            // validate property
  9309. +                            if ($property == '') {
  9310. +                                continue;
  9311. +                            }
  9312. +
  9313. +                            // split into chunks
  9314. +                            $chunks = (array) explode(':', trim($property), 2);
  9315. +
  9316. +                            // validate
  9317. +                            if (!isset($chunks[1])) {
  9318. +                                continue;
  9319. +                            }
  9320. +
  9321. +                            // loop chunks
  9322. +                            $properties[$chunks[0]] = trim($chunks[1]);
  9323. +                        }
  9324. +                    }
  9325. +
  9326. +                    // add new properties into the list
  9327. +                    foreach ($originalProperties as $key => $value) {
  9328. +                        $properties[$key] = $value;
  9329. +                    }
  9330. +
  9331. +                    // build string
  9332. +                    $propertyChunks = array();
  9333. +
  9334. +                    // build chunks
  9335. +                    foreach ($properties as $key => $values) {
  9336. +                        foreach ((array) $values as $value) {
  9337. +                            $propertyChunks[] = $key . ': ' . $value . ';';
  9338. +                        }
  9339. +                    }
  9340. +
  9341. +                    // build properties string
  9342. +                    $propertiesString = implode(' ', $propertyChunks);
  9343. +
  9344. +                    // set attribute
  9345. +                    if ($propertiesString != '') {
  9346. +                        $element->setAttribute(
  9347. +                            'style',
  9348. +                            $propertiesString
  9349. +                        );
  9350. +                    }
  9351. +                }
  9352. +
  9353. +                // remove placeholder
  9354. +                $element->removeAttribute(
  9355. +                    'data-css-to-inline-styles-original-styles'
  9356. +                );
  9357. +            }
  9358. +        }
  9359. +
  9360. +        // strip original style tags if we need to
  9361. +        if ($this->stripOriginalStyleTags) {
  9362. +            $this->stripOriginalStyleTags($xPath);
  9363. +        }
  9364. +        
  9365. +        // should we output XHTML?
  9366. +        if ($outputXHTML) {
  9367. +            // set formating
  9368. +            $document->formatOutput = true;
  9369. +
  9370. +            // get the HTML as XML
  9371. +            $html = $document->saveXML(null, LIBXML_NOEMPTYTAG);
  9372. +
  9373. +            // get start of the XML-declaration
  9374. +            $startPosition = strpos($html, '<?xml');
  9375. +
  9376. +            // valid start position?
  9377. +            if ($startPosition !== false) {
  9378. +                // get end of the xml-declaration
  9379. +                $endPosition = strpos($html, '?>', $startPosition);
  9380. +
  9381. +                // remove the XML-header
  9382. +                $html = ltrim(substr($html, $endPosition + 1));
  9383. +            }
  9384. +        } // just regular HTML 4.01 as it should be used in newsletters
  9385. +        else {
  9386. +            // get the HTML
  9387. +            $html = $document->saveHTML();
  9388. +        }
  9389. +
  9390. +        // cleanup the HTML if we need to
  9391. +        if ($this->cleanup) {
  9392. +            $html = $this->cleanupHTML($html);
  9393. +        }
  9394. +
  9395. +        // return
  9396. +        return $html;
  9397. +    }
  9398. +
  9399. +    /**
  9400. +     * Get the encoding to use
  9401. +     *
  9402. +     * @return string
  9403. +     */
  9404. +    private function getEncoding()
  9405. +    {
  9406. +        return $this->encoding;
  9407. +    }
  9408. +
  9409. +    /**
  9410. +     * Process the loaded CSS
  9411. +     *
  9412. +     * @return void
  9413. +     */
  9414. +    private function processCSS()
  9415. +    {
  9416. +        // init vars
  9417. +        $css = (string) $this->css;
  9418. +
  9419. +        // remove newlines
  9420. +        $css = str_replace(array("\r", "\n"), '', $css);
  9421. +
  9422. +        // replace double quotes by single quotes
  9423. +        $css = str_replace('"', '\'', $css);
  9424. +
  9425. +        // remove comments
  9426. +        $css = preg_replace('|/\*.*?\*/|', '', $css);
  9427. +
  9428. +        // remove spaces
  9429. +        $css = preg_replace('/\s\s+/', ' ', $css);
  9430. +
  9431. +        if ($this->excludeMediaQueries) {
  9432. +            $css = preg_replace('/@media [^{]*{([^{}]|{[^{}]*})*}/', '', $css);
  9433. +        }
  9434. +
  9435. +        // rules are splitted by }
  9436. +        $rules = (array) explode('}', $css);
  9437. +
  9438. +        // init var
  9439. +        $i = 1;
  9440. +
  9441. +        // loop rules
  9442. +        foreach ($rules as $rule) {
  9443. +            // split into chunks
  9444. +            $chunks = explode('{', $rule);
  9445. +
  9446. +            // invalid rule?
  9447. +            if (!isset($chunks[1])) {
  9448. +                continue;
  9449. +            }
  9450. +
  9451. +            // set the selectors
  9452. +            $selectors = trim($chunks[0]);
  9453. +
  9454. +            // get cssProperties
  9455. +            $cssProperties = trim($chunks[1]);
  9456. +
  9457. +            // split multiple selectors
  9458. +            $selectors = (array) explode(',', $selectors);
  9459. +
  9460. +            // loop selectors
  9461. +            foreach ($selectors as $selector) {
  9462. +                // cleanup
  9463. +                $selector = trim($selector);
  9464. +
  9465. +                // build an array for each selector
  9466. +                $ruleSet = array();
  9467. +
  9468. +                // store selector
  9469. +                $ruleSet['selector'] = $selector;
  9470. +
  9471. +                // process the properties
  9472. +                $ruleSet['properties'] = $this->processCSSProperties(
  9473. +                    $cssProperties
  9474. +                );
  9475. +
  9476. +                // calculate specificity
  9477. +                $ruleSet['specificity'] = Specificity::fromSelector($selector);
  9478. +
  9479. +                // remember the order in which the rules appear
  9480. +                $ruleSet['order'] = $i;
  9481. +
  9482. +                // add into global rules
  9483. +                $this->cssRules[] = $ruleSet;
  9484. +            }
  9485. +
  9486. +            // increment
  9487. +            $i++;
  9488. +        }
  9489. +
  9490. +        // sort based on specificity
  9491. +        if (!empty($this->cssRules)) {
  9492. +            usort($this->cssRules, array(__CLASS__, 'sortOnSpecificity'));
  9493. +        }
  9494. +    }
  9495. +
  9496. +    /**
  9497. +     * Process the CSS-properties
  9498. +     *
  9499. +     * @return array
  9500. +     * @param  string $propertyString The CSS-properties.
  9501. +     */
  9502. +    private function processCSSProperties($propertyString)
  9503. +    {
  9504. +        // split into chunks
  9505. +        $properties = (array) explode(';', $propertyString);
  9506. +
  9507. +        // init var
  9508. +        $pairs = array();
  9509. +
  9510. +        // loop properties
  9511. +        foreach ($properties as $property) {
  9512. +            // split into chunks
  9513. +            $chunks = (array) explode(':', $property, 2);
  9514. +
  9515. +            // validate
  9516. +            if (!isset($chunks[1])) {
  9517. +                continue;
  9518. +            }
  9519. +
  9520. +            // cleanup
  9521. +            $chunks[0] = trim($chunks[0]);
  9522. +            $chunks[1] = trim($chunks[1]);
  9523. +
  9524. +            // add to pairs array
  9525. +            if (!isset($pairs[$chunks[0]]) ||
  9526. +                !in_array($chunks[1], $pairs[$chunks[0]])
  9527. +            ) {
  9528. +                $pairs[$chunks[0]][] = $chunks[1];
  9529. +            }
  9530. +        }
  9531. +
  9532. +        // sort the pairs
  9533. +        ksort($pairs);
  9534. +
  9535. +        // return
  9536. +        return $pairs;
  9537. +    }
  9538. +
  9539. +    /**
  9540. +     * Should the IDs and classes be removed?
  9541. +     *
  9542. +     * @return void
  9543. +     * @param  bool [optional] $on Should we enable cleanup?
  9544. +     */
  9545. +    public function setCleanup($on = true)
  9546. +    {
  9547. +        $this->cleanup = (bool) $on;
  9548. +    }
  9549. +
  9550. +    /**
  9551. +     * Set CSS to use
  9552. +     *
  9553. +     * @return void
  9554. +     * @param  string $css The CSS to use.
  9555. +     */
  9556. +    public function setCSS($css)
  9557. +    {
  9558. +        $this->css = (string) $css;
  9559. +    }
  9560. +
  9561. +    /**
  9562. +     * Set the encoding to use with the DOMDocument
  9563. +     *
  9564. +     * @return void
  9565. +     * @param  string $encoding The encoding to use.
  9566. +     *
  9567. +     * @deprecated Doesn't have any effect
  9568. +     */
  9569. +    public function setEncoding($encoding)
  9570. +    {
  9571. +        $this->encoding = (string) $encoding;
  9572. +    }
  9573. +
  9574. +    /**
  9575. +     * Set HTML to process
  9576. +     *
  9577. +     * @return void
  9578. +     * @param  string $html The HTML to process.
  9579. +     */
  9580. +    public function setHTML($html)
  9581. +    {
  9582. +        $this->html = (string) $html;
  9583. +    }
  9584. +
  9585. +    /**
  9586. +     * Set use of inline styles block
  9587. +     * If this is enabled the class will use the style-block in the HTML.
  9588. +     *
  9589. +     * @return void
  9590. +     * @param  bool [optional] $on Should we process inline styles?
  9591. +     */
  9592. +    public function setUseInlineStylesBlock($on = true)
  9593. +    {
  9594. +        $this->useInlineStylesBlock = (bool) $on;
  9595. +    }
  9596. +
  9597. +    /**
  9598. +     * Set strip original style tags
  9599. +     * If this is enabled the class will remove all style tags in the HTML.
  9600. +     *
  9601. +     * @return void
  9602. +     * @param  bool [optional] $on Should we process inline styles?
  9603. +     */
  9604. +    public function setStripOriginalStyleTags($on = true)
  9605. +    {
  9606. +        $this->stripOriginalStyleTags = (bool) $on;
  9607. +    }
  9608. +
  9609. +    /**
  9610. +     * Set exclude media queries
  9611. +     *
  9612. +     * If this is enabled the media queries will be removed before inlining the rules
  9613. +     *
  9614. +     * @return void
  9615. +     * @param bool [optional] $on
  9616. +     */
  9617. +    public function setExcludeMediaQueries($on = true)
  9618. +    {
  9619. +        $this->excludeMediaQueries = (bool) $on;
  9620. +    }
  9621. +
  9622. +    /**
  9623. +     * Strip style tags into the generated HTML
  9624. +     *
  9625. +     * @return string
  9626. +     * @param  \DOMXPath $xPath The DOMXPath for the entire document.
  9627. +     */
  9628. +    private function stripOriginalStyleTags(\DOMXPath $xPath)
  9629. +    {
  9630. +        // Get all style tags
  9631. +        $nodes = $xPath->query('descendant-or-self::style');
  9632. +
  9633. +        foreach ($nodes as $node) {
  9634. +            if ($this->excludeMediaQueries) {
  9635. +                //Search for Media Queries
  9636. +                preg_match_all('/@media [^{]*{([^{}]|{[^{}]*})*}/', $node->nodeValue, $mqs);
  9637. +
  9638. +                // Replace the nodeValue with just the Media Queries
  9639. +                $node->nodeValue = implode("\n", $mqs[0]);
  9640. +            } else {
  9641. +                // Remove the entire style tag
  9642. +                $node->parentNode->removeChild($node);
  9643. +            }
  9644. +        }
  9645. +    }
  9646. +
  9647. +    /**
  9648. +     * Sort an array on the specificity element
  9649. +     *
  9650. +     * @return int
  9651. +     * @param  array $e1 The first element.
  9652. +     * @param  array $e2 The second element.
  9653. +     */
  9654. +    private static function sortOnSpecificity($e1, $e2)
  9655. +    {
  9656. +        // Compare the specificity
  9657. +        $value = $e1['specificity']->compareTo($e2['specificity']);
  9658. +
  9659. +        // if the specificity is the same, use the order in which the element appeared
  9660. +        if ($value === 0) {
  9661. +            $value = $e1['order'] - $e2['order'];
  9662. +        }
  9663. +
  9664. +        return $value;
  9665. +    }
  9666. +}
  9667. 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
  9668. --- sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Exception.php   1970-01-01 01:00:00.000000000 +0100
  9669. +++ sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Exception.php  2014-11-19 15:53:57.088099921 +0100
  9670. @@ -0,0 +1,11 @@
  9671. +<?php
  9672. +namespace TijsVerkoyen\CssToInlineStyles;
  9673. +
  9674. +/**
  9675. + * CssToInlineStyles Exception class
  9676. + *
  9677. + * @author    Tijs Verkoyen <php-css-to-inline-styles@verkoyen.eu>
  9678. + */
  9679. +class Exception extends \Exception
  9680. +{
  9681. +}
  9682. 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
  9683. --- sendy/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Specificity.php 1970-01-01 01:00:00.000000000 +0100
  9684. +++ sendy-modified/includes/vendor/tijsverkoyen/css-to-inline-styles/src/Specificity.php    2014-11-19 15:53:56.928099920 +0100
  9685. @@ -0,0 +1,133 @@
  9686. +<?php
  9687. +namespace TijsVerkoyen\CssToInlineStyles;
  9688. +
  9689. +/**
  9690. + * CSS to Inline Styles Specificity class.
  9691. + *
  9692. + * Compare specificity based on the CSS3 spec.
  9693. + *
  9694. + * @see http://www.w3.org/TR/selectors/#specificity
  9695. + *
  9696. + */
  9697. +class Specificity
  9698. +{
  9699. +
  9700. +    /**
  9701. +     * The number of ID selectors in the selector
  9702. +     *
  9703. +     * @var int
  9704. +     */
  9705. +    private $a;
  9706. +
  9707. +    /**
  9708. +     *
  9709. +     * The number of class selectors, attributes selectors, and pseudo-classes in the selector
  9710. +     *
  9711. +     * @var int
  9712. +     */
  9713. +    private $b;
  9714. +
  9715. +    /**
  9716. +     * The number of type selectors and pseudo-elements in the selector
  9717. +     *
  9718. +     * @var int
  9719. +     */
  9720. +    private $c;
  9721. +
  9722. +    /**
  9723. +     * @param int $a The number of ID selectors in the selector
  9724. +     * @param int $b The number of class selectors, attributes selectors, and pseudo-classes in the selector
  9725. +     * @param int $c The number of type selectors and pseudo-elements in the selector
  9726. +     */
  9727. +    public function __construct($a = 0, $b = 0, $c = 0)
  9728. +    {
  9729. +        $this->a = $a;
  9730. +        $this->b = $b;
  9731. +        $this->c = $c;
  9732. +    }
  9733. +
  9734. +    /**
  9735. +     * Increase the current specificity by adding the three values
  9736. +     *
  9737. +     * @param int $a The number of ID selectors in the selector
  9738. +     * @param int $b The number of class selectors, attributes selectors, and pseudo-classes in the selector
  9739. +     * @param int $c The number of type selectors and pseudo-elements in the selector
  9740. +     */
  9741. +    public function increase($a, $b, $c)
  9742. +    {
  9743. +        $this->a += $a;
  9744. +        $this->b += $b;
  9745. +        $this->c += $c;
  9746. +    }
  9747. +
  9748. +    /**
  9749. +     * Get the specificity values as an array
  9750. +     *
  9751. +     * @return array
  9752. +     */
  9753. +    public function getValues()
  9754. +    {
  9755. +        return array($this->a, $this->b, $this->c);
  9756. +    }
  9757. +
  9758. +    /**
  9759. +     * Calculate the specificity based on a CSS Selector string,
  9760. +     * Based on the patterns from premailer/css_parser by Alex Dunae
  9761. +     *
  9762. +     * @see https://github.com/premailer/css_parser/blob/master/lib/css_parser/regexps.rb
  9763. +     * @param string $selector
  9764. +     * @return static
  9765. +     */
  9766. +    public static function fromSelector($selector)
  9767. +    {
  9768. +        $pattern_a = "  \#";
  9769. +        $pattern_b = "  (\.[\w]+)                     # classes
  9770. +                        |
  9771. +                        \[(\w+)                       # attributes
  9772. +                        |
  9773. +                        (\:(                          # pseudo classes
  9774. +                          link|visited|active
  9775. +                          |hover|focus
  9776. +                          |lang
  9777. +                          |target
  9778. +                          |enabled|disabled|checked|indeterminate
  9779. +                          |root
  9780. +                          |nth-child|nth-last-child|nth-of-type|nth-last-of-type
  9781. +                          |first-child|last-child|first-of-type|last-of-type
  9782. +                          |only-child|only-of-type
  9783. +                          |empty|contains
  9784. +                        ))";
  9785. +
  9786. +        $pattern_c = "  ((^|[\s\+\>\~]+)[\w]+       # elements
  9787. +                        |
  9788. +                        \:{1,2}(                    # pseudo-elements
  9789. +                          after|before
  9790. +                          |first-letter|first-line
  9791. +                          |selection
  9792. +                        )
  9793. +                      )";
  9794. +
  9795. +        return new static(
  9796. +            preg_match_all("/{$pattern_a}/ix", $selector, $matches),
  9797. +            preg_match_all("/{$pattern_b}/ix", $selector, $matches),
  9798. +            preg_match_all("/{$pattern_c}/ix", $selector, $matches)
  9799. +        );
  9800. +    }
  9801. +
  9802. +    /**
  9803. +     * Returns <0 when $specificity is greater, 0 when equal, >0 when smaller
  9804. +     *
  9805. +     * @param Specificity $specificity
  9806. +     * @return int
  9807. +     */
  9808. +    public function compareTo(Specificity $specificity)
  9809. +    {
  9810. +        if ($this->a !== $specificity->a) {
  9811. +            return $this->a - $specificity->a;
  9812. +        } elseif ($this->b !== $specificity->b) {
  9813. +            return $this->b - $specificity->b;
  9814. +        } else {
  9815. +            return $this->c - $specificity->c;
  9816. +        }
  9817. +    }
  9818. +}
  9819. diff -uNr sendy/scheduled.php sendy-modified/scheduled.php
  9820. --- sendy/scheduled.php 2014-08-14 14:10:12.000000000 +0200
  9821. +++ sendy-modified/scheduled.php    2014-11-19 15:52:49.760099513 +0100
  9822. @@ -1,5 +1,6 @@
  9823.  <?php ini_set('display_errors', 0);?>
  9824.  <?php include('includes/helpers/class.phpmailer.php');?>
  9825. +<?php include('includes/inline_css.php');?>
  9826.  <?php
  9827.     include('includes/config.php');
  9828.     //--------------------------------------------------------------//
  9829. @@ -482,8 +483,10 @@
  9830.                         $plain_treated = str_replace($unconverted_date, $converted_date, $plain_treated);
  9831.                         $title_treated = str_replace($unconverted_date, $converted_date, $title_treated);
  9832.                        
  9833. +                        $html_treated = inline_css($html_treated);
  9834. +
  9835.                         //add tracking 1 by 1px image
  9836. -                       $html_treated .= '<img src="'.APP_PATH.'/t/'.short($campaign_id).'/'.short($subscriber_id).'" alt=""/>';
  9837. +                       $html_treated .= '<img src="'.APP_PATH.'/t/'.short($campaign_id).'/'.short($subscriber_id).'" alt="" width="1" height="1"/>';
  9838.                        
  9839.                         //Get server path
  9840.                         $server_path_array = explode('scheduled.php', $_SERVER['SCRIPT_FILENAME']);
  9841. @@ -825,4 +828,4 @@
  9842.             }
  9843.         }  
  9844.     }
  9845. -?>
  9846. \ No newline at end of file
  9847. +?>
  9848. diff -uNr sendy/w.php sendy-modified/w.php
  9849. --- sendy/w.php 2014-03-25 01:00:14.000000000 +0100
  9850. +++ sendy-modified/w.php    2014-11-19 15:52:51.276099522 +0100
  9851. @@ -1,6 +1,7 @@
  9852.  <?php
  9853.     ini_set('display_errors', 0);
  9854.     include('includes/config.php');
  9855. +    include('includes/inline_css.php');
  9856.     //--------------------------------------------------------------//
  9857.     function dbConnect() { //Connect to database
  9858.     //--------------------------------------------------------------//
  9859. @@ -118,7 +119,7 @@
  9860.                 //convert date tags
  9861.                 convert_date_tags();
  9862.                
  9863. -               echo $html;
  9864. +               echo inline_css($html);
  9865.                 exit;
  9866.             }
  9867.         }  
  9868. @@ -306,5 +307,5 @@
  9869.     $r = mysqli_query($mysqli, $q);
  9870.     if ($r){}
  9871.    
  9872. -   echo $html;
  9873. -?>
  9874. \ No newline at end of file
  9875. +   echo inline_css($html);
  9876. +?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement