That sounds quite possible. If there is a way to test the URL with a .htaccess test tool, that would verify it. I don't know how much Joomla locks things down.RobInk wrote:Ok I checked the files, that line is correct already. Could it be a .htaccess protection on our sandbox setup?
Code: Select all
--- C:/Dev/feedcreator.class - Copy.php Mon May 05 10:48:00 2008
+++ C:/Dev/feedcreator.class.php Wed Sep 10 16:55:54 2008
@@ -1203,7 +1203,7 @@
$feed.= " </author>\n";
}
- if ($this->category!="") {
+ if ($this->items[$i]->category!="") {
$feed.= " <category term=\"" . htmlspecialchars($this->items[$i]->category) . "\" />\n";
}
Code: Select all
--- C:/Dev/smartfeed - Copy.php Fri Aug 08 07:43:18 2008
+++ C:/Dev/smartfeed.php Wed Sep 10 17:05:44 2008
@@ -312,6 +312,8 @@
// Because base64_encode was used instead of urlencode we get a relatively compact e parameter. However, this has one small
// drawback: + signs in e parameter are translated to a space character when read. Consequently we have to put them back in.
+ // ***BAD BUG: if a + sign appeared as the first or last character in the e parameter, PHP has already stripped it and it is lost for good.
+ // For this reason, I have changed things below to use "urlsafe" versions of base64_encode and _decode.
$encrypted_pswd = str_replace(' ','+',$encrypted_pswd);
// Decrypt password using the user_smartfeed_key column in the phpbb_users table. This should have gotten created
@@ -1099,6 +1101,11 @@
}
+function base64_decode_urlsafe($input)
+{
+ return base64_decode(strtr($input, '-_.', '+/='));
+}
+
function decrypt($encoded_64, $key)
{
@@ -1115,7 +1122,7 @@
$des->setKey($key);
// Decrypt
- $decrypted_data = $des->decrypt(base64_decode($encoded_64));
+ $decrypted_data = $des->decrypt(base64_decode_urlsafe($encoded_64));
return $decrypted_data;
}
Code: Select all
--- C:/Dev/smartfeed_url - Copy.php Wed Jul 30 21:15:50 2008
+++ C:/Dev/smartfeed_url.php Wed Sep 10 16:51:06 2008
@@ -70,6 +70,8 @@
$user_smartfeed_key = gen_rand_string(32);
$encrypted_password = encrypt($user_password, $user_smartfeed_key);
$encrypted_password_with_ip = encrypt($user_password . '~' . $_SERVER['REMOTE_ADDR'], $user_smartfeed_key);
+ // Comment [LRS]: it seems to me this is completely pointless, because base64_encode (and thus encrypt) will NEVER return anything
+ // containing an ampersand. It's impossible. So every possible key generated will be "clean", and $ampersand_loc will never be > 0.
$ampersand_loc = strpos($encrypted_password_with_ip, '&');
if ($ampersand_loc > 0)
{
@@ -453,6 +455,11 @@
page_footer();
+function base64_encode_urlsafe($input)
+{
+ return strtr(base64_encode($input), '+/=', '-_.');
+}
+
function encrypt($data_input, $key)
{
@@ -472,8 +479,8 @@
$des->setKey($key);
- // Encrypt
- $encrypted_data = base64_encode($des->encrypt($data_input));
+ // Encode
+ $encrypted_data = base64_encode_urlsafe($des->encrypt($data_input));
return $encrypted_data;
}
Lines 706 - 714 in smartfeed.php:XML Parsing Error: junk after document element
Location: http://www.example.com/smartfeed.php?&l ... e=HTMLSAFE
Line Number 72, Column 1:<b>[phpBB Debug] PHP Notice</b>: in file <b>/smartfeed.php</b> on line <b>708</b>: <b>Undefined variable: lastvisit</b><br />
^
Code: Select all
// Reset the user's last visit date on the forum, if so requested
if ($lastvisit)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_lastvisit = ' . time() . "
WHERE user_id = $user_id";
$result = $db->sql_query($sql);
}
Code: Select all
// Set up some variables
Code: Select all
$lastvisit = false;
Code: Select all
<input type="text" name="url" id="url" size="80" maxlength="3000" class="post" onfocus="this.select();" />
Code: Select all
if ($registered_user)
{
// Validate the removemine parameter, if present
Wolfgang,IPB_Refugee wrote:Hi Mark,
I tried to use your MOD as a guest with the following settings:
smartfeed.php?&limit=7_DAY&count_limit=15&sort_by=standard&feed_type=RSS2.0&feed_style=HTMLSAFE
This URL has been generated by smartfeed_url.php. (Is it correct, that directly after "?" there is a "&") Then I clicked on "Test" and got this error:
XML Parsing Error: junk after document element
Location: http://www.example.com/smartfeed.php?&l ... e=HTMLSAFE
Line Number 72, Column 1:<b>[phpBB Debug] PHP Notice</b>: in file <b>/smartfeed.php</b> on line <b>708</b>: <b>Undefined variable: lastvisit</b><br />
^
Oops, I use a style created by my own and this style uses just 80% of the available width. So you are probably right that size="80" doesn't cause a horizontal scroll bar in regular subsilver2 with 800px width. (BTW: That might also depend on the font size used by the style.)MarkDHamill wrote:As for the Generate URL box, I tested it in 800x600 resolution and don't see a horizontal scroll bar although text sure is scrunched up in the left column.
Code: Select all
'SMARTFEED_AJAX_ERROR' => 'An error occurred generating an AJAX request',
'SMARTFEED_INVALID_SESSION_KEY' => "sid argument value of %s is not valid for user_id = %s when calling smartfeed_url_new_key.$phpEx. Session may have expired.",
'SMARTFEED_NEW_KEY' => 'Generate a new phpBB Smartfeed key',
'SMARTFEED_NEW_KEY_EXPLAIN' => 'If you are concerned that the security to your feed has been compromised, you may want to create a new phpBB Smartfeed encryption key. If you change your key, you will have to reprogram your newsreaders to use the new generated URL.',
'SMARTFEED_NO_AJAX_SUPPORT' => 'A new key cannot be generated because this browser does not support AJAX',
'SMARTFEED_NO_SESSION_KEY' => "No sid argument was passed when calling smartfeed_url_new_key.$phpEx. There should normally be a sid parameter on the URL field.",
'SMARTFEED_NO_U_ARGUMENT' => "No u argument was passed when calling smartfeed_url_new_key.$phpEx",
Code: Select all
'SMARTFEED_AJAX_ERROR' => 'Beim Erzeugen einer AJAX-Anfrage ist ein Fehler aufgetreten.',
'SMARTFEED_INVALID_SESSION_KEY' => "Der sid-Parameter mit dem Wert %s ist für den Benutzer mit der ID %s nicht gültig. Möglicherweise ist die Session abgelaufen.",
'SMARTFEED_NEW_KEY' => 'Erzeuge einen neuen phpBB Smartfeed Schlüssel',
'SMARTFEED_NEW_KEY_EXPLAIN' => 'Wenn du Bedenken hast, dass die Sicherheit deines Feeds nicht mehr gewährleistet ist, kannst du einen neuen Schlüssel für die phpBB Smartfeed Verschlüsselung erzeugen. Wenn du deinen Schlüssel änderst, musst du deinem Newsreader die neu generierte URL bekannt geben.',
'SMARTFEED_NO_AJAX_SUPPORT' => 'Ein neuer Schlüssel kann nicht erzeugt werden, weil der Browser AJAX nicht unterstützt.',
'SMARTFEED_NO_SESSION_KEY' => "Beim Aufruf von smartfeed_url_new_key.$phpEx wurde kein sid-Parameter übergeben. Normalerweise sollte der sid-Parameter ein Bestandteil der URL sein.",
'SMARTFEED_NO_U_ARGUMENT' => "Beim Aufruf von smartfeed_url_new_key.$phpEx wurde kein u-Parameter übergeben.",
Some older browsers do not support AJAX but do support Javascript. If Javascript is turned off though no message would appear at all. I was working from an example on the w3schools.com site.Regarding SMARTFEED_NO_AJAX_SUPPORT: Wouldn't it be better to write that Javascript has to be enabled instead of "the browser does not support AJAX"? (Not everybody knows that AJAX is a Javascript technology.)
Yes, that's what it means.Regarding SMARTFEED_NEW_KEY_EXPLAIN: "you will have to reprogram your newsreaders to use the new generated URL" Does that mean that you simply have to tell the newsreader the new URL of the feed? (IF yes, my translation is okay.)
Thanks - I didn't know that. My translation above regarding SMARTFEED_NO_AJAX_SUPPORT and SMARTFEED_NEW_KEY_EXPLAIN should be okay then.MarkDHamill wrote:Some older browsers do not support AJAX but do support Javascript.