Bug #82963
closedEditing of links with empty rel attribute causes exception in ckeditor
0%
Description
TYPO3: 8.7.8; composer installation
PHP: 7.0.22
Enabling the rel field in rte is easy:
buttons:
link:
relAttribute:
enabled: true
But if the rel attribute remains empty, editing of previously created links is not possible any more, this causes an exception.
Steps to reproduce:- Enable rel attribute
- Create new link, leave rel attribute empty
- It is not neccessary to save changes, saving or not does not has an effect
- try to edit the new link - bang, exception
- switch to code view
- add something like 'rel="nofollow"' to the link
- try to edit it again - ahhh, it works!
Fix:
Can't try it at the moment, but adding a type check fur NULL and then setting $currentRel="" should work.
Something like
$currentRel = $currentRel ?: "";
before building the html code
Backtrace:
Uncaught TYPO3 Exception
htmlspecialchars() expects parameter 1 to be string, null given
TypeError thrown in file
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php in line 387.
14 htmlspecialchars(NULL)
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php:
00385: '</label>
00386: <div class="col-xs-8">
00387: <input type="text" name="lrel" class="form-control" value="' . htmlspecialchars($currentRel) . '" />
00388: </div>
00389: </div>
13 TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController::getRelField()
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php:
00356: $fieldRenderingDefinitions['class'] = $this->getClassField();
00357: $fieldRenderingDefinitions['target'] = $this->getTargetField();
00358: $fieldRenderingDefinitions['rel'] = $this->getRelField();
00359: if (empty($this->buttonConfig['queryParametersSelector']['enabled'])) {
00360: unset($fieldRenderingDefinitions['params']);
12 TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController::getLinkAttributeFieldDefinitions()
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/recordlist/Classes/Controller/AbstractLinkBrowserController.php:
00456: public function renderLinkAttributeFields()
00457: {
00458: $fieldRenderingDefinitions = $this->getLinkAttributeFieldDefinitions();
00459:
00460: $fieldRenderingDefinitions = $this->displayedLinkHandler->modifyLinkAttributes($fieldRenderingDefinitions);
11 TYPO3\CMS\Recordlist\Controller\AbstractLinkBrowserController::renderLinkAttributeFields()
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php:
00271: }
00272: }
00273: return parent::renderLinkAttributeFields();
00274: }
00275:
10 TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController::renderLinkAttributeFields()
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/recordlist/Classes/Controller/AbstractLinkBrowserController.php:
00164:
00165: $menuData = $this->buildMenuArray();
00166: $renderLinkAttributeFields = $this->renderLinkAttributeFields();
00167: $browserContent = $this->displayedLinkHandler->render($request);
00168:
9 TYPO3\CMS\Recordlist\Controller\AbstractLinkBrowserController::mainAction(TYPO3\CMS\Core\Http\ServerRequest, TYPO3\CMS\Core\Http\Response)
8 call_user_func_array(array, array)
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/backend/Classes/Http/RouteDispatcher.php:
00052: $targetIdentifier = $route->getOption('target');
00053: $target = $this->getCallableFromTarget($targetIdentifier);
00054: return call_user_func_array($target, [$request, $response]);
00055: }
00056:
7 TYPO3\CMS\Backend\Http\RouteDispatcher::dispatch(TYPO3\CMS\Core\Http\ServerRequest, TYPO3\CMS\Core\Http\Response)
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/backend/Classes/Http/RequestHandler.php:
00137: /** @var RouteDispatcher $dispatcher */
00138: $dispatcher = GeneralUtility::makeInstance(RouteDispatcher::class);
00139: return $dispatcher->dispatch($request, $response);
00140: }
00141: }
6 TYPO3\CMS\Backend\Http\RequestHandler::dispatch(TYPO3\CMS\Core\Http\ServerRequest)
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/backend/Classes/Http/RequestHandler.php:
00070: // Check if the router has the available route and dispatch.
00071: try {
00072: return $this->dispatch($request);
00073: } catch (InvalidRequestTokenException $e) {
00074: // When token was invalid redirect to login
5 TYPO3\CMS\Backend\Http\RequestHandler::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/core/Classes/Core/Bootstrap.php:
00313:
00314: // Execute the command which returns a Response object or NULL
00315: $this->response = $requestHandler->handleRequest($request);
00316: return $this;
00317: }
4 TYPO3\CMS\Core\Core\Bootstrap::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/backend/Classes/Http/Application.php:
00090: }
00091:
00092: $this->bootstrap->handleRequest($this->request);
00093:
00094: if ($execute !== null) {
3 TYPO3\CMS\Backend\Http\Application::run()
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/backend/Resources/Private/Php/backend.php:
00022: $classLoader = require DIR . '/../../../../../../vendor/autoload.php';
00023:
00024: (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run();
00025: });
2 {closure}()
/var/www/vhosts/###/vendor/typo3/cms/typo3/sysext/backend/Resources/Private/Php/backend.php:
00023:
00024: (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run();
00025: });
1 require("/var/www/vhosts/###/vendor/typo3/cm…3/sysext/backend/Resources/Private/Php/backend.php")
/var/www/vhosts/###/vendor/typo3/cms/typo3/index.php:
00001: 00002:
00003: require DIR . '/sysext/backend/Resources/Private/Php/backend.php';
Updated by Frans Saris about 7 years ago
- Is duplicate of Bug #82787: Reediting link in ckeditor leads to exception added
Updated by Frans Saris about 7 years ago
- Status changed from New to Rejected
This is already solved with #82787