Using deprecated API: use $config->set('Core.Encoding', ...) instead.... Solved

Discussion in 'General Support' started by pani100, Apr 12, 2012.

  1. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,034
    Likes Received:
    364
    Using deprecated API: use $config->set('Core.Encoding', ...) instead.... Solved (V.2)

    Anybody fed up with these messages?
    My NOTICE [1024] Using deprecated API: use $config->set('Core.Encoding', ...)
    My NOTICE [1024] Using deprecated API: use $config->set('HTML.Doctype', ...)

    I have downloaded the new version of HTML Purifier 4.4.0. In this there is a folder named library. This is exactly what is in includes/HTMLPurifier folder in webid. Name HTMLPurifier folder to something else(HTMLPurifierold) and then make a new folder HTMLPurifier, inside that drop all the files from the downloaded library folder.
    The HTMLPurifierold is just in case the new version does not work for you> if you have trouble just remove the new folder and rename the HTMLPurifierold to HTMLPurifier and your system will be as before.

    Now this will probably work on all versions but only tested it on the new.
    (EDITED 1/5/12 as must of been sleeping when I initially posted this)
    In sell.php find :

    // clean up sell description
    $conf = HTMLPurifier_Config::createDefault();
    $conf->set('Core', 'Encoding', $CHARSET); // replace with your encoding
    $conf->set('HTML', 'Doctype', 'HTML 4.01 Transitional'); // replace with your doctype

    and replace with:

    // clean up sell description
    $conf = HTMLPurifier_Config::createDefault();
    $conf->set('Core.Encoding', $CHARSET); // replace with your encoding
    $conf->set('HTML.Doctype', 'HTML 4.01 Transitional'); // replace with your doctype
     
    Last edited: May 1, 2012
    carls1976 likes this.
  2. Xeonn

    Xeonn New Member

    Joined:
    Dec 15, 2011
    Messages:
    372
    Likes Received:
    54
    add an attribute to html purifier filter, I'll send you it tomorrow evening.
     
  3. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,034
    Likes Received:
    364
    Thanks Xeon, now we making progress.
    Only 3 more annoying things that keep coming up all the time.
    Undefined index: B_AUTORELIST Undefined index: B_FEES, Undefined index: ATYPE_PLAIN. Starting new thread now.
     
  4. dmonco

    dmonco New Member

    Joined:
    Apr 21, 2012
    Messages:
    10
    Likes Received:
    0
    So, could you explain what to do?
    I have the same mistake:
    My NOTICE [1024] Using deprecated API: use $config->set('HTML.Doctype', ...) instead on includes/HTMLPurifier/HTMLPurifier/Config.php line 693
     
  5. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,034
    Likes Received:
    364
    Hello dmonco,
    Just follow the first post. If you don't want to update the HTMLPurifier just do the last part only:

    Now this will probably work on all versions but only tested it on the new.
    In includes/HTMLPurifier open HTMLPurifier.kses.php.
    Line 20 and 21 replace to :

    $config->set('HTML.AllowedElements', $allowed_elements);
    $config->set('HTML.AllowedAttributes', $allowed_attributes);

    The END at last from naging purifier.
     
  6. dmonco

    dmonco New Member

    Joined:
    Apr 21, 2012
    Messages:
    10
    Likes Received:
    0
    Hello, pani100
    But I've already done this and still has this error in line 693
     
  7. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,034
    Likes Received:
    364
    Hi dmonco,
    Have you also updated the HTMLPurifier to the latest version too as per 1st thread?
    If you have also updated it then I don't know what could be causing it.
    I have done exactly as the 1st thread and got rid of all the HTMLPurifier errors which appeared when making a new auction if i remember well.. I have also updated the ckeditor to the latest version. There is a thread about updating that too.
     
  8. dmonco

    dmonco New Member

    Joined:
    Apr 21, 2012
    Messages:
    10
    Likes Received:
    0
    No, I didn't update it, just did it. Thanks.
     
  9. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,034
    Likes Received:
    364
    Hi dmonco,
    keep us posted if that has cured your problem.
     
  10. carls1976

    carls1976 New Member

    Joined:
    Apr 19, 2012
    Messages:
    44
    Likes Received:
    1
    thanks for this pani
     
  11. Andrew Hacker

    Andrew Hacker New Member

    Joined:
    May 27, 2011
    Messages:
    15
    Likes Received:
    2
    Hi pani100. I just tried this - upgraded HTML purifier, but with no effect on the error message. I had a look at line 20 and 21 in includes/HTMLPurifier/HTMLPurifier.kses.php as you have said above...
    "Line 20 and 21 replace to :

    $config->set('HTML.AllowedElements', $allowed_elements);
    $config->set('HTML.AllowedAttributes', $allowed_attributes);"

    but they are identical to the lines you have suggested need replacing???? Am I missing something? I'd love to get rid of the nagging error too! If you can help shed any light on this I'd appreciate it.
     
  12. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    4,203
    Likes Received:
    313
    make sure that php on your erver is newer than version 4 if its not then you need to ask your hosts to update it as html purifier wont work on anything bellow version 5
     
  13. Guest

    Guest Guest

    if PHP 4 is not working
    guess then system requirements has to be rewritten

    Minimum Web Server requirements for proper operation of the WeBid Auction Script
    Apache web server
    PHP 4.0.X (safe_mode=OFF)
    or
    PHP 5.X (Recommended)
    with either having the following configuration:
    no open_basedir restriction
    if uses GD Libraries support, the GD Libraries version is 2.0 or greater.
    MySQL Database 4.1 or higher
    :)
     
    Last edited by a moderator: Jun 4, 2012
  14. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    4,203
    Likes Received:
    313
    There are plenty of threads in this forum stating that htmlpurifier will only work on php 5 or over so yeah that should be re writen
     
  15. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,034
    Likes Received:
    364
    Hi Andrew Hacker,
    Just been playing around with sell.php and noticed something that got me thinking.
    Look for line 129

    I have:
    $conf->set('Core.Encoding', $CHARSET); // replace with your encoding
    $conf->set('HTML.Doctype', 'HTML 4.01 Transitional'); // replace with your doctype

    (must of done on a very long night of webid alterations cause I can't remember putting it there.)
    and by the looks of things webid comes with

    $conf->set('Core', 'Encoding', $CHARSET); // replace with your encoding
    $conf->set('HTML', 'Doctype', 'HTML 4.01 Transitional'); // replace with your doctype


    Try replacing that and see if it helps.
    Post back with results as there are a few users here with this problem.
     
  16. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    4,203
    Likes Received:
    313
    Lines 20 and 21 already say that in all versions of htmlpurifier, DID YOU POST THE WRONG CODE???????????
     
  17. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,034
    Likes Received:
    364
    Nay27uk,
    You might be right....
    Lets start again shall we?

    Sorry about this guys, my excuse:
    (must of done on a very long night of webid alterations cause I can't remember putting it there.)

    In sell.php find :

    // clean up sell description
    $conf = HTMLPurifier_Config::createDefault();
    $conf->set('Core', 'Encoding', $CHARSET); // replace with your encoding
    $conf->set('HTML', 'Doctype', 'HTML 4.01 Transitional'); // replace with your doctype

    and replace with:

    // clean up sell description
    $conf = HTMLPurifier_Config::createDefault();
    $conf->set('Core.Encoding', $CHARSET); // replace with your encoding
    $conf->set('HTML.Doctype', 'HTML 4.01 Transitional'); // replace with your doctype

    (First post edited to match this)
     
    Last edited: May 1, 2012
  18. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    4,203
    Likes Received:
    313
    By the way dhal here you go this is taken directly from the install instructions for html purifier @ http://htmlpurifier.org/live/INSTALL

    NOTE THE:
    This exact error is somthing I am looking into while creating my new theme, when using the default theme there is no problem after submitting an auction I get the "your auction has been submited" page no problem, but on my new theme i get blank page and in admin error log I see.

    So somwhere in the default theme is somthing that stops this happening, my version of php is the latest
     
    Last edited: May 1, 2012
  19. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,034
    Likes Received:
    364
    Maybe try a Bosch washing machine.
    It's saying count does not mach though. Unless the description has some code in it that makes the query think it has seen a " ', " to move to another value, check your database auctions with the values inserted. It might be missing an insert if you have done any mods.
     
  20. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    4,203
    Likes Received:
    313
    hmmmm will try and sort that later but for now I want this html twat gone.
    I see what you meen about the code above on line 2 the code that has the ', ' is replaced with a .

    code as is
    PHP:
    ('Core''Encoding',
    new code
    PHP:
    ('Core.Encoding',
    I will give that a try and see what happens, first I must go and buy more cider
     
    Last edited: May 1, 2012

Share This Page