BBCode's
[phpBB Debug] PHP Warning : in file [ROOT]/vendor/twig/twig/src/Template.php on line 359 : Array to string conversion
Array
Fast_Eddie
Users
Status:
Offline
User theme: Dark
Posts: 279 Joined: Aug 15th, '15, 18:25
Post
by Fast_Eddie » Mar 21st, '16, 19:44
I have a working BBcode to use google fonts
BBcode:
Code: Select all
[googlefont={TEXT}]{TEXT2}[/googlefont]
HTML Replacement:
Code: Select all
<script type="text/javascript">
WebFontConfig = {
google: { families: [ '{TEXT}::latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();</script><span style="font-family:{TEXT};">{TEXT2}</span>
Help Line:
Code: Select all
[googlefont=fontname][your text here][/googlefont]
Problem is when i submit I get this warning:
The BBCode you are trying to add seems to use a {TEXT} token inside a HTML attribute. This is a possible XSS security issue. Try using the more restrictive {SIMPLETEXT} or {INTTEXT} types instead. Only proceed if you understand the risks involved and you consider the use of {TEXT} absolutely unavoidable.
Can this be updated? How?
Thank you in advance!
Retirement 2024!
[phpBB Debug] PHP Warning : in file [ROOT]/vendor/twig/twig/src/Template.php on line 359 : Array to string conversion
Array
dmzx
Founder
Status:
Offline
User theme: Dark
Posts: 6485 Joined: Jan 13th, '14, 20:45
Post
by dmzx » Mar 21st, '16, 19:50
Try this:
BBCode usage
Code: Select all
[googlefont={INTTEXT}]{INTTEXT2}[/googlefont]
HTML replacement
Code: Select all
<script type="text/javascript">
WebFontConfig = {
google: { families: [ '{INTTEXT}::latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();</script><span style="font-family:{INTTEXT};">{INTTEXT2}</span>
Help line
Code: Select all
[googlefont=fontname][your text here][/googlefont]
[phpBB Debug] PHP Warning : in file [ROOT]/vendor/twig/twig/src/Template.php on line 359 : Array to string conversion
Array
Fast_Eddie
Users
Status:
Offline
User theme: Dark
Posts: 279 Joined: Aug 15th, '15, 18:25
Post
by Fast_Eddie » Mar 21st, '16, 20:09
Thanks 'D' You 'da man! That did the trick