Problem with comments

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
azism
Posts: 69
Joined: Mon Nov 28, 2005 9:51 pm
Location: Tucson, AZ USA
Contact:

Problem with comments

Post by azism »

When entering as comment, the result is as follows:
Software Compliance

What is software rental non-compliance?

Unless the software publisher has clearly licensed the product for distribution by an ASP or other authorized software distributor, software cannot be rented. An exception could be a non-profit group when used by non-commercial renters.

Categories for this entry
Software Compliance
Last update: 2005-11-28 14:27
Author: Tom Wills

Print this record
Send to a friend
Show this as PDF file
Export as XML-File

Please rate this entry:
Average rating: 0 from 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You can comment on this entry

Comment of NDp0d2lsbHM6YTViZWQ0YTlmZTBlNGQ5OGM0NjljMzdlNzRlYjM0ODc6MTA6dGhyZWFkOjI6MDowOjA6VEk5OTo0MDk2:

There is a legal variation on the rental of software. Companies are able to lease software. This is not something that an individual will be able to do.
When clicking on "NDp0d2lsbHM6YTViZWQ0YTlmZTBlNGQ5OGM0NjljMzdlNzRlYjM0ODc6MTA6dGhyZWFkOjI6MDowOjA6VEk5OTo0MDk2" I get an email screen with an email address of myaddress_AT_myisp_DOT_com. Naturally MS Outlook won't even consider sending it.

Just wondering if this is normal? If so, I may have to consider not allowing comments. :cry:

If not, what happened :?:
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Code: Select all

myaddress_AT_myisp_DOT_com
stands for:

Code: Select all

myaddress@myisp.com
It is a rough but useful antispam feature: you could disable it opening inc/functions.php, searching for:

Code: Select all

function safeEmail($email)
{
	return str_replace(array('@', '.'), array('_AT_', '_DOT_'), $email);
}
and replacing it with:

Code: Select all

function safeEmail($email)
{
	return $email;
}
azism
Posts: 69
Joined: Mon Nov 28, 2005 9:51 pm
Location: Tucson, AZ USA
Contact:

Post by azism »

I understood the safemail thing. That was easy. In my case, the safemail code is meaningless anyway as only registered users will have access.

But what about that long crytic string? I would have expected the name of the person posting the comment.
Thorsten
Posts: 15749
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

the cryptic part is strange. What is the specific database field?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
azism
Posts: 69
Joined: Mon Nov 28, 2005 9:51 pm
Location: Tucson, AZ USA
Contact:

Post by azism »

The field was USR in the FAQCOMMENTS table. I know I saw it there as I had looked. However, after leaving the module, and logging in later at home, it gave the correct user name and the table entry is now correct. I will need to find another entry to which I can post a comment and see what happens.

WEIRD!
azism
Posts: 69
Joined: Mon Nov 28, 2005 9:51 pm
Location: Tucson, AZ USA
Contact:

Post by azism »

I just added another comment. The USR field in the FAQCOMMENT table shows:

NDp0d2lsbHM6YTViZWQ0YTlmZTBlNGQ5OGM0NjljMzdlNzRlYjM0ODc6MTA6dGhyZWFkOjI6MDowOjA6VEk5OTo0MDk2:
Thorsten
Posts: 15749
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

could you please enable the debug mode and add another comment. Then please post the SQL queries here.

Thanks!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
azism
Posts: 69
Joined: Mon Nov 28, 2005 9:51 pm
Location: Tucson, AZ USA
Contact:

Post by azism »

phpMyFAQ has a debug mode? How do I invoke that?
Thorsten
Posts: 15749
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

you can enable it in inc/init.php

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
azism
Posts: 69
Joined: Mon Nov 28, 2005 9:51 pm
Location: Tucson, AZ USA
Contact:

Post by azism »

Okay, the Debug shows the following after entering the comment:
DEBUG INFORMATION:
SELECT thema FROM faq_faqdata WHERE id = 91 AND lang = 'en'
SELECT id, lang, parent_id, name, description FROM faq_faqcategories WHERE lang = 'en' ORDER BY id
SELECT faq_faqcategories.id AS id, faq_faqcategories.lang AS lang, faq_faqcategories.parent_id AS parent_id, faq_faqcategories.name AS name, faq_faqcategories.description AS description FROM faq_faqcategoryrelations, faq_faqcategories WHERE faq_faqcategories.id=faq_faqcategoryrelations.category_id AND faq_faqcategoryrelations.record_id = 91 AND faq_faqcategoryrelations.category_lang = 'en'
SELECT count(sid) FROM faq_faqsessions WHERE time > 1133297506 GROUP BY ip
SELECT DISTINCT faq_faqdata.id AS id, faq_faqdata.lang AS lang, faq_faqdata.thema AS thema, faq_faqcategoryrelations.category_id AS category_id, faq_faqvisits.visits AS visits FROM faq_faqvisits, faq_faqdata LEFT JOIN faq_faqcategoryrelations ON faq_faqdata.id = faq_faqcategoryrelations.record_id AND faq_faqdata.lang = faq_faqcategoryrelations.record_lang WHERE faq_faqdata.lang = 'en' AND faq_faqdata.id = faq_faqvisits.id AND faq_faqdata.lang = faq_faqvisits.lang AND faq_faqdata.active = 'yes' ORDER BY faq_faqvisits.visits DESC
SELECT DISTINCT faq_faqdata.id AS id, faq_faqdata.lang AS lang, faq_faqcategoryrelations.category_id AS category_id, faq_faqdata.thema AS thema, faq_faqdata.datum AS datum, faq_faqvisits.visits AS visits FROM faq_faqvisits, faq_faqdata LEFT JOIN faq_faqcategoryrelations ON faq_faqdata.id = faq_faqcategoryrelations.record_id AND faq_faqdata.lang = faq_faqcategoryrelations.record_lang WHERE faq_faqdata.lang = 'en' AND faq_faqdata.id = faq_faqvisits.id AND faq_faqdata.lang = faq_faqvisits.lang AND faq_faqdata.active = 'yes' ORDER BY faq_faqdata.datum DESC
And the Debug shows the following after redisplaying the FAQ:
DEBUG INFORMATION:
SELECT thema FROM faq_faqdata WHERE id = 91 AND lang = 'en'
SELECT id, lang, parent_id, name, description FROM faq_faqcategories WHERE lang = 'en' ORDER BY id
SELECT faq_faqcategories.id AS id, faq_faqcategories.lang AS lang, faq_faqcategories.parent_id AS parent_id, faq_faqcategories.name AS name, faq_faqcategories.description AS description FROM faq_faqcategoryrelations, faq_faqcategories WHERE faq_faqcategories.id=faq_faqcategoryrelations.category_id AND faq_faqcategoryrelations.record_id = 91 AND faq_faqcategoryrelations.category_lang = 'en'
SELECT count(sid) FROM faq_faqsessions WHERE time > 1133297554 GROUP BY ip
SELECT DISTINCT faq_faqdata.id AS id, faq_faqdata.lang AS lang, faq_faqdata.thema AS thema, faq_faqcategoryrelations.category_id AS category_id, faq_faqvisits.visits AS visits FROM faq_faqvisits, faq_faqdata LEFT JOIN faq_faqcategoryrelations ON faq_faqdata.id = faq_faqcategoryrelations.record_id AND faq_faqdata.lang = faq_faqcategoryrelations.record_lang WHERE faq_faqdata.lang = 'en' AND faq_faqdata.id = faq_faqvisits.id AND faq_faqdata.lang = faq_faqvisits.lang AND faq_faqdata.active = 'yes' ORDER BY faq_faqvisits.visits DESC
SELECT DISTINCT faq_faqdata.id AS id, faq_faqdata.lang AS lang, faq_faqcategoryrelations.category_id AS category_id, faq_faqdata.thema AS thema, faq_faqdata.datum AS datum, faq_faqvisits.visits AS visits FROM faq_faqvisits, faq_faqdata LEFT JOIN faq_faqcategoryrelations ON faq_faqdata.id = faq_faqcategoryrelations.record_id AND faq_faqdata.lang = faq_faqcategoryrelations.record_lang WHERE faq_faqdata.lang = 'en' AND faq_faqdata.id = faq_faqvisits.id AND faq_faqdata.lang = faq_faqvisits.lang AND faq_faqdata.active = 'yes' ORDER BY faq_faqdata.datum DESC
The user name is
NDp0d2lsbHM6YTViZWQ0YTlmZTBlNGQ5OGM0NjljMzdlNzRlYjM0ODc6MTA6dGhyZWFkOjI6MDowOjA6VEk5OTo0MDk2
instead of twills. I hope this helps you.

Thanks! :)
Thorsten
Posts: 15749
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

okay, there's a base64 encoding problem. The string above contains "twills" with base64_decode().

Can your try to test the following code for the file savecomment.php:

Code: Select all

<?php
/**
* $Id: savecomment.php,v 1.7.2.6 2005/11/30 07:12:34 thorstenr Exp $
*
* Saves the posted comment
*
* @author       Thorsten Rinne <thorsten@phpmyfaq.de>
* @since        2002-08-29
* @copyright    (c) 2001-2005 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/

if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']));
    exit();
}

if (isset($_POST["user"]) && $_POST["user"] != "" && isset($_POST["mail"]) && $_POST["mail"] != "" && isset($_POST["comment"]) && $_POST["comment"] != "" && IPCheck($_SERVER["REMOTE_ADDR"])) {
    $id = (isset($_POST["id"])) ? (int)$_POST["id"] : 0;
	Tracking("save_comment", $id);

	$helped = ""; // not used in this version - maybe in the future
	$datum = date("YmdHis");
	$comment = nl2br($db->escape_string(safeHTML($_POST["comment"])));
    $comment_by_user = $db->escape_string(safeHTML($_POST["user"]));
    $comment_by_mail = $db->escape_string(safeHTML($_POST["mail"]));

	$result = $db->query("INSERT INTO ".SQLPREFIX."faqcomments (id_comment, id, usr, email, comment, datum, helped) VALUES (".$db->nextID(SQLPREFIX."faqcomments", "id_comment").", ".$id.",'".$comment_by_user."','".$comment_by_mail."','".$comment."','".$datum."','".$helped."')");

	$tpl->processTemplate ("writeContent", array(
				"msgCommentHeader" => $PMF_LANG["msgWriteComment"],
				"Message" => $PMF_LANG["msgCommentThanks"]
				));
} else {
	if (IPCheck($_SERVER["REMOTE_ADDR"]) == FALSE) {
		$tpl->processTemplate ("writeContent", array(
				"msgCommentHeader" => $PMF_LANG["msgWriteComment"],
				"Message" => $PMF_LANG["err_bannedIP"]
				));
    } else {
		Tracking("error_save_comment", $id);
		$tpl->processTemplate ("writeContent", array(
				"msgCommentHeader" => $PMF_LANG["msgWriteComment"],
				"Message" => $PMF_LANG["err_SaveComment"]
				));
	}
}

$tpl->includeTemplate("writeContent", "index");
Thanks!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
azism
Posts: 69
Joined: Mon Nov 28, 2005 9:51 pm
Location: Tucson, AZ USA
Contact:

Post by azism »

Thanks! That did it. The comment came out just fine this time. I'm glad it turned out the be a minor (?) fix.
Post Reply