Skip to content

Commit

Permalink
Remove BBCode and PHP 7.3 support, Remove bbcodeconvert module (#993)
Browse files Browse the repository at this point in the history
* Remove support for BBCode
* Remove support for PHP 7.3
* Remove bbcodeconvert module from repository
  • Loading branch information
blackcoder87 authored Jun 23, 2024
1 parent d16eb65 commit 6784085
Show file tree
Hide file tree
Showing 22 changed files with 909 additions and 1,694 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3']
mysql-versions: ['5.7']

services:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Ilch 2 ist der direkte Nachfolger der Ilch Versionen 1.1.
- Den Bildschirmanweisungen folgen

### Voraussetzungen
- PHP Version 7.3 oder neuer
- PHP Version 7.4 oder neuer
- MySQL (5.5.3 oder neuer), MariaDB (5.5 oder neuer) oder Equivalent

### Support/Dokumentation
Expand Down
26 changes: 0 additions & 26 deletions application/libraries/Ilch/BBCode/CodeHelper.php

This file was deleted.

93 changes: 0 additions & 93 deletions application/libraries/Ilch/Design/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,99 +424,6 @@ public function escape(?string $string): string
return \htmlspecialchars($string ?? '', ENT_QUOTES, 'UTF-8', false);
}

/**
* Gets html from bbcode.
*
* @param string $bbcode
* @return string
*/
public function getHtmlFromBBCode(string $bbcode): string
{
$parser = new \JBBCode\Parser();
//test without default
//$parser->addCodeDefinitionSet(new \JBBCode\DefaultCodeDefinitionSet());
//$parser->addCodeDefinition(new \Ilch\BBCode\CodeHelper());

$urlValidator = new \JBBCode\validators\UrlValidator();

$builder = new \JBBCode\CodeDefinitionBuilder('b', '<strong>{param}</strong>');
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('i', '<em>{param}</em>');
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('u', '<u>{param}</u>');
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('s', '<s>{param}</s>');
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('center', '<p style="text-align: center;">{param}</p>');
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('right', '<p style="text-align: right;">{param}</p>');
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('justify', '<p style="text-align: justify;">{param}</p>');
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('url', '<a target="_blank" href="{param}" rel="noopener">{param}</a>');
$builder->setParseContent(false)->setBodyValidator($urlValidator);
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('url', '<a target="_blank" href="{option}" rel="noopener">{param}</a>');
$builder->setUseOption(true)->setParseContent(true)->setOptionValidator($urlValidator);
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('img', '<img src="{param}" />');
$builder->setUseOption(false)->setParseContent(false)->setBodyValidator($urlValidator);
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('img', '<img src="{param}" alt="{option}" />');
$builder->setUseOption(true)->setParseContent(false)->setBodyValidator($urlValidator);
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('color', '<span style="color: {option}">{param}</span>');
$builder->setUseOption(true)->setOptionValidator(new \JBBCode\validators\CssColorValidator());
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('quote', '<blockquote>{param}</blockquote>');
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('list', '<ul>{param}</ul>');
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('list', '<ol>{param}</ol>');
$builder->setUseOption(true);
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('*', '<li>{param}</li>');
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('email', '<a href="mailto:{param}">{param}</a>');
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('size', '<span style="font-size:{option}%;">{param}</span>');
$builder->setUseOption(true);
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('youtube', '<div class="ckeditor-bbcode--youtube"><div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" src="https://www.youtube-nocookie.com/embed/{param}" frameborder="0" allowfullscreen></iframe></div></div>');
$builder->setUseOption(false);
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('youtube', '<div class="ckeditor-bbcode--youtube"><iframe src="https://www.youtube-nocookie.com/embed/{param}" width="{w}" height="{h}" frameborder="0" allowfullscreen></iframe></div>');
$builder->setUseOption(true);
$parser->addCodeDefinition($builder->build());

$builder = new \JBBCode\CodeDefinitionBuilder('code', '<pre><code>{param}</code></pre>');
$builder->setParseContent(false);
$parser->addCodeDefinition($builder->build());

$parser->parse($bbcode);

return $parser->getAsHTML();
}

/**
* Creates a full url for the given parts.
*
Expand Down
8 changes: 8 additions & 0 deletions application/modules/admin/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,14 @@ public function getUpdate(string $installedVersion): string
$databaseConfig = new \Ilch\Config\Database($this->db());
$databaseConfig->set('showbreadcrumb', '1');
break;
case "2.2.1":
// Removal of BBCode support.
// Update vendor folder
replaceVendorDirectory();

// Remove BBCode helper class.
removeDir(APPLICATION_PATH . '/libraries/Ilch/BBCode');
break;
}

return 'Update function executed.';
Expand Down
47 changes: 0 additions & 47 deletions application/modules/bbcodeconvert/config/config.php

This file was deleted.

Loading

0 comments on commit 6784085

Please sign in to comment.