Author |
Message |
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Sun Oct 05, 2014 10:48 am |
|
Code:Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www.bestbuildpc.org/includes/kses/kses.php on line 561
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www.bestbuildpc.org/includes/kses/kses.php on line 102
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www.bestbuildpc.org/includes/kses/kses.php on line 561
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www.bestbuildpc.org/includes/kses/kses.php on line 102
|
|
Last edited by hicuxunicorniobestbuildpc on Fri Oct 17, 2014 1:59 pm; edited 1 time in total |
|
|
|
misterstereus
Regular
Joined: Aug 03, 2012
Posts: 56
Location: Rome Italy
|
Posted:
Sun Oct 05, 2014 11:17 am |
|
change preg_replace to preg_replace_callback |
_________________ MisterStereus from Rome Italy!! |
|
|
|
hicuxunicorniobestbuildpc
|
Posted:
Sun Oct 05, 2014 11:48 am |
|
that is not so easy otherwise I didn't post these errors. That is exactly I did but no luck! |
|
|
|
|
neralex
Site Admin
Joined: Aug 22, 2007
Posts: 1774
|
Posted:
Sun Oct 05, 2014 12:14 pm |
|
hicuxunicorniobestbuildpc wrote: | that is not so easy otherwise I didn't post these errors. That is exactly I did but no luck! |
... then change back your php version to a stable release for webservers or read the documentation on php.net!
Everytime if you changed things without to know what are you doing and then you are crying loudly here in these forums... |
_________________ Github: RavenNuke |
|
|
|
djmaze
Subject Matter Expert
Joined: May 15, 2004
Posts: 727
Location: http://tinyurl.com/5z8dmv
|
Posted:
Mon Oct 13, 2014 4:43 am |
|
Why is this hard?
Code:$data = preg_replace_callback('#([a-z]+)#', function($matches){
return str_rot13($matches[1]);
}, $data);
|
|
_________________ $ mount /dev/spoon /eat/fun auto,overclock 0 1
ERROR: there is no spoon
[ Only registered users can see links on this board! Get registered or login! ] |
|
|
|
hicuxunicorniobestbuildpc
|
Posted:
Mon Oct 13, 2014 5:47 am |
|
Thanks for your help djmaze but I did something like this with no luck
Code: return preg_replace('%(<'. # EITHER: <
'[^>]*'. # things that aren't >
'(>|$)'. # > or end of string
'|>)%e', # OR: just a >
"kses_split2('\\1', \$allowed_html, ".
'$allowed_protocols)',
$string);
} # function kses_split
|
Code:# Change back the allowed entities in our entity whitelist
$string = preg_replace('/&([A-Za-z][A-Za-z0-9]{0,19});/',
'&\\1;', $string);
$string = preg_replace('/&#0*([0-9]{1,5});/e',
'kses_normalize_entities2("\\1")', $string);
$string = preg_replace('/&#([Xx])0*(([0-9A-Fa-f]{2}){1,2});/',
'&#\\1\\2;', $string);
return $string;
} # function kses_normalize_entities
|
When I change it adding your function I still get the same error. I think I am not doing it properly. |
|
|
|
|
djmaze
|
Posted:
Fri Oct 17, 2014 6:43 am |
|
hicuxunicorniobestbuildpc wrote: | Thanks for your help djmaze but I did something like this with no luck |
Ehmmm did you try?
Code:function kses_split($string, $allowed_html, $allowed_protocols) {
return preg_replace_callback('%(<'. # EITHER: <
'[^>]*'. # things that aren't >
'(>|$)'. # > or end of string
'|>)%', # OR: just a >,
function($matches) use ($allowed_html, $allowed_protocols) {
return kses_split2($matches[1], $allowed_html, $allowed_protocols);
},
$string);
}
|
This should give you a good leap forward in the world of PHP 5.3.
Or maybe Ulf Harnhammar updated his code? |
|
|
|
|
hicuxunicorniobestbuildpc
|
Posted:
Fri Oct 17, 2014 1:40 pm |
|
This one solve the problem. The error is gone but I am getting a similar error in line 570.
Code:function kses_normalize_entities($string)
{
# Disarm all entities by converting & to &
$string = str_replace('&', '&', $string);
# Change back the allowed entities in our entity whitelist
$string = preg_replace_callback('/&([A-Za-z][A-Za-z0-9]{0,19});/',
'&\\1;', $string);
$string = preg_replace_callback('/&#0*([0-9]{1,5});/e',
'kses_normalize_entities2("\\1")', $string);
$string = preg_replace_callback('/&#([Xx])0*(([0-9A-Fa-f]{2}){1,2});/',
'&#\\1\\2;', $string);
return $string;
} # function kses_normalize_entities
|
I guess I must follow the same rule right?
Code:function kses_normalize_entities($string)
|
Must be(correct me if I do something wrong)
Code:function kses_normalize_entities($string, $allowed_html, $allowed_protocols) {
{
# Disarm all entities by converting & to &
$string = str_replace('&', '&', $string);
# Change back the allowed entities in our entity whitelist
$string = preg_replace_callback('&([A-Za-z][A-Za-z0-9]{0,19});',
'&\\1;', $string);
$string = preg_replace_callback('&#0*([0-9]{1,5});',
function($matches) use ($allowed_html, $allowed_protocols) {
return kses_normalize_entities2($matches[1], $allowed_html, $allowed_protocols);
},
$string);
$string = preg_replace_callback('&#([Xx])0*(([0-9A-Fa-f]{2}){1,2});',
'&#\\1\\2;', $string);
return $string;
} # function kses_normalize_entities
|
Let me know if what I did was correct. I am gonna test it now. Dank u!
Edited: I tried this one above but didn't work. I think I'm missing something. I removed the e which was deprecated and the functions but didn't work at all. |
Last edited by hicuxunicorniobestbuildpc on Tue Oct 21, 2014 6:17 am; edited 2 times in total |
|
|
|
djmaze
|
Posted:
Mon Oct 20, 2014 5:17 am |
|
You use preg_replace() while it should be preg_replace_callback() |
|
|
|
|
hicuxunicorniobestbuildpc
|
Posted:
Mon Oct 20, 2014 2:37 pm |
|
Oops! U are right. I am gonna try again. I think I'm out of sleep.
Here I am again!
I did the changes but I guess it will pull other functions out with error.
Code:function kses_normalize_entities($string, $allowed_html, $allowed_protocols) {
# Disarm all entities by converting & to &
$string = str_replace('&', '&', $string);
# Change back the allowed entities in our entity whitelist
$string = preg_replace_callback('&([A-Za-z][A-Za-z0-9]{0,19});',
'&\\1;', $string);
$string = preg_replace_callback('&#0*([0-9]{1,5});',
function($matches) use ($allowed_html, $allowed_protocols) {
return kses_normalize_entities2($matches[1], $allowed_html, $allowed_protocols);
},
$string);
$string = preg_replace_callback('&#([Xx])0*(([0-9A-Fa-f]{2}){1,2});',
'&#\\1\\2;', $string);
return $string;
} # function kses_normalize_entities
|
but I get this error
Code:Missing argument 2 for kses_normalize_entities(), called in /includes/kses/kses.php on line 64 and defined in /includes/kses/kses.php on line 555 Warning: Missing argument 3 for kses_normalize_entities(), called in /includes/kses/kses.php on line 64 and defined in /includes/kses/kses.php on line 555 Warning: preg_replace_callback(): Requires argument 2, '&\1;', to be a valid callback in /includes/kses/kses.php on line 565 Warning: preg_replace_callback(): No ending delimiter '&' found in /includes/kses/kses.php on line 570 Warning: preg_replace_callback(): Requires argument 2, '&#\1\2;', to be a valid callback in /includes/kses/kses.php on line 572
|
|
|
|
|
|
|