Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
TYPO3
tinymce
Commits
a4f9dd6d
Commit
a4f9dd6d
authored
Apr 14, 2015
by
Sigfried Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parsing for markers in TSConfig / JavaScript to allow complex setups with nested parenthesis
parent
8699929e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
Classes/Loader.php
Classes/Loader.php
+9
-4
No files found.
Classes/Loader.php
View file @
a4f9dd6d
...
...
@@ -228,10 +228,15 @@ class Loader {
$configuration
=
file_get_contents
(
$configurationFile
);
}
// split config into first and last javascript parts (applied later again into the config variables)
// additionally the config part is matched to get the options
$pattern
=
'/(.*)tinymce\.init\s*\(\s*\{(.*?)\}\s*\)\s*;?(.*)/is'
;
preg_match
(
$pattern
,
$configuration
,
$matches
);
// first try to find the configuration via the "subpart" ###TINYMCE_INIT###
$pattern
=
'/(.*)?tinymce\.init\s*\(\s*\{\s*\/\*\s?###TINYMCE_INIT###.*?\*\/(.*)\/\*\s*###TINYMCE_INIT###.*?\*\/\s*\}\s*\);*(.*)?/is'
;
if
(
@
preg_match
(
$pattern
,
$configuration
,
$matches
))
{
// fine :)
}
else
{
// if nothing is found, try it the legacy way (note: this may cause problems with a complex setups, since parenthesis-matching is not perfect here)
$pattern
=
'/(.*)tinymce\.init\s*\(\s*\{(.*?)\}\s*\)\s*;?(.*)/is'
;
preg_match
(
$pattern
,
$configuration
,
$matches
);
}
// add preJS and postJS
$configurationArray
[
'preJS'
]
=
trim
(
$matches
[
1
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment