Go to file
Ingo Schommer 5e2ca7f0a3 FIX Tidy extension and cli fix for tests
Wrap doesn't actually wrap in the tidy extension.
This causes tests to be flakey, for example some of `FormTest` fails
if you happen to have `ext-tidy` installed (which is the default on most systems).
This happened to me on PHP 7.4.19 with tidy 5.6.0 (OSX Homebrew).
Note that the tests aren't failing in Travis right now.

You'd expect `wrap => 0` to be honoured. It's documented as an integer
in the tidy docs: https://api.html-tidy.org/tidy/quickref_5.6.0.html#wrap.

Even tracked this down to the PHP source which appears to be doing the right thing:
https://github.com/php/php-src/blob/master/ext/tidy/tidy.c#L300

There's a bug from 2018 against PHP 7.2.8 which was closed as "not a bug" without comment:
https://bugs.php.net/bug.php?id=76683

You can see the behaviour in action in the following test.

```
<?php
$html = '<p>a really long string which should not be wrapped</p>';

echo "## With tidy extension" . PHP_EOL;
$tidy = new tidy();
$tidy->parseString(
    $html,
    [
        'output-xhtml' => true,
        'numeric-entities' => true,
        'wrap' => 0,
    ],
    'utf8'
);
$tidy->cleanRepair();
echo $tidy . PHP_EOL;

echo "## With tidy cli" . PHP_EOL;
$cmd = sprintf("echo " . escapeshellarg($html) . " | tidy --force-output 1 -n -q -utf8 -asxhtml -w 0 2> /dev/null");
echo shell_exec($cmd);
```

Long story short, setting it to 99999 fixes the issue.
2021-05-20 20:09:42 +12:00
_config NEW DataObject related objects service 2020-10-29 09:29:26 +13:00
.github Add action for netlify docs build 2019-11-20 16:26:13 +13:00
.tx remove js transifex 2017-04-28 14:59:42 +12:00
client NEW: Improved task runner UI. (#9540) 2020-08-26 11:11:13 +12:00
docs Update 04_Shortcodes.md 2021-05-19 19:16:27 +02:00
lang Update translations 2021-05-17 10:53:21 +12:00
src FIX Tidy extension and cli fix for tests 2021-05-20 20:09:42 +12:00
templates NEW: Improved task runner UI. (#9540) 2020-08-26 11:11:13 +12:00
tests Merge branch '4.7' into 4.8 2021-05-03 14:21:37 +12:00
thirdparty Fix missing braces 2018-06-01 10:14:42 +12:00
_config.php Bump deprecation to 4.0 in preparation for rc and stable tags 2017-08-29 15:02:36 +12:00
_register_database.php Use short array syntax across the framework's codebase 2020-05-16 10:34:45 +01:00
.codecov.yml Turn off codecov commenting on PRs 2016-10-12 16:31:22 +01:00
.editorconfig Update composer.json 2017-10-12 11:53:12 +13:00
.gitattributes FIX Update .gitattributes and some http:// links (#9805) 2020-12-22 15:57:32 +13:00
.gitignore Ignore assets dir that can be created on dev/build 2018-09-29 22:52:08 +01:00
.scrutinizer.yml Merge branch '4.0' into 4 2017-12-05 12:14:22 +00:00
.travis.yml Merge branch '4.8' into 4 2021-05-17 16:54:02 +12:00
.upgrade.yml Merge tag '4.6.0' into 4.6 2020-07-13 12:26:06 +12:00
behat.yml BUG Escape % symbole for Symphony 4 2020-10-20 18:50:59 +13:00
cli-script.php More code style fixes 2017-12-05 14:20:13 +00:00
composer.json Remove useless requirement 2020-10-22 15:28:02 +02:00
CONTRIBUTING.md Add copyright note to contributing.md 2016-05-30 14:32:19 +12:00
LICENSE Create licence file so that GitHub (and humans) can more easily find it 2018-02-12 11:21:03 +00:00
phpcs.xml.dist MNT Travis shared config 2020-12-22 11:43:54 +13:00
phpunit.xml.dist Actually run CMS tests 2018-02-08 10:32:56 +00:00
README.md DOC remove the version number from docs urls 2021-02-01 15:01:04 +13:00
sake Add check for existence of 'which' command before proceeding with the script 2019-11-26 11:24:44 +00:00
silverstripe_version API CHANGE silverstripe_version file now contains the plain version number, rather than an SVN path 2012-02-01 18:42:21 +01:00
SUPPORT.md DOCS Add details about the recommended community support options 2020-06-30 11:28:45 +12:00

SilverStripe Framework

Build Status Build Docs Latest Stable Version Latest Unstable Version codecov SilverStripe supported module Total Downloads License

PHP framework forming the base for the SilverStripe CMS (https://silverstripe.org). Requires a silverstripe-installer base project. Typically used alongside the cms module.

Installation

See installation on different platforms, and installation from source.

Bugtracker

Bugs are tracked on github.com. Please read our issue reporting guidelines.

Development and Contribution

If you would like to make changes to the SilverStripe core codebase, we have an extensive guide to contributing code.

Attribution