Przeglądaj źródła

post-to-post update 1.7

tags/0.9.1^2
Alej 4 lat temu
rodzic
commit
9f1ef2f8b3
46 zmienionych plików z 394 dodań i 318 usunięć
  1. 11
    2
      plugins/posts-to-posts/composer.json
  2. 2
    2
      plugins/posts-to-posts/posts-to-posts.php
  3. 10
    7
      plugins/posts-to-posts/readme.txt
  4. 0
    26
      plugins/posts-to-posts/vendor/mustache/mustache/.php_cs
  5. 0
    13
      plugins/posts-to-posts/vendor/mustache/mustache/.styleci.yml
  6. 0
    19
      plugins/posts-to-posts/vendor/mustache/mustache/.travis.yml
  7. 0
    35
      plugins/posts-to-posts/vendor/mustache/mustache/CONTRIBUTING.md
  8. 6
    4
      plugins/posts-to-posts/vendor/mustache/mustache/README.md
  9. 2
    2
      plugins/posts-to-posts/vendor/mustache/mustache/composer.json
  10. 0
    17
      plugins/posts-to-posts/vendor/mustache/mustache/phpunit.xml.dist
  11. 16
    2
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Autoloader.php
  12. 8
    1
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Cache.php
  13. 2
    2
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Cache/AbstractCache.php
  14. 9
    3
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Cache/FilesystemCache.php
  15. 1
    1
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Cache/NoopCache.php
  16. 45
    37
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Compiler.php
  17. 3
    3
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Context.php
  18. 63
    21
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Engine.php
  19. 1
    1
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception.php
  20. 1
    1
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/InvalidArgumentException.php
  21. 1
    1
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/LogicException.php
  22. 1
    1
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/RuntimeException.php
  23. 10
    5
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/SyntaxException.php
  24. 10
    4
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/UnknownFilterException.php
  25. 10
    4
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/UnknownHelperException.php
  26. 10
    4
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/UnknownTemplateException.php
  27. 3
    3
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/HelperCollection.php
  28. 33
    6
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/LambdaHelper.php
  29. 3
    3
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader.php
  30. 2
    2
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/ArrayLoader.php
  31. 2
    2
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/CascadingLoader.php
  32. 17
    6
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/FilesystemLoader.php
  33. 3
    3
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/InlineLoader.php
  34. 1
    1
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/MutableLoader.php
  35. 1
    1
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/StringLoader.php
  36. 1
    1
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Logger.php
  37. 1
    1
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Logger/AbstractLogger.php
  38. 7
    7
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Logger/StreamLogger.php
  39. 8
    8
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Parser.php
  40. 3
    4
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Template.php
  41. 71
    46
      plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Tokenizer.php
  42. 7
    1
      plugins/posts-to-posts/vendor/scribu/lib-posts-to-posts/composer.json
  43. 1
    1
      plugins/posts-to-posts/vendor/scribu/lib-posts-to-posts/side-post.php
  44. 3
    3
      plugins/posts-to-posts/vendor/scribu/scb-framework/AdminPage.php
  45. 4
    0
      plugins/posts-to-posts/vendor/scribu/scb-framework/Forms.php
  46. 1
    1
      plugins/posts-to-posts/vendor/scribu/scb-framework/load.php

+ 11
- 2
plugins/posts-to-posts/composer.json Wyświetl plik

@@ -4,13 +4,22 @@
4 4
     "homepage": "http://wordpress.org/plugins/posts-to-posts",
5 5
     "license": "GPL-2.0+",
6 6
     "minimum-stability": "dev",
7
+    "scripts": {
8
+        "zip": "git archive --format zip --output \"../../posts-to-posts.zip\" master"
9
+    },
7 10
     "require": {
8 11
         "composer/installers": "~1.0",
12
+        "scribu/lib-posts-to-posts": "dev-master",
13
+        "mustache/mustache": "~2.6"
9 14
     },
10 15
     "repositories": [
11 16
         {
12 17
             "type": "vcs",
13
-            "url": "https://github.com/scribu/wp-lib-posts-to-posts"
18
+            "url": "https://github.com/jeffreyvr/wp-lib-posts-to-posts"
19
+        },
20
+        {
21
+            "type": "vcs",
22
+            "url": "https://github.com/jeffreyvr/wp-scb-framework"
14 23
         }
15 24
     ]
16
-}
25
+}

+ 2
- 2
plugins/posts-to-posts/posts-to-posts.php Wyświetl plik

@@ -2,7 +2,7 @@
2 2
 /*
3 3
 Plugin Name: Posts 2 Posts
4 4
 Description: Create many-to-many relationships between all types of posts.
5
-Version: 1.6.6
5
+Version: 1.7
6 6
 Author: scribu
7 7
 Author URI: http://scribu.net/
8 8
 Plugin URI: http://scribu.net/wordpress/posts-to-posts
@@ -10,7 +10,7 @@ Text Domain: posts-to-posts
10 10
 Domain Path: /lang
11 11
 */
12 12
 
13
-define( 'P2P_PLUGIN_VERSION', '1.6.6' );
13
+define( 'P2P_PLUGIN_VERSION', '1.7' );
14 14
 
15 15
 define( 'P2P_TEXTDOMAIN', 'posts-to-posts' );
16 16
 

+ 10
- 7
plugins/posts-to-posts/readme.txt Wyświetl plik

@@ -1,14 +1,14 @@
1 1
 === Posts 2 Posts ===
2 2
 
3 3
 Contributors: scribu, ciobi, ayecode, stiofansisland
4
-Tags: connections, custom post types, relationships, many-to-many, users  
5
-Requires at least: 3.9  
4
+Tags: connections, custom post types, relationships, many-to-many, users
5
+Requires at least: 4.5
6 6
 Requires PHP: 5.6
7
-Tested up to: 5.4
8
-Stable tag: 1.6.6
7
+Tested up to: 5.9
8
+Stable tag: 1.7
9 9
 
10
-License: GPLv2 or later  
11
-License URI: http://www.gnu.org/licenses/gpl-2.0.html  
10
+License: GPLv2 or later
11
+License URI: http://www.gnu.org/licenses/gpl-2.0.html
12 12
 
13 13
 Efficient many-to-many connections between posts, pages, custom post types, users.
14 14
 
@@ -42,7 +42,7 @@ Links: [**Documentation**](http://github.com/scribu/wp-posts-to-posts/wiki) | [P
42 42
 See [Installing Plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins).
43 43
 
44 44
 After activating it, refer to the [Basic usage](https://github.com/scribu/wp-posts-to-posts/wiki/Basic-usage) tutorial.
45
- 
45
+
46 46
 Additional info can be found on the [wiki](http://github.com/scribu/wp-posts-to-posts/wiki).
47 47
 
48 48
 == Frequently Asked Questions ==
@@ -61,6 +61,9 @@ Additional info can be found on the [wiki](http://github.com/scribu/wp-posts-to-
61 61
 
62 62
 == Changelog ==
63 63
 
64
+= 1.7 =
65
+* Update Mustache package to support PHP 8.
66
+
64 67
 = 1.6.6 =
65 68
 * AyeCode Ltd have committed to security and maintenance updates - INFO
66 69
 * Deprecated PHP notices showing with latest WordPress - FIXED

+ 0
- 26
plugins/posts-to-posts/vendor/mustache/mustache/.php_cs Wyświetl plik

@@ -1,26 +0,0 @@
1
-<?php
2
-
3
-use Symfony\CS\Config\Config;
4
-use Symfony\CS\FixerInterface;
5
-
6
-$config = Config::create()
7
-    // use symfony level and extra fixers:
8
-    ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
9
-    ->fixers(array(
10
-        '-concat_without_spaces',
11
-        '-pre_increment',
12
-        '-unalign_double_arrow',
13
-        '-unalign_equals',
14
-        'align_double_arrow',
15
-        'concat_with_spaces',
16
-        'ordered_use',
17
-        'strict',
18
-    ))
19
-    ->setUsingLinter(false);
20
-
21
-$finder = $config->getFinder()
22
-    ->in('bin')
23
-    ->in('src')
24
-    ->in('test');
25
-
26
-return $config;

+ 0
- 13
plugins/posts-to-posts/vendor/mustache/mustache/.styleci.yml Wyświetl plik

@@ -1,13 +0,0 @@
1
-preset: symfony
2
-
3
-enabled:
4
-  - align_double_arrow
5
-  - concat_with_spaces
6
-  - ordered_use
7
-  - strict
8
-
9
-disabled:
10
-  - concat_without_spaces
11
-  - pre_increment
12
-  - unalign_double_arrow
13
-  - unalign_equals

+ 0
- 19
plugins/posts-to-posts/vendor/mustache/mustache/.travis.yml Wyświetl plik

@@ -1,19 +0,0 @@
1
-language: php
2
-
3
-install:
4
-  - curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer.phar
5
-
6
-script:
7
-  - phpunit
8
-  - if [[ `php -r "echo version_compare(PHP_VERSION, '5.3.6', '>=') && !defined('HHVM_VERSION');"` ]]; then php php-cs-fixer.phar --diff --dry-run -vv fix; fi
9
-
10
-php:
11
-  - 5.2
12
-  - 5.3
13
-  - 5.4
14
-  - 5.5
15
-  - 5.6
16
-  - 7.0
17
-  - hhvm
18
-
19
-sudo: false

+ 0
- 35
plugins/posts-to-posts/vendor/mustache/mustache/CONTRIBUTING.md Wyświetl plik

@@ -1,35 +0,0 @@
1
-# Contributions welcome!
2
-
3
-
4
-### Here's a quick guide:
5
-
6
- 1. [Fork the repo on GitHub](https://github.com/bobthecow/mustache.php).
7
-
8
- 2. Update submodules: `git submodule update --init`
9
-
10
- 3. Run the test suite. We only take pull requests with passing tests, and it's great to know that you have a clean slate. Make sure you have PHPUnit 3.5+, then run `phpunit` from the project directory.
11
-
12
- 4. Add tests for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, add a test!
13
-
14
- 5. Make the tests pass.
15
-
16
- 6. Push your fork to GitHub and submit a pull request against the `dev` branch.
17
-
18
-
19
-### You can do some things to increase the chance that your pull request is accepted the first time:
20
-
21
- * Submit one pull request per fix or feature.
22
- * To help with that, do all your work in a feature branch (e.g. `feature/my-alsome-feature`).
23
- * Follow the conventions you see used in the project.
24
- * Use `phpcs --standard=PSR2` to check your changes against the coding standard.
25
- * Write tests that fail without your code, and pass with it.
26
- * Don't bump version numbers. Those will be updated — per [semver](http://semver.org) — once your change is merged into `master`.
27
- * Update any documentation: docblocks, README, examples, etc.
28
- * ... Don't update the wiki until your change is merged and released, but make a note in your pull request so we don't forget.
29
-
30
-
31
-### Mustache.php follows the PSR-* coding standards:
32
-
33
- * [PSR-0: Class and file naming conventions](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md)
34
- * [PSR-1: Basic coding standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md)
35
- * [PSR-2: Coding style guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)

+ 6
- 4
plugins/posts-to-posts/vendor/mustache/mustache/README.md Wyświetl plik

@@ -1,10 +1,11 @@
1 1
 Mustache.php
2 2
 ============
3 3
 
4
-A [Mustache](http://mustache.github.com/) implementation in PHP.
4
+A [Mustache](https://mustache.github.io/) implementation in PHP.
5 5
 
6 6
 [![Package version](http://img.shields.io/packagist/v/mustache/mustache.svg?style=flat-square)](https://packagist.org/packages/mustache/mustache)
7 7
 [![Build status](http://img.shields.io/travis/bobthecow/mustache.php/dev.svg?style=flat-square)](http://travis-ci.org/bobthecow/mustache.php)
8
+[![StyleCI](https://styleci.io/repos/569670/shield)](https://styleci.io/repos/569670)
8 9
 [![Monthly downloads](http://img.shields.io/packagist/dm/mustache/mustache.svg?style=flat-square)](https://packagist.org/packages/mustache/mustache)
9 10
 
10 11
 
@@ -15,7 +16,7 @@ A quick example:
15 16
 
16 17
 ```php
17 18
 <?php
18
-$m = new Mustache_Engine;
19
+$m = new Mustache_Engine(array('entity_flags' => ENT_QUOTES));
19 20
 echo $m->render('Hello {{planet}}', array('planet' => 'World!')); // "Hello World!"
20 21
 ```
21 22
 
@@ -52,11 +53,12 @@ And render it:
52 53
 
53 54
 ```php
54 55
 <?php
55
-$m = new Mustache_Engine;
56
+$m = new Mustache_Engine(array('entity_flags' => ENT_QUOTES));
56 57
 $chris = new Chris;
57 58
 echo $m->render($template, $chris);
58 59
 ```
59 60
 
61
+*Note:* we recommend using `ENT_QUOTES` as a default of [entity_flags](https://github.com/bobthecow/mustache.php/wiki#entity_flags) to decrease the chance of Cross-site scripting vulnerability.
60 62
 
61 63
 And That's Not All!
62 64
 -------------------
@@ -67,5 +69,5 @@ Read [the Mustache.php documentation](https://github.com/bobthecow/mustache.php/
67 69
 See Also
68 70
 --------
69 71
 
72
+ * [mustache(5)](http://mustache.github.io/mustache.5.html) man page.
70 73
  * [Readme for the Ruby Mustache implementation](http://github.com/defunkt/mustache/blob/master/README.md).
71
- * [mustache(5)](http://mustache.github.com/mustache.5.html) man page.

+ 2
- 2
plugins/posts-to-posts/vendor/mustache/mustache/composer.json Wyświetl plik

@@ -16,8 +16,8 @@
16 16
         "php": ">=5.2.4"
17 17
     },
18 18
     "require-dev": {
19
-        "phpunit/phpunit": "~3.7|~4.0",
20
-        "fabpot/php-cs-fixer": "~1.6"
19
+        "phpunit/phpunit": "~3.7|~4.0|~5.0",
20
+        "friendsofphp/php-cs-fixer": "~1.11"
21 21
     },
22 22
     "autoload": {
23 23
         "psr-0": { "Mustache": "src/" }

+ 0
- 17
plugins/posts-to-posts/vendor/mustache/mustache/phpunit.xml.dist Wyświetl plik

@@ -1,17 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<phpunit backupGlobals="false" colors="true" bootstrap="./test/bootstrap.php">
3
-	<testsuite name="Mustache">
4
-		<directory suffix="Test.php">./test</directory>
5
-		<exclude>./test/Mustache/Test/FiveThree</exclude>
6
-	</testsuite>
7
-
8
-	<testsuite name="Mustache FiveThree">
9
-		<directory suffix="Test.php" phpVersion="5.3.0" phpVersionOperator=">=">./test/Mustache/Test/FiveThree</directory>
10
-	</testsuite>
11
-
12
-	<filter>
13
-		<whitelist>
14
-			<directory suffix=".php">./src/Mustache</directory>
15
-		</whitelist>
16
-	</filter>
17
-</phpunit>

+ 16
- 2
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Autoloader.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -16,6 +16,14 @@ class Mustache_Autoloader
16 16
 {
17 17
     private $baseDir;
18 18
 
19
+    /**
20
+     * An array where the key is the baseDir and the key is an instance of this
21
+     * class.
22
+     *
23
+     * @var array
24
+     */
25
+    private static $instances;
26
+
19 27
     /**
20 28
      * Autoloader constructor.
21 29
      *
@@ -45,7 +53,13 @@ class Mustache_Autoloader
45 53
      */
46 54
     public static function register($baseDir = null)
47 55
     {
48
-        $loader = new self($baseDir);
56
+        $key = $baseDir ? $baseDir : 0;
57
+
58
+        if (!isset(self::$instances[$key])) {
59
+            self::$instances[$key] = new self($baseDir);
60
+        }
61
+
62
+        $loader = self::$instances[$key];
49 63
         spl_autoload_register(array($loader, 'autoload'));
50 64
 
51 65
         return $loader;

+ 8
- 1
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Cache.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -33,4 +33,11 @@ interface Mustache_Cache
33 33
      * @param string $value
34 34
      */
35 35
     public function cache($key, $value);
36
+
37
+    /**
38
+     * Set a logger instance.
39
+     *
40
+     * @param Mustache_Logger|Psr\Log\LoggerInterface $logger
41
+     */
42
+    public function setLogger($logger = null);
36 43
 }

+ 2
- 2
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Cache/AbstractCache.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -47,7 +47,7 @@ abstract class Mustache_Cache_AbstractCache implements Mustache_Cache
47 47
     /**
48 48
      * Add a log record if logging is enabled.
49 49
      *
50
-     * @param int    $level   The logging level
50
+     * @param string $level   The logging level
51 51
      * @param string $message The log message
52 52
      * @param array  $context The log context
53 53
      */

+ 9
- 3
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Cache/FilesystemCache.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -27,8 +27,8 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
27 27
     /**
28 28
      * Filesystem cache constructor.
29 29
      *
30
-     * @param string $baseDir  Directory for compiled templates.
31
-     * @param int    $fileMode Override default permissions for cache files. Defaults to using the system-defined umask.
30
+     * @param string $baseDir  Directory for compiled templates
31
+     * @param int    $fileMode Override default permissions for cache files. Defaults to using the system-defined umask
32 32
      */
33 33
     public function __construct($baseDir, $fileMode = null)
34 34
     {
@@ -108,9 +108,11 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
108 108
             );
109 109
 
110 110
             @mkdir($dirName, 0777, true);
111
+            // @codeCoverageIgnoreStart
111 112
             if (!is_dir($dirName)) {
112 113
                 throw new Mustache_Exception_RuntimeException(sprintf('Failed to create cache directory "%s".', $dirName));
113 114
             }
115
+            // @codeCoverageIgnoreEnd
114 116
         }
115 117
 
116 118
         return $dirName;
@@ -143,13 +145,17 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
143 145
                 return;
144 146
             }
145 147
 
148
+            // @codeCoverageIgnoreStart
146 149
             $this->log(
147 150
                 Mustache_Logger::ERROR,
148 151
                 'Unable to rename Mustache temp cache file: "{tempName}" -> "{fileName}"',
149 152
                 array('tempName' => $tempFile, 'fileName' => $fileName)
150 153
             );
154
+            // @codeCoverageIgnoreEnd
151 155
         }
152 156
 
157
+        // @codeCoverageIgnoreStart
153 158
         throw new Mustache_Exception_RuntimeException(sprintf('Failed to write cache file "%s".', $fileName));
159
+        // @codeCoverageIgnoreEnd
154 160
     }
155 161
 }

+ 1
- 1
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Cache/NoopCache.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.

+ 45
- 37
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Compiler.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -75,7 +75,7 @@ class Mustache_Compiler
75 75
     /**
76 76
      * Helper function for walking the Mustache token parse tree.
77 77
      *
78
-     * @throws Mustache_Exception_SyntaxException upon encountering unknown token types.
78
+     * @throws Mustache_Exception_SyntaxException upon encountering unknown token types
79 79
      *
80 80
      * @param array $tree  Parse tree of Mustache tokens
81 81
      * @param int   $level (default: 0)
@@ -191,7 +191,6 @@ class Mustache_Compiler
191 191
             {
192 192
                 $this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
193 193
                 $buffer = \'\';
194
-                $newContext = array();
195 194
         %s
196 195
 
197 196
                 return $buffer;
@@ -207,7 +206,6 @@ class Mustache_Compiler
207 206
             public function renderInternal(Mustache_Context $context, $indent = \'\')
208 207
             {
209 208
                 $buffer = \'\';
210
-                $newContext = array();
211 209
         %s
212 210
 
213 211
                 return $buffer;
@@ -240,10 +238,11 @@ class Mustache_Compiler
240 238
         $blockFunction = $context->findInBlock(%s);
241 239
         if (is_callable($blockFunction)) {
242 240
             $buffer .= call_user_func($blockFunction, $context);
243
-        } else {%s
244
-        }
241
+        %s}
245 242
     ';
246 243
 
244
+    const BLOCK_VAR_ELSE = '} else {%s';
245
+
247 246
     /**
248 247
      * Generate Mustache Template inheritance block variable PHP source.
249 248
      *
@@ -261,10 +260,15 @@ class Mustache_Compiler
261 260
     {
262 261
         $id = var_export($id, true);
263 262
 
264
-        return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $this->walk($nodes, $level));
263
+        $else = $this->walk($nodes, $level);
264
+        if ($else !== '') {
265
+            $else = sprintf($this->prepare(self::BLOCK_VAR_ELSE, $level + 1, false, true), $else);
266
+        }
267
+
268
+        return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $else);
265 269
     }
266 270
 
267
-    const BLOCK_ARG = '$newContext[%s] = array($this, \'block%s\');';
271
+    const BLOCK_ARG = '%s => array($this, \'block%s\'),';
268 272
 
269 273
     /**
270 274
      * Generate Mustache Template inheritance block argument PHP source.
@@ -282,10 +286,9 @@ class Mustache_Compiler
282 286
     private function blockArg($nodes, $id, $start, $end, $otag, $ctag, $level)
283 287
     {
284 288
         $key = $this->block($nodes);
285
-        $keystr = var_export($key, true);
286 289
         $id = var_export($id, true);
287 290
 
288
-        return sprintf($this->prepare(self::BLOCK_ARG, 1), $id, $key);
291
+        return sprintf($this->prepare(self::BLOCK_ARG, $level), $id, $key);
289 292
     }
290 293
 
291 294
     const BLOCK_FUNCTION = '
@@ -317,7 +320,6 @@ class Mustache_Compiler
317 320
     }
318 321
 
319 322
     const SECTION_CALL = '
320
-        // %s section
321 323
         $value = $context->%s(%s);%s
322 324
         $buffer .= $this->section%s($context, $indent, $value);
323 325
     ';
@@ -326,14 +328,15 @@ class Mustache_Compiler
326 328
         private function section%s(Mustache_Context $context, $indent, $value)
327 329
         {
328 330
             $buffer = \'\';
331
+
329 332
             if (%s) {
330 333
                 $source = %s;
331
-                $result = call_user_func($value, $source, $this->lambdaHelper);
334
+                $result = (string) call_user_func($value, $source, %s);
332 335
                 if (strpos($result, \'{{\') === false) {
333 336
                     $buffer .= $result;
334 337
                 } else {
335 338
                     $buffer .= $this->mustache
336
-                        ->loadLambda((string) $result%s)
339
+                        ->loadLambda($result%s)
337 340
                         ->renderInternal($context);
338 341
                 }
339 342
             } elseif (!empty($value)) {
@@ -360,40 +363,37 @@ class Mustache_Compiler
360 363
      * @param string   $otag    Current Mustache opening tag
361 364
      * @param string   $ctag    Current Mustache closing tag
362 365
      * @param int      $level
363
-     * @param bool     $arg     (default: false)
364 366
      *
365 367
      * @return string Generated section PHP source code
366 368
      */
367
-    private function section($nodes, $id, $filters, $start, $end, $otag, $ctag, $level, $arg = false)
369
+    private function section($nodes, $id, $filters, $start, $end, $otag, $ctag, $level)
368 370
     {
369 371
         $source   = var_export(substr($this->source, $start, $end - $start), true);
370 372
         $callable = $this->getCallable();
371 373
 
372 374
         if ($otag !== '{{' || $ctag !== '}}') {
373
-            $delims = ', ' . var_export(sprintf('{{= %s %s =}}', $otag, $ctag), true);
375
+            $delimTag = var_export(sprintf('{{= %s %s =}}', $otag, $ctag), true);
376
+            $helper = sprintf('$this->lambdaHelper->withDelimiters(%s)', $delimTag);
377
+            $delims = ', ' . $delimTag;
374 378
         } else {
379
+            $helper = '$this->lambdaHelper';
375 380
             $delims = '';
376 381
         }
377 382
 
378 383
         $key = ucfirst(md5($delims . "\n" . $source));
379 384
 
380 385
         if (!isset($this->sections[$key])) {
381
-            $this->sections[$key] = sprintf($this->prepare(self::SECTION), $key, $callable, $source, $delims, $this->walk($nodes, 2));
386
+            $this->sections[$key] = sprintf($this->prepare(self::SECTION), $key, $callable, $source, $helper, $delims, $this->walk($nodes, 2));
382 387
         }
383 388
 
384
-        if ($arg === true) {
385
-            return $key;
386
-        } else {
387
-            $method  = $this->getFindMethod($id);
388
-            $id      = var_export($id, true);
389
-            $filters = $this->getFilters($filters, $level);
389
+        $method  = $this->getFindMethod($id);
390
+        $id      = var_export($id, true);
391
+        $filters = $this->getFilters($filters, $level);
390 392
 
391
-            return sprintf($this->prepare(self::SECTION_CALL, $level), $id, $method, $id, $filters, $key);
392
-        }
393
+        return sprintf($this->prepare(self::SECTION_CALL, $level), $method, $id, $filters, $key);
393 394
     }
394 395
 
395 396
     const INVERTED_SECTION = '
396
-        // %s inverted section
397 397
         $value = $context->%s(%s);%s
398 398
         if (empty($value)) {
399 399
             %s
@@ -416,7 +416,7 @@ class Mustache_Compiler
416 416
         $id      = var_export($id, true);
417 417
         $filters = $this->getFilters($filters, $level);
418 418
 
419
-        return sprintf($this->prepare(self::INVERTED_SECTION, $level), $id, $method, $id, $filters, $this->walk($nodes, $level));
419
+        return sprintf($this->prepare(self::INVERTED_SECTION, $level), $method, $id, $filters, $this->walk($nodes, $level));
420 420
     }
421 421
 
422 422
     const PARTIAL_INDENT = ', $indent . %s';
@@ -451,15 +451,20 @@ class Mustache_Compiler
451 451
     }
452 452
 
453 453
     const PARENT = '
454
-        %s
455
-
456
-        if ($parent = $this->mustache->LoadPartial(%s)) {
457
-            $context->pushBlockContext($newContext);
454
+        if ($parent = $this->mustache->loadPartial(%s)) {
455
+            $context->pushBlockContext(array(%s
456
+            ));
458 457
             $buffer .= $parent->renderInternal($context, $indent);
459 458
             $context->popBlockContext();
460 459
         }
461 460
     ';
462 461
 
462
+    const PARENT_NO_CONTEXT = '
463
+        if ($parent = $this->mustache->loadPartial(%s)) {
464
+            $buffer .= $parent->renderInternal($context, $indent);
465
+        }
466
+    ';
467
+
463 468
     /**
464 469
      * Generate Mustache Template inheritance parent call PHP source.
465 470
      *
@@ -474,11 +479,14 @@ class Mustache_Compiler
474 479
     {
475 480
         $realChildren = array_filter($children, array(__CLASS__, 'onlyBlockArgs'));
476 481
 
482
+        if (empty($realChildren)) {
483
+            return sprintf($this->prepare(self::PARENT_NO_CONTEXT, $level), var_export($id, true));
484
+        }
485
+
477 486
         return sprintf(
478 487
             $this->prepare(self::PARENT, $level),
479
-            $this->walk($realChildren, $level),
480 488
             var_export($id, true),
481
-            var_export($indent, true)
489
+            $this->walk($realChildren, $level + 1)
482 490
         );
483 491
     }
484 492
 
@@ -487,7 +495,7 @@ class Mustache_Compiler
487 495
      *
488 496
      * @param array $node
489 497
      *
490
-     * @return bool True if $node is a block arg token.
498
+     * @return bool True if $node is a block arg token
491 499
      */
492 500
     private static function onlyBlockArgs(array $node)
493 501
     {
@@ -495,8 +503,8 @@ class Mustache_Compiler
495 503
     }
496 504
 
497 505
     const VARIABLE = '
498
-        $value = $this->resolveValue($context->%s(%s), $context, $indent);%s
499
-        $buffer .= %s%s;
506
+        $value = $this->resolveValue($context->%s(%s), $context);%s
507
+        $buffer .= %s($value === null ? \'\' : %s);
500 508
     ';
501 509
 
502 510
     /**
@@ -615,7 +623,7 @@ class Mustache_Compiler
615 623
     /**
616 624
      * Select the appropriate Context `find` method for a given $id.
617 625
      *
618
-     * The return value will be one of `find`, `findDot` or `last`.
626
+     * The return value will be one of `find`, `findDot`, `findAnchoredDot` or `last`.
619 627
      *
620 628
      * @see Mustache_Context::find
621 629
      * @see Mustache_Context::findDot

+ 3
- 3
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Context.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -150,7 +150,7 @@ class Mustache_Context
150 150
      *
151 151
      * @see Mustache_Context::findDot
152 152
      *
153
-     * @throws Mustache_Exception_InvalidArgumentException if given an invalid anchored dot $id.
153
+     * @throws Mustache_Exception_InvalidArgumentException if given an invalid anchored dot $id
154 154
      *
155 155
      * @param string $id Dotted variable selector
156 156
      *
@@ -182,7 +182,7 @@ class Mustache_Context
182 182
      *
183 183
      * @param string $id
184 184
      *
185
-     * @return mixed Variable value, or '' if not found.
185
+     * @return mixed Variable value, or '' if not found
186 186
      */
187 187
     public function findInBlock($id)
188 188
     {

+ 63
- 21
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Engine.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -23,8 +23,8 @@
23 23
  */
24 24
 class Mustache_Engine
25 25
 {
26
-    const VERSION        = '2.9.0';
27
-    const SPEC_VERSION   = '1.1.2';
26
+    const VERSION        = '2.14.0';
27
+    const SPEC_VERSION   = '1.2.2';
28 28
 
29 29
     const PRAGMA_FILTERS      = 'FILTERS';
30 30
     const PRAGMA_BLOCKS       = 'BLOCKS';
@@ -54,6 +54,7 @@ class Mustache_Engine
54 54
     private $logger;
55 55
     private $strictCallables = false;
56 56
     private $pragmas = array();
57
+    private $delimiters;
57 58
 
58 59
     // Services
59 60
     private $tokenizer;
@@ -81,6 +82,14 @@ class Mustache_Engine
81 82
      *         // sections are often too dynamic to benefit from caching.
82 83
      *         'cache_lambda_templates' => true,
83 84
      *
85
+     *         // Customize the tag delimiters used by this engine instance. Note that overriding here changes the
86
+     *         // delimiters used to parse all templates and partials loaded by this instance. To override just for a
87
+     *         // single template, use an inline "change delimiters" tag at the start of the template file:
88
+     *         //
89
+     *         //     {{=<% %>=}}
90
+     *         //
91
+     *         'delimiters' => '<% %>',
92
+     *
84 93
      *         // A Mustache template loader instance. Uses a StringLoader if not specified.
85 94
      *         'loader' => new Mustache_Loader_FilesystemLoader(dirname(__FILE__).'/views'),
86 95
      *
@@ -126,13 +135,17 @@ class Mustache_Engine
126 135
      *         'pragmas' => [Mustache_Engine::PRAGMA_FILTERS],
127 136
      *     );
128 137
      *
129
-     * @throws Mustache_Exception_InvalidArgumentException If `escape` option is not callable.
138
+     * @throws Mustache_Exception_InvalidArgumentException If `escape` option is not callable
130 139
      *
131 140
      * @param array $options (default: array())
132 141
      */
133 142
     public function __construct(array $options = array())
134 143
     {
135 144
         if (isset($options['template_class_prefix'])) {
145
+            if ((string) $options['template_class_prefix'] === '') {
146
+                throw new Mustache_Exception_InvalidArgumentException('Mustache Constructor "template_class_prefix" must not be empty');
147
+            }
148
+
136 149
             $this->templateClassPrefix = $options['template_class_prefix'];
137 150
         }
138 151
 
@@ -191,6 +204,10 @@ class Mustache_Engine
191 204
             $this->strictCallables = $options['strict_callables'];
192 205
         }
193 206
 
207
+        if (isset($options['delimiters'])) {
208
+            $this->delimiters = $options['delimiters'];
209
+        }
210
+
194 211
         if (isset($options['pragmas'])) {
195 212
             foreach ($options['pragmas'] as $pragma) {
196 213
                 if (!isset(self::$knownPragmas[$pragma])) {
@@ -429,7 +446,7 @@ class Mustache_Engine
429 446
     /**
430 447
      * Set the Mustache Logger instance.
431 448
      *
432
-     * @throws Mustache_Exception_InvalidArgumentException If logger is not an instance of Mustache_Logger or Psr\Log\LoggerInterface.
449
+     * @throws Mustache_Exception_InvalidArgumentException If logger is not an instance of Mustache_Logger or Psr\Log\LoggerInterface
433 450
      *
434 451
      * @param Mustache_Logger|Psr\Log\LoggerInterface $logger
435 452
      */
@@ -589,22 +606,43 @@ class Mustache_Engine
589 606
     /**
590 607
      * Helper method to generate a Mustache template class.
591 608
      *
592
-     * @param string $source
609
+     * This method must be updated any time options are added which make it so
610
+     * the same template could be parsed and compiled multiple different ways.
611
+     *
612
+     * @param string|Mustache_Source $source
593 613
      *
594 614
      * @return string Mustache Template class name
595 615
      */
596 616
     public function getTemplateClassName($source)
597 617
     {
598
-        return $this->templateClassPrefix . md5(sprintf(
599
-            'version:%s,escape:%s,entity_flags:%i,charset:%s,strict_callables:%s,pragmas:%s,source:%s',
600
-            self::VERSION,
601
-            isset($this->escape) ? 'custom' : 'default',
602
-            $this->entityFlags,
603
-            $this->charset,
604
-            $this->strictCallables ? 'true' : 'false',
605
-            implode(' ', $this->getPragmas()),
606
-            $source
607
-        ));
618
+        // For the most part, adding a new option here should do the trick.
619
+        //
620
+        // Pick a value here which is unique for each possible way the template
621
+        // could be compiled... but not necessarily unique per option value. See
622
+        // escape below, which only needs to differentiate between 'custom' and
623
+        // 'default' escapes.
624
+        //
625
+        // Keep this list in alphabetical order :)
626
+        $chunks = array(
627
+            'charset'         => $this->charset,
628
+            'delimiters'      => $this->delimiters ? $this->delimiters : '{{ }}',
629
+            'entityFlags'     => $this->entityFlags,
630
+            'escape'          => isset($this->escape) ? 'custom' : 'default',
631
+            'key'             => ($source instanceof Mustache_Source) ? $source->getKey() : 'source',
632
+            'pragmas'         => $this->getPragmas(),
633
+            'strictCallables' => $this->strictCallables,
634
+            'version'         => self::VERSION,
635
+        );
636
+
637
+        $key = json_encode($chunks);
638
+
639
+        // Template Source instances have already provided their own source key. For strings, just include the whole
640
+        // source string in the md5 hash.
641
+        if (!$source instanceof Mustache_Source) {
642
+            $key .= "\n" . $source;
643
+        }
644
+
645
+        return $this->templateClassPrefix . md5($key);
608 646
     }
609 647
 
610 648
     /**
@@ -681,8 +719,8 @@ class Mustache_Engine
681 719
      * @see Mustache_Engine::loadPartial
682 720
      * @see Mustache_Engine::loadLambda
683 721
      *
684
-     * @param string         $source
685
-     * @param Mustache_Cache $cache  (default: null)
722
+     * @param string|Mustache_Source $source
723
+     * @param Mustache_Cache         $cache  (default: null)
686 724
      *
687 725
      * @return Mustache_Template
688 726
      */
@@ -725,7 +763,7 @@ class Mustache_Engine
725 763
      */
726 764
     private function tokenize($source)
727 765
     {
728
-        return $this->getTokenizer()->scan($source);
766
+        return $this->getTokenizer()->scan($source, $this->delimiters);
729 767
     }
730 768
 
731 769
     /**
@@ -750,13 +788,12 @@ class Mustache_Engine
750 788
      *
751 789
      * @see Mustache_Compiler::compile
752 790
      *
753
-     * @param string $source
791
+     * @param string|Mustache_Source $source
754 792
      *
755 793
      * @return string generated Mustache template class code
756 794
      */
757 795
     private function compile($source)
758 796
     {
759
-        $tree = $this->parse($source);
760 797
         $name = $this->getTemplateClassName($source);
761 798
 
762 799
         $this->log(
@@ -765,6 +802,11 @@ class Mustache_Engine
765 802
             array('className' => $name)
766 803
         );
767 804
 
805
+        if ($source instanceof Mustache_Source) {
806
+            $source = $source->getSource();
807
+        }
808
+        $tree = $this->parse($source);
809
+
768 810
         $compiler = $this->getCompiler();
769 811
         $compiler->setPragmas($this->getPragmas());
770 812
 

+ 1
- 1
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.

+ 1
- 1
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/InvalidArgumentException.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.

+ 1
- 1
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/LogicException.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.

+ 1
- 1
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/RuntimeException.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.

+ 10
- 5
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/SyntaxException.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -17,13 +17,18 @@ class Mustache_Exception_SyntaxException extends LogicException implements Musta
17 17
     protected $token;
18 18
 
19 19
     /**
20
-     * @param string $msg
21
-     * @param array  $token
20
+     * @param string    $msg
21
+     * @param array     $token
22
+     * @param Exception $previous
22 23
      */
23
-    public function __construct($msg, array $token)
24
+    public function __construct($msg, array $token, Exception $previous = null)
24 25
     {
25 26
         $this->token = $token;
26
-        parent::__construct($msg);
27
+        if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
28
+            parent::__construct($msg, 0, $previous);
29
+        } else {
30
+            parent::__construct($msg); // @codeCoverageIgnore
31
+        }
27 32
     }
28 33
 
29 34
     /**

+ 10
- 4
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/UnknownFilterException.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -17,12 +17,18 @@ class Mustache_Exception_UnknownFilterException extends UnexpectedValueException
17 17
     protected $filterName;
18 18
 
19 19
     /**
20
-     * @param string $filterName
20
+     * @param string    $filterName
21
+     * @param Exception $previous
21 22
      */
22
-    public function __construct($filterName)
23
+    public function __construct($filterName, Exception $previous = null)
23 24
     {
24 25
         $this->filterName = $filterName;
25
-        parent::__construct(sprintf('Unknown filter: %s', $filterName));
26
+        $message = sprintf('Unknown filter: %s', $filterName);
27
+        if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
28
+            parent::__construct($message, 0, $previous);
29
+        } else {
30
+            parent::__construct($message); // @codeCoverageIgnore
31
+        }
26 32
     }
27 33
 
28 34
     public function getFilterName()

+ 10
- 4
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/UnknownHelperException.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -17,12 +17,18 @@ class Mustache_Exception_UnknownHelperException extends InvalidArgumentException
17 17
     protected $helperName;
18 18
 
19 19
     /**
20
-     * @param string $helperName
20
+     * @param string    $helperName
21
+     * @param Exception $previous
21 22
      */
22
-    public function __construct($helperName)
23
+    public function __construct($helperName, Exception $previous = null)
23 24
     {
24 25
         $this->helperName = $helperName;
25
-        parent::__construct(sprintf('Unknown helper: %s', $helperName));
26
+        $message = sprintf('Unknown helper: %s', $helperName);
27
+        if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
28
+            parent::__construct($message, 0, $previous);
29
+        } else {
30
+            parent::__construct($message); // @codeCoverageIgnore
31
+        }
26 32
     }
27 33
 
28 34
     public function getHelperName()

+ 10
- 4
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Exception/UnknownTemplateException.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -17,12 +17,18 @@ class Mustache_Exception_UnknownTemplateException extends InvalidArgumentExcepti
17 17
     protected $templateName;
18 18
 
19 19
     /**
20
-     * @param string $templateName
20
+     * @param string    $templateName
21
+     * @param Exception $previous
21 22
      */
22
-    public function __construct($templateName)
23
+    public function __construct($templateName, Exception $previous = null)
23 24
     {
24 25
         $this->templateName = $templateName;
25
-        parent::__construct(sprintf('Unknown template: %s', $templateName));
26
+        $message = sprintf('Unknown template: %s', $templateName);
27
+        if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
28
+            parent::__construct($message, 0, $previous);
29
+        } else {
30
+            parent::__construct($message); // @codeCoverageIgnore
31
+        }
26 32
     }
27 33
 
28 34
     public function getTemplateName()

+ 3
- 3
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/HelperCollection.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -81,7 +81,7 @@ class Mustache_HelperCollection
81 81
     /**
82 82
      * Get a helper by name.
83 83
      *
84
-     * @throws Mustache_Exception_UnknownHelperException If helper does not exist.
84
+     * @throws Mustache_Exception_UnknownHelperException If helper does not exist
85 85
      *
86 86
      * @param string $name
87 87
      *
@@ -137,7 +137,7 @@ class Mustache_HelperCollection
137 137
     /**
138 138
      * Check whether a given helper is present in the collection.
139 139
      *
140
-     * @throws Mustache_Exception_UnknownHelperException if the requested helper is not present.
140
+     * @throws Mustache_Exception_UnknownHelperException if the requested helper is not present
141 141
      *
142 142
      * @param string $name
143 143
      */

+ 33
- 6
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/LambdaHelper.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -20,17 +20,20 @@ class Mustache_LambdaHelper
20 20
 {
21 21
     private $mustache;
22 22
     private $context;
23
+    private $delims;
23 24
 
24 25
     /**
25 26
      * Mustache Lambda Helper constructor.
26 27
      *
27
-     * @param Mustache_Engine  $mustache Mustache engine instance.
28
-     * @param Mustache_Context $context  Rendering context.
28
+     * @param Mustache_Engine  $mustache Mustache engine instance
29
+     * @param Mustache_Context $context  Rendering context
30
+     * @param string           $delims   Optional custom delimiters, in the format `{{= <% %> =}}`. (default: null)
29 31
      */
30
-    public function __construct(Mustache_Engine $mustache, Mustache_Context $context)
32
+    public function __construct(Mustache_Engine $mustache, Mustache_Context $context, $delims = null)
31 33
     {
32 34
         $this->mustache = $mustache;
33 35
         $this->context  = $context;
36
+        $this->delims   = $delims;
34 37
     }
35 38
 
36 39
     /**
@@ -38,12 +41,36 @@ class Mustache_LambdaHelper
38 41
      *
39 42
      * @param string $string
40 43
      *
41
-     * @return string Rendered template.
44
+     * @return string Rendered template
42 45
      */
43 46
     public function render($string)
44 47
     {
45 48
         return $this->mustache
46
-            ->loadLambda((string) $string)
49
+            ->loadLambda((string) $string, $this->delims)
47 50
             ->renderInternal($this->context);
48 51
     }
52
+
53
+    /**
54
+     * Render a string as a Mustache template with the current rendering context.
55
+     *
56
+     * @param string $string
57
+     *
58
+     * @return string Rendered template
59
+     */
60
+    public function __invoke($string)
61
+    {
62
+        return $this->render($string);
63
+    }
64
+
65
+    /**
66
+     * Get a Lambda Helper with custom delimiters.
67
+     *
68
+     * @param string $delims Custom delimiters, in the format `{{= <% %> =}}`
69
+     *
70
+     * @return Mustache_LambdaHelper
71
+     */
72
+    public function withDelimiters($delims)
73
+    {
74
+        return new self($this->mustache, $this->context, $delims);
75
+    }
49 76
 }

+ 3
- 3
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -17,11 +17,11 @@ interface Mustache_Loader
17 17
     /**
18 18
      * Load a Template by name.
19 19
      *
20
-     * @throws Mustache_Exception_UnknownTemplateException If a template file is not found.
20
+     * @throws Mustache_Exception_UnknownTemplateException If a template file is not found
21 21
      *
22 22
      * @param string $name
23 23
      *
24
-     * @return string Mustache Template source
24
+     * @return string|Mustache_Source Mustache Template source
25 25
      */
26 26
     public function load($name);
27 27
 }

+ 2
- 2
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/ArrayLoader.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -41,7 +41,7 @@ class Mustache_Loader_ArrayLoader implements Mustache_Loader, Mustache_Loader_Mu
41 41
     /**
42 42
      * Load a Template.
43 43
      *
44
-     * @throws Mustache_Exception_UnknownTemplateException If a template file is not found.
44
+     * @throws Mustache_Exception_UnknownTemplateException If a template file is not found
45 45
      *
46 46
      * @param string $name
47 47
      *

+ 2
- 2
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/CascadingLoader.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -48,7 +48,7 @@ class Mustache_Loader_CascadingLoader implements Mustache_Loader
48 48
     /**
49 49
      * Load a Template by name.
50 50
      *
51
-     * @throws Mustache_Exception_UnknownTemplateException If a template file is not found.
51
+     * @throws Mustache_Exception_UnknownTemplateException If a template file is not found
52 52
      *
53 53
      * @param string $name
54 54
      *

+ 17
- 6
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/FilesystemLoader.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -40,9 +40,9 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader
40 40
      *         'extension' => '.ms',
41 41
      *     );
42 42
      *
43
-     * @throws Mustache_Exception_RuntimeException if $baseDir does not exist.
43
+     * @throws Mustache_Exception_RuntimeException if $baseDir does not exist
44 44
      *
45
-     * @param string $baseDir Base directory containing Mustache template files.
45
+     * @param string $baseDir Base directory containing Mustache template files
46 46
      * @param array  $options Array of Loader options (default: array())
47 47
      */
48 48
     public function __construct($baseDir, array $options = array())
@@ -53,7 +53,7 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader
53 53
             $this->baseDir = realpath($this->baseDir);
54 54
         }
55 55
 
56
-        if (!is_dir($this->baseDir)) {
56
+        if ($this->shouldCheckPath() && !is_dir($this->baseDir)) {
57 57
             throw new Mustache_Exception_RuntimeException(sprintf('FilesystemLoader baseDir must be a directory: %s', $baseDir));
58 58
         }
59 59
 
@@ -88,7 +88,7 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader
88 88
     /**
89 89
      * Helper function for loading a Mustache file by name.
90 90
      *
91
-     * @throws Mustache_Exception_UnknownTemplateException If a template file is not found.
91
+     * @throws Mustache_Exception_UnknownTemplateException If a template file is not found
92 92
      *
93 93
      * @param string $name
94 94
      *
@@ -98,7 +98,7 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader
98 98
     {
99 99
         $fileName = $this->getFileName($name);
100 100
 
101
-        if (!file_exists($fileName)) {
101
+        if ($this->shouldCheckPath() && !file_exists($fileName)) {
102 102
             throw new Mustache_Exception_UnknownTemplateException($name);
103 103
         }
104 104
 
@@ -121,4 +121,15 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader
121 121
 
122 122
         return $fileName;
123 123
     }
124
+
125
+    /**
126
+     * Only check if baseDir is a directory and requested templates are files if
127
+     * baseDir is using the filesystem stream wrapper.
128
+     *
129
+     * @return bool Whether to check `is_dir` and `file_exists`
130
+     */
131
+    protected function shouldCheckPath()
132
+    {
133
+        return strpos($this->baseDir, '://') === false || strpos($this->baseDir, 'file://') === 0;
134
+    }
124 135
 }

+ 3
- 3
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/InlineLoader.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -68,7 +68,7 @@ class Mustache_Loader_InlineLoader implements Mustache_Loader
68 68
      * @param string $fileName The file to parse for inline templates
69 69
      * @param int    $offset   A string offset for the start of the templates.
70 70
      *                         This usually coincides with the `__halt_compiler`
71
-     *                         call, and the `__COMPILER_HALT_OFFSET__`.
71
+     *                         call, and the `__COMPILER_HALT_OFFSET__`
72 72
      */
73 73
     public function __construct($fileName, $offset)
74 74
     {
@@ -87,7 +87,7 @@ class Mustache_Loader_InlineLoader implements Mustache_Loader
87 87
     /**
88 88
      * Load a Template by name.
89 89
      *
90
-     * @throws Mustache_Exception_UnknownTemplateException If a template file is not found.
90
+     * @throws Mustache_Exception_UnknownTemplateException If a template file is not found
91 91
      *
92 92
      * @param string $name
93 93
      *

+ 1
- 1
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/MutableLoader.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.

+ 1
- 1
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Loader/StringLoader.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.

+ 1
- 1
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Logger.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.

+ 1
- 1
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Logger/AbstractLogger.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.

+ 7
- 7
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Logger/StreamLogger.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -36,7 +36,7 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger
36 36
     protected $url    = null;
37 37
 
38 38
     /**
39
-     * @throws InvalidArgumentException if the logging level is unknown.
39
+     * @throws InvalidArgumentException if the logging level is unknown
40 40
      *
41 41
      * @param resource|string $stream Resource instance or URL
42 42
      * @param int             $level  The minimum logging level at which this handler will be triggered
@@ -65,7 +65,7 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger
65 65
     /**
66 66
      * Set the minimum logging level.
67 67
      *
68
-     * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown.
68
+     * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown
69 69
      *
70 70
      * @param int $level The minimum logging level which will be written
71 71
      */
@@ -91,7 +91,7 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger
91 91
     /**
92 92
      * Logs with an arbitrary level.
93 93
      *
94
-     * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown.
94
+     * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown
95 95
      *
96 96
      * @param mixed  $level
97 97
      * @param string $message
@@ -111,8 +111,8 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger
111 111
     /**
112 112
      * Write a record to the log.
113 113
      *
114
-     * @throws Mustache_Exception_LogicException   If neither a stream resource nor url is present.
115
-     * @throws Mustache_Exception_RuntimeException If the stream url cannot be opened.
114
+     * @throws Mustache_Exception_LogicException   If neither a stream resource nor url is present
115
+     * @throws Mustache_Exception_RuntimeException If the stream url cannot be opened
116 116
      *
117 117
      * @param int    $level   The logging level
118 118
      * @param string $message The log message
@@ -139,7 +139,7 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger
139 139
     /**
140 140
      * Gets the name of the logging level.
141 141
      *
142
-     * @throws InvalidArgumentException if the logging level is unknown.
142
+     * @throws InvalidArgumentException if the logging level is unknown
143 143
      *
144 144
      * @param int $level
145 145
      *

+ 8
- 8
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Parser.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -63,7 +63,7 @@ class Mustache_Parser
63 63
     /**
64 64
      * Helper method for recursively building a parse tree.
65 65
      *
66
-     * @throws Mustache_Exception_SyntaxException when nesting errors or mismatched section tags are encountered.
66
+     * @throws Mustache_Exception_SyntaxException when nesting errors or mismatched section tags are encountered
67 67
      *
68 68
      * @param array &$tokens Set of Mustache tokens
69 69
      * @param array $parent  Parent token (default: null)
@@ -149,7 +149,7 @@ class Mustache_Parser
149 149
                 case Mustache_Tokenizer::T_BLOCK_VAR:
150 150
                     if ($this->pragmaBlocks) {
151 151
                         // BLOCKS pragma is enabled, let's do this!
152
-                        if ($parent[Mustache_Tokenizer::TYPE] === Mustache_Tokenizer::T_PARENT) {
152
+                        if (isset($parent) && $parent[Mustache_Tokenizer::TYPE] === Mustache_Tokenizer::T_PARENT) {
153 153
                             $token[Mustache_Tokenizer::TYPE] = Mustache_Tokenizer::T_BLOCK_ARG;
154 154
                         }
155 155
                         $this->clearStandaloneLines($nodes, $tokens);
@@ -195,10 +195,10 @@ class Mustache_Parser
195 195
      *
196 196
      * Returns a whitespace token for indenting partials, if applicable.
197 197
      *
198
-     * @param array $nodes  Parsed nodes.
199
-     * @param array $tokens Tokens to be parsed.
198
+     * @param array $nodes  Parsed nodes
199
+     * @param array $tokens Tokens to be parsed
200 200
      *
201
-     * @return array|null Resulting indent token, if any.
201
+     * @return array|null Resulting indent token, if any
202 202
      */
203 203
     private function clearStandaloneLines(array &$nodes, array &$tokens)
204 204
     {
@@ -268,14 +268,14 @@ class Mustache_Parser
268 268
     /**
269 269
      * Check whether a token is allowed inside a parent tag.
270 270
      *
271
-     * @throws Mustache_Exception_SyntaxException if an invalid token is found inside a parent tag.
271
+     * @throws Mustache_Exception_SyntaxException if an invalid token is found inside a parent tag
272 272
      *
273 273
      * @param array|null $parent
274 274
      * @param array      $token
275 275
      */
276 276
     private function checkIfTokenIsAllowedInParent($parent, array $token)
277 277
     {
278
-        if ($parent[Mustache_Tokenizer::TYPE] === Mustache_Tokenizer::T_PARENT) {
278
+        if (isset($parent) && $parent[Mustache_Tokenizer::TYPE] === Mustache_Tokenizer::T_PARENT) {
279 279
             throw new Mustache_Exception_SyntaxException('Illegal content in < parent tag', $token);
280 280
         }
281 281
     }

+ 3
- 4
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Template.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -164,16 +164,15 @@ abstract class Mustache_Template
164 164
      *
165 165
      * @param mixed            $value
166 166
      * @param Mustache_Context $context
167
-     * @param string           $indent
168 167
      *
169 168
      * @return string
170 169
      */
171
-    protected function resolveValue($value, Mustache_Context $context, $indent = '')
170
+    protected function resolveValue($value, Mustache_Context $context)
172 171
     {
173 172
         if (($this->strictCallables ? is_object($value) : !is_string($value)) && is_callable($value)) {
174 173
             return $this->mustache
175 174
                 ->loadLambda((string) call_user_func($value))
176
-                ->renderInternal($context, $indent);
175
+                ->renderInternal($context);
177 176
         }
178 177
 
179 178
         return $value;

+ 71
- 46
plugins/posts-to-posts/vendor/mustache/mustache/src/Mustache/Tokenizer.php Wyświetl plik

@@ -3,7 +3,7 @@
3 3
 /*
4 4
  * This file is part of Mustache.php.
5 5
  *
6
- * (c) 2010-2015 Justin Hileman
6
+ * (c) 2010-2017 Justin Hileman
7 7
  *
8 8
  * For the full copyright and license information, please view the LICENSE
9 9
  * file that was distributed with this source code.
@@ -72,34 +72,47 @@ class Mustache_Tokenizer
72 72
     private $tokens;
73 73
     private $seenTag;
74 74
     private $line;
75
+
75 76
     private $otag;
76
-    private $ctag;
77
+    private $otagChar;
77 78
     private $otagLen;
79
+
80
+    private $ctag;
81
+    private $ctagChar;
78 82
     private $ctagLen;
79 83
 
80 84
     /**
81 85
      * Scan and tokenize template source.
82 86
      *
83
-     * @throws Mustache_Exception_SyntaxException when mismatched section tags are encountered.
87
+     * @throws Mustache_Exception_SyntaxException when mismatched section tags are encountered
88
+     * @throws Mustache_Exception_InvalidArgumentException when $delimiters string is invalid
84 89
      *
85 90
      * @param string $text       Mustache template source to tokenize
86
-     * @param string $delimiters Optionally, pass initial opening and closing delimiters (default: null)
91
+     * @param string $delimiters Optionally, pass initial opening and closing delimiters (default: empty string)
87 92
      *
88 93
      * @return array Set of Mustache tokens
89 94
      */
90
-    public function scan($text, $delimiters = null)
95
+    public function scan($text, $delimiters = '')
91 96
     {
92 97
         // Setting mbstring.func_overload makes things *really* slow.
93 98
         // Let's do everyone a favor and scan this string as ASCII instead.
99
+        //
100
+        // The INI directive was removed in PHP 8.0 so we don't need to check there (and can drop it
101
+        // when we remove support for older versions of PHP).
102
+        //
103
+        // @codeCoverageIgnoreStart
94 104
         $encoding = null;
95
-        if (function_exists('mb_internal_encoding') && ini_get('mbstring.func_overload') & 2) {
96
-            $encoding = mb_internal_encoding();
97
-            mb_internal_encoding('ASCII');
105
+        if (version_compare(PHP_VERSION, '8.0.0', '<')) {
106
+            if (function_exists('mb_internal_encoding') && ini_get('mbstring.func_overload') & 2) {
107
+                $encoding = mb_internal_encoding();
108
+                mb_internal_encoding('ASCII');
109
+            }
98 110
         }
111
+        // @codeCoverageIgnoreEnd
99 112
 
100 113
         $this->reset();
101 114
 
102
-        if ($delimiters = trim($delimiters)) {
115
+        if (is_string($delimiters) && $delimiters = trim($delimiters)) {
103 116
             $this->setDelimiters($delimiters);
104 117
         }
105 118
 
@@ -107,12 +120,13 @@ class Mustache_Tokenizer
107 120
         for ($i = 0; $i < $len; $i++) {
108 121
             switch ($this->state) {
109 122
                 case self::IN_TEXT:
110
-                    if ($this->tagChange($this->otag, $this->otagLen, $text, $i)) {
123
+                    $char = $text[$i];
124
+                    // Test whether it's time to change tags.
125
+                    if ($char === $this->otagChar && substr($text, $i, $this->otagLen) === $this->otag) {
111 126
                         $i--;
112 127
                         $this->flushBuffer();
113 128
                         $this->state = self::IN_TAG_TYPE;
114 129
                     } else {
115
-                        $char = $text[$i];
116 130
                         $this->buffer .= $char;
117 131
                         if ($char === "\n") {
118 132
                             $this->flushBuffer();
@@ -148,7 +162,9 @@ class Mustache_Tokenizer
148 162
                     break;
149 163
 
150 164
                 default:
151
-                    if ($this->tagChange($this->ctag, $this->ctagLen, $text, $i)) {
165
+                    $char = $text[$i];
166
+                    // Test whether it's time to change tags.
167
+                    if ($char === $this->ctagChar && substr($text, $i, $this->ctagLen) === $this->ctag) {
152 168
                         $token = array(
153 169
                             self::TYPE  => $this->tagType,
154 170
                             self::NAME  => trim($this->buffer),
@@ -193,7 +209,7 @@ class Mustache_Tokenizer
193 209
                         $this->state = self::IN_TEXT;
194 210
                         $this->tokens[] = $token;
195 211
                     } else {
196
-                        $this->buffer .= $text[$i];
212
+                        $this->buffer .= $char;
197 213
                     }
198 214
                     break;
199 215
             }
@@ -202,9 +218,11 @@ class Mustache_Tokenizer
202 218
         $this->flushBuffer();
203 219
 
204 220
         // Restore the user's encoding...
221
+        // @codeCoverageIgnoreStart
205 222
         if ($encoding) {
206 223
             mb_internal_encoding($encoding);
207 224
         }
225
+        // @codeCoverageIgnoreEnd
208 226
 
209 227
         return $this->tokens;
210 228
     }
@@ -214,16 +232,20 @@ class Mustache_Tokenizer
214 232
      */
215 233
     private function reset()
216 234
     {
217
-        $this->state   = self::IN_TEXT;
218
-        $this->tagType = null;
219
-        $this->buffer  = '';
220
-        $this->tokens  = array();
221
-        $this->seenTag = false;
222
-        $this->line    = 0;
223
-        $this->otag    = '{{';
224
-        $this->ctag    = '}}';
225
-        $this->otagLen = 2;
226
-        $this->ctagLen = 2;
235
+        $this->state    = self::IN_TEXT;
236
+        $this->tagType  = null;
237
+        $this->buffer   = '';
238
+        $this->tokens   = array();
239
+        $this->seenTag  = false;
240
+        $this->line     = 0;
241
+
242
+        $this->otag     = '{{';
243
+        $this->otagChar = '{';
244
+        $this->otagLen  = 2;
245
+
246
+        $this->ctag     = '}}';
247
+        $this->ctagChar = '}';
248
+        $this->ctagLen  = 2;
227 249
     }
228 250
 
229 251
     /**
@@ -244,6 +266,8 @@ class Mustache_Tokenizer
244 266
     /**
245 267
      * Change the current Mustache delimiters. Set new `otag` and `ctag` values.
246 268
      *
269
+     * @throws Mustache_Exception_SyntaxException when delimiter string is invalid
270
+     *
247 271
      * @param string $text  Mustache template source
248 272
      * @param int    $index Current tokenizer index
249 273
      *
@@ -255,28 +279,44 @@ class Mustache_Tokenizer
255 279
         $close      = '=' . $this->ctag;
256 280
         $closeIndex = strpos($text, $close, $index);
257 281
 
258
-        $this->setDelimiters(trim(substr($text, $startIndex, $closeIndex - $startIndex)));
259
-
260
-        $this->tokens[] = array(
282
+        $token = array(
261 283
             self::TYPE => self::T_DELIM_CHANGE,
262 284
             self::LINE => $this->line,
263 285
         );
264 286
 
287
+        try {
288
+            $this->setDelimiters(trim(substr($text, $startIndex, $closeIndex - $startIndex)));
289
+        } catch (Mustache_Exception_InvalidArgumentException $e) {
290
+            throw new Mustache_Exception_SyntaxException($e->getMessage(), $token);
291
+        }
292
+
293
+        $this->tokens[] = $token;
294
+
265 295
         return $closeIndex + strlen($close) - 1;
266 296
     }
267 297
 
268 298
     /**
269 299
      * Set the current Mustache `otag` and `ctag` delimiters.
270 300
      *
301
+     * @throws Mustache_Exception_InvalidArgumentException when delimiter string is invalid
302
+     *
271 303
      * @param string $delimiters
272 304
      */
273 305
     private function setDelimiters($delimiters)
274 306
     {
275
-        list($otag, $ctag) = explode(' ', $delimiters);
276
-        $this->otag = $otag;
277
-        $this->ctag = $ctag;
278
-        $this->otagLen = strlen($otag);
279
-        $this->ctagLen = strlen($ctag);
307
+        if (!preg_match('/^\s*(\S+)\s+(\S+)\s*$/', $delimiters, $matches)) {
308
+            throw new Mustache_Exception_InvalidArgumentException(sprintf('Invalid delimiters: %s', $delimiters));
309
+        }
310
+
311
+        list($_, $otag, $ctag) = $matches;
312
+
313
+        $this->otag     = $otag;
314
+        $this->otagChar = $otag[0];
315
+        $this->otagLen  = strlen($otag);
316
+
317
+        $this->ctag     = $ctag;
318
+        $this->ctagChar = $ctag[0];
319
+        $this->ctagLen  = strlen($ctag);
280 320
     }
281 321
 
282 322
     /**
@@ -304,19 +344,4 @@ class Mustache_Tokenizer
304 344
 
305 345
         return $end + $this->ctagLen - 1;
306 346
     }
307
-
308
-    /**
309
-     * Test whether it's time to change tags.
310
-     *
311
-     * @param string $tag    Current tag name
312
-     * @param int    $tagLen Current tag name length
313
-     * @param string $text   Mustache template source
314
-     * @param int    $index  Current tokenizer index
315
-     *
316
-     * @return bool True if this is a closing section tag
317
-     */
318
-    private function tagChange($tag, $tagLen, $text, $index)
319
-    {
320
-        return substr($text, $index, $tagLen) === $tag;
321
-    }
322 347
 }

+ 7
- 1
plugins/posts-to-posts/vendor/scribu/lib-posts-to-posts/composer.json Wyświetl plik

@@ -9,5 +9,11 @@
9 9
     },
10 10
     "autoload": {
11 11
         "files": ["autoload.php"]
12
-    }
12
+    },
13
+    "repositories": [
14
+        {
15
+            "type": "vcs",
16
+            "url": "https://github.com/jeffreyvr/wp-scb-framework/"
17
+        }
18
+    ]
13 19
 }

+ 1
- 1
plugins/posts-to-posts/vendor/scribu/lib-posts-to-posts/side-post.php Wyświetl plik

@@ -22,7 +22,7 @@ class P2P_Side_Post extends P2P_Side {
22 22
 		$ptype_object = get_post_type_object( $ptype );
23 23
 
24 24
 		if ( !$ptype_object ) {
25
-			throw new P2P_Exception( "Can't find $ptype." );
25
+			throw new P2P_Exception( "Can't find post type $ptype." );
26 26
 		}
27 27
 
28 28
 		return $ptype_object;

+ 3
- 3
plugins/posts-to-posts/vendor/scribu/scb-framework/AdminPage.php Wyświetl plik

@@ -136,6 +136,9 @@ abstract class scbAdminPage {
136 136
 
137 137
 		add_action( 'admin_menu', array( $this, 'page_init' ), $this->args['admin_action_priority'] );
138 138
 
139
+		// Commented out due to deprecated notice.
140
+		// add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 );
141
+
139 142
 		if ( $file ) {
140 143
 			$this->file = $file;
141 144
 			$this->plugin_url = plugin_dir_url( $file );
@@ -508,7 +511,6 @@ abstract class scbAdminPage {
508 511
 			'toplevel'              => '',
509 512
 			'position'              => null,
510 513
 			'icon_url'              => '',
511
-			'screen_icon'           => '',
512 514
 			'parent'                => 'options-general.php',
513 515
 			'capability'            => 'manage_options',
514 516
 			'menu_title'            => $this->args['page_title'],
@@ -538,7 +540,6 @@ abstract class scbAdminPage {
538 540
 	 * @param string|object $screen
539 541
 	 *
540 542
 	 * @return string
541
-	 * @deprecated 1.6.6 Not used
542 543
 	 */
543 544
 	public function _contextual_help( $help, $screen ) {
544 545
 		if ( is_object( $screen ) ) {
@@ -580,4 +581,3 @@ abstract class scbAdminPage {
580 581
 		return $links;
581 582
 	}
582 583
 }
583
-

+ 4
- 0
plugins/posts-to-posts/vendor/scribu/scb-framework/Forms.php Wyświetl plik

@@ -606,6 +606,10 @@ abstract class scbFormField implements scbFormField_I {
606 606
 	 * @return string
607 607
 	 */
608 608
 	protected static function add_label( $input, $desc, $desc_pos ) {
609
+		if ( empty( $desc ) ) {
610
+			return $input;
611
+		}
612
+
609 613
 		return html( 'label', self::add_desc( $input, $desc, $desc_pos ) ) . "\n";
610 614
 	}
611 615
 

+ 1
- 1
plugins/posts-to-posts/vendor/scribu/scb-framework/load.php Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 <?php
2 2
 
3
-$GLOBALS['_scb_data'] = array( 60, __FILE__, array(
3
+$GLOBALS['_scb_data'] = array( 61, __FILE__, array(
4 4
 	'scbUtil',
5 5
 	'scbOptions',
6 6
 	'scbForms',

Ładowanie…
Anuluj
Zapisz