Update Parsedown to v1.7.3 (security update)

This commit is contained in:
Frédéric Guillot
2019-11-19 20:43:52 -08:00
parent f57837aea7
commit 75682398c1
31 changed files with 645 additions and 608 deletions

View File

@@ -1,3 +0,0 @@
composer.lock
build/
vendor/

View File

@@ -1,14 +0,0 @@
before_commands:
- "composer install --prefer-dist"
tools:
php_mess_detector: true
php_code_sniffer: true
php_analyzer: true
sensiolabs_security_checker: true
php_code_coverage: true
php_cpd: true
php_pdepend:
excluded_dirs: [vendor/, tests/*]
filter:
excluded_paths: [vendor/]

View File

@@ -1,19 +0,0 @@
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
before_script:
- composer install
before_script:
- curl -s http://getcomposer.org/installer | php
- php composer.phar update --dev --no-interaction
- mkdir -p build/logs
script:
- php vendor/bin/phpunit --coverage-text

View File

@@ -1,7 +1,7 @@
base32
======
Base32 Encoder/Decoder for PHP according to RFC 4648
Base32 Encoder/Decoder for PHP according to [RFC 4648](https://tools.ietf.org/html/rfc4648).
[![Build Status](https://secure.travis-ci.org/ChristianRiesen/base32.png)](http://travis-ci.org/ChristianRiesen/base32)
[![HHVM Status](http://hhvm.h4cc.de/badge/christian-riesen/base32.png)](http://hhvm.h4cc.de/package/christian-riesen/base32)
@@ -15,19 +15,20 @@ Do you like this? Flattr it:
Usage
-----
<?php
```php
<?php
// Include class or user autoloader
use Base32\Base32;
// Include class or user autoloader
use Base32\Base32;
$string = 'fooba';
$string = 'fooba';
$encoded = Base32::encode($string);
// $encoded contains now 'MZXW6YTB'
$decoded = Base32::decode($encoded);
// $decoded is again 'fooba'
$encoded = Base32::encode($string);
// $encoded contains now 'MZXW6YTB'
$decoded = Base32::decode($encoded);
// $decoded is again 'fooba'
```
About
=====
@@ -44,9 +45,9 @@ Have a RFC compliant Base32 encoder and decoder. The implementation could be imp
Requirements
------------
PHP 5.3.x+
PHP 5.3 to 5.6 or 7.0+
If you want to run the tests, PHPUnit 3.6 or up is required.
If you want to run the tests, PHPUnit 5.0+ or up is required. Tests require PHP 5.6 or 7.0+.
Author
------
@@ -57,4 +58,3 @@ Acknowledgements
----------------
Base32 is mostly based on the work of https://github.com/NTICompass/PHP-Base32

View File

@@ -1,130 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="christianriesen-base32" default="build">
<target name="build" depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpcb"/>
<target name="build-parallel" depends="prepare,lint,tools-parallel,phpunit,phpcb"/>
<target name="tools-parallel" description="Run tools in parallel">
<parallel threadCount="2">
<sequential>
<antcall target="pdepend"/>
<antcall target="phpmd-ci"/>
</sequential>
<antcall target="phpcpd"/>
<antcall target="phpcs-ci"/>
<antcall target="phploc"/>
</parallel>
</target>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
<exec executable="bash">
<arg value="-c" />
<arg value="curl -s http://getcomposer.org/installer | php" />
</exec>
<exec executable="php">
<arg value="composer.phar" />
<arg value="install" />
</exec>
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l"/>
<fileset dir="${basedir}/src">
<include name="**/*.php"/>
<modified/>
</fileset>
<fileset dir="${basedir}/tests">
<include name="**/*.php"/>
<modified/>
</fileset>
</apply>
</target>
<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc">
<arg value="--log-csv"/>
<arg value="${basedir}/build/logs/phploc.csv"/>
<arg path="${basedir}/src"/>
</exec>
</target>
<target name="pdepend" description="Calculate software metrics using PHP_Depend">
<exec executable="pdepend">
<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml"/>
<arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg"/>
<arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg"/>
<arg path="${basedir}/src"/>
</exec>
</target>
<target name="phpmd" description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
<exec executable="phpmd">
<arg path="${basedir}/src"/>
<arg value="text"/>
<arg value="${basedir}/build/phpmd.xml"/>
</exec>
</target>
<target name="phpmd-ci" description="Perform project mess detection using PHPMD creating a log file for the continuous integration server">
<exec executable="phpmd">
<arg path="${basedir}/src"/>
<arg value="xml"/>
<arg value="${basedir}/build/phpmd.xml"/>
<arg value="--reportfile"/>
<arg value="${basedir}/build/logs/pmd.xml"/>
</exec>
</target>
<target name="phpcs" description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
<exec executable="phpcs">
<arg value="--standard=${basedir}/build/phpcs.xml"/>
<arg path="${basedir}/src"/>
</exec>
</target>
<target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
<exec executable="phpcs" output="/dev/null">
<arg value="--report=checkstyle"/>
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml"/>
<arg value="--standard=${basedir}/build/phpcs.xml"/>
<arg path="${basedir}/src"/>
</exec>
</target>
<target name="phpcpd" description="Find duplicate code using PHPCPD">
<exec executable="phpcpd">
<arg value="--log-pmd"/>
<arg value="${basedir}/build/logs/pmd-cpd.xml"/>
<arg path="${basedir}/src"/>
</exec>
</target>
<target name="phpunit" description="Run unit tests with PHPUnit">
<exec executable="phpunit" failonerror="true"/>
</target>
<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="phpcb">
<arg value="--log"/>
<arg path="${basedir}/build/logs"/>
<arg value="--source"/>
<arg path="${basedir}/src"/>
<arg value="--output"/>
<arg path="${basedir}/build/code-browser"/>
</exec>
</target>
</project>

View File

@@ -1,33 +0,0 @@
{
"name": "christian-riesen/base32",
"type": "library",
"description": "Base32 encoder/decoder according to RFC 4648",
"keywords": ["base32","encode","decode","rfc4648"],
"homepage": "https://github.com/ChristianRiesen/base32",
"license": "MIT",
"authors": [
{
"name": "Christian Riesen",
"email": "chris.riesen@gmail.com",
"homepage": "http://christianriesen.com",
"role": "Developer"
}
],
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "4.*",
"satooshi/php-coveralls": "0.*"
},
"autoload": {
"psr-4": {
"Base32\\": "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
}
}

View File

@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="tests/bootstrap.php"
colors="true">
<testsuites>
<testsuite name="Base32 Test Suite">
<directory suffix="Test.php">tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="build/coverage" title="Base32"
charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>
</phpunit>

View File

@@ -1,51 +0,0 @@
<?php
namespace Base32;
use Base32\Base32;
/**
* Base32 test case.
*/
class Base32Test extends \PHPUnit_Framework_TestCase
{
/**
* Tests Base32->decode()
*
* Testing test vectors according to RFC 4648
* http://www.ietf.org/rfc/rfc4648.txt
*/
public function testDecode()
{
// RFC test vectors say that empty string returns empty string
$this->assertEquals('', Base32::decode(''));
// these strings are taken from the RFC
$this->assertEquals('f', Base32::decode('MY======'));
$this->assertEquals('fo', Base32::decode('MZXQ===='));
$this->assertEquals('foo', Base32::decode('MZXW6==='));
$this->assertEquals('foob', Base32::decode('MZXW6YQ='));
$this->assertEquals('fooba', Base32::decode('MZXW6YTB'));
$this->assertEquals('foobar', Base32::decode('MZXW6YTBOI======'));
// Decoding a string made up entirely of invalid characters
$this->assertEquals('', Base32::decode('8908908908908908'));
}
/**
* Encoder tests, reverse of the decodes
*/
public function testEncode()
{
// RFC test vectors say that empty string returns empty string
$this->assertEquals('', Base32::encode(''));
// these strings are taken from the RFC
$this->assertEquals('MY======', Base32::encode('f'));
$this->assertEquals('MZXQ====', Base32::encode('fo'));
$this->assertEquals('MZXW6===', Base32::encode('foo'));
$this->assertEquals('MZXW6YQ=', Base32::encode('foob'));
$this->assertEquals('MZXW6YTB', Base32::encode('fooba'));
$this->assertEquals('MZXW6YTBOI======', Base32::encode('foobar'));
}
}

View File

@@ -1,5 +0,0 @@
<?php
$loader = require __DIR__ . '/../vendor/autoload.php';
$loader->add("Base32", __DIR__);
$loader->register();