Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1123

PostPosted: Sun Oct 05, 2014 10:48 am Reply with quote

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 
View user's profile Send private message
misterstereus
Regular
Regular



Joined: Aug 03, 2012
Posts: 56
Location: Rome Italy

PostPosted: Sun Oct 05, 2014 11:17 am Reply with quote

change preg_replace to preg_replace_callback Laughing

_________________
MisterStereus from Rome Italy!! 
View user's profile Send private message Send e-mail Visit poster's website
hicuxunicorniobestbuildpc







PostPosted: Sun Oct 05, 2014 11:48 am Reply with quote

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

PostPosted: Sun Oct 05, 2014 12:14 pm Reply with quote

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... Rolling Eyes

_________________
Github: RavenNuke 
View user's profile Send private message
djmaze
Subject Matter Expert



Joined: May 15, 2004
Posts: 727
Location: http://tinyurl.com/5z8dmv

PostPosted: Mon Oct 13, 2014 4:43 am Reply with quote

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! ] 
View user's profile Send private message Visit poster's website
hicuxunicorniobestbuildpc







PostPosted: Mon Oct 13, 2014 5:47 am Reply with quote

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('/&amp;([A-Za-z][A-Za-z0-9]{0,19});/',
                         '&\\1;', $string);
  $string = preg_replace('/&amp;#0*([0-9]{1,5});/e',
                         'kses_normalize_entities2("\\1")', $string);
  $string = preg_replace('/&amp;#([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







PostPosted: Fri Oct 17, 2014 6:43 am Reply with quote

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







PostPosted: Fri Oct 17, 2014 1:40 pm Reply with quote

:clap: 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 &amp;

  $string = str_replace('&', '&amp;', $string);

# Change back the allowed entities in our entity whitelist

  $string = preg_replace_callback('/&amp;([A-Za-z][A-Za-z0-9]{0,19});/',
                         '&\\1;', $string);
  $string = preg_replace_callback('/&amp;#0*([0-9]{1,5});/e',
                         'kses_normalize_entities2("\\1")', $string);
  $string = preg_replace_callback('/&amp;#([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 &amp;

  $string = str_replace('&', '&amp;', $string);

# Change back the allowed entities in our entity whitelist

  $string = preg_replace_callback('&amp;([A-Za-z][A-Za-z0-9]{0,19});',
                         '&\\1;', $string);
  $string = preg_replace_callback('&amp;#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('&amp;#([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







PostPosted: Mon Oct 20, 2014 5:17 am Reply with quote

You use preg_replace() while it should be preg_replace_callback()
 
hicuxunicorniobestbuildpc







PostPosted: Mon Oct 20, 2014 2:37 pm Reply with quote

Oops! U are right. I am gonna try again. I think I'm out of sleep. Smack

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 &amp;

  $string = str_replace('&', '&amp;', $string);

# Change back the allowed entities in our entity whitelist

  $string = preg_replace_callback('&amp;([A-Za-z][A-Za-z0-9]{0,19});',
                         '&\\1;', $string);
  $string = preg_replace_callback('&amp;#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('&amp;#([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 
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©