SimplePortal

Development => Bugs => Fixed or Bogus Bugs => Topic started by: MESSIAH on April 05, 2012, 03:28:56 PM

Title: Error with /index.php?news8=
Post by: MESSIAH on April 05, 2012, 03:28:56 PM
I noticed for this error different endings URL
Quote
http://yoump3.pl/index.php?news8=http%3A%2F%2Fwww.sjoseoperario.com.br%2Ffotos%2Faney%2Fisow%2F
Quote
http://yoump3.pl/index.php?news8=http%3A%2F%2Fwww.horsedrawncaravans.com%2F_de%2Fimu%2Fmovidi%2F

Look in this URLs: all are similar - http://mywebsite + news8= + http://someshitwebsite
Title: Re: Error with /index.php?news8=
Post by: AngelinaBelle on April 09, 2012, 09:11:11 PM
Some sites have linked to your site with this "news8=" in the URL.
And you are contributing to the problem right here, right now, by providing such links here at simpleportal.net.

I do not know which website has started this problem for you, but I think you may want to edit this post to break up the URL, so you do not give Google more amunition for this.


I do not know the reason for the rest of it.  Can you attach your Subs.php?
Title: Re: Error with /index.php?news8=
Post by: ccbtimewiz on April 09, 2012, 09:26:49 PM
SMF should throw out requests that it can't find instead of processing them... a fresh file shows that line to be:

Code: [Select]
$pageindex .= sprintf($base_link, $tmpStart, $tmpStart / $num_per_page + 1);
An argument is not being passed properly, what modifications have you made to your forum that pertain to URL rewriting or similar?
Title: Re: Error with /index.php?news8=
Post by: MESSIAH on April 10, 2012, 03:31:59 AM
Some sites have linked to your site with this "news8=" in the URL.
And you are contributing to the problem right here, right now, by providing such links here at simpleportal.net.

I do not know which website has started this problem for you, but I think you may want to edit this post to break up the URL, so you do not give Google more amunition for this.


I do not know the reason for the rest of it.  Can you attach your Subs.php?

I once had a small problem with spam bots
Now, the problem disappeared. sometimes I have a problem with this:
Code: [Select]
http://yoump3.pl/index.php?/%5Bobject%20Object%5D
2: sprintf() [<a href='function.sprintf'>function.sprintf</a>]: Too few arguments
Plik: /home/messiah/public_html/Sources/Subs.php
Linia: 662
Does this argument comes from simpleportal?
Title: Re: Error with /index.php?news8=
Post by: MESSIAH on April 10, 2012, 03:34:57 AM
SMF should throw out requests that it can't find instead of processing them... a fresh file shows that line to be:

Code: [Select]
$pageindex .= sprintf($base_link, $tmpStart, $tmpStart / $num_per_page + 1);
An argument is not being passed properly, what modifications have you made to your forum that pertain to URL rewriting or similar?

I have no idea. I have a few mods but I do not think to interfere in the links
Title: Re: Error with /index.php?news8=
Post by: AngelinaBelle on April 10, 2012, 01:57:32 PM
Line 662 of Subs.php looks identical to the fresh copy to me.
Please look at the HTML of your web page.  You will see, in the pagination for your front-page boardnews items,
/?news8=3

If, instead, it were
/news8=3
or else
?news8=3

Then everything seems to be OK.

Where does news8 come from? from function sp_boardNews
Code: [Select]
  $limit = count($posts);
  $start = !empty($_REQUEST['news' . $id]) ? (int) $_REQUEST['news' . $id] : 0;
  $clean_url = preg_replace('~news' . $id . '=\d+;?~', '', $_SERVER['REQUEST_URL']);
  $current_url = $clean_url . (strpos($clean_url, '?') !== false ? (in_array(substr($clean_url, -1), array(';', '?')) ? '' : ';') : '?');
  $page_index = constructPageIndex($current_url . 'news' . $id . '=%1$d', $start, $limit, $per_page, true);
I think the line which starts with $current_url might be sticking the "?" in where it does not belong.
I am going to ask devs, customizers, and debuggers about this one.
Do you have any mods related to the URL? something for prettifying the URL?
Are you using a pretty URLs setting in SMF?
Thanks for the additional information.

 
Title: Re: Error with /index.php?news8=
Post by: MESSIAH on April 10, 2012, 02:21:43 PM
Do you have any mods related to the URL? something for prettifying the URL?
Check my attachment
Zainstaluj modyfikacje = install mod
Odinstaluj = uninstall
Are you using a pretty URLs setting in SMF?
No i use default settings

You welcome -  teach me PHP then I will help others :)
I saw your tests. Do not see any errors in the logs. If You want I do the test account for You.
Thanks for the additional information.
Title: Re: Error with /index.php?news8=
Post by: AngelinaBelle on April 10, 2012, 02:48:39 PM
Thanks for that list.
So perhaps simpleportal is confused about whether http://yoump3.pl/ is "pretty" or not.
When we start with http://yoump3.pl/index.php, there is never any problem with the pagination.

I would not be a very good php teacher.  I learned what I know about it by reading tutorials and manuals online and reading the SMF files for examples.

Your list looks like both SimplePortal 2.3.4 and SimplePortal 2.3.5 are installed.  This is not a good thing.
Title: Re: Error with /index.php?news8=
Post by: MESSIAH on April 10, 2012, 02:56:45 PM
Your list looks like both SimplePortal 2.3.4 and SimplePortal 2.3.5 are installed.  This is not a good thing.
SimplePortal 2.3.4 - Polish language
SimplePortal 2.3.5 - Actived mod

I still waiting for 2.3.5 - Polish language

BTW - I almost forgot. Some months ago I changed my domain name to yoump3.pl. - audioground.pl redirected to the current - this could be the cause of errors?
Title: Re: Error with /index.php?news8=
Post by: AngelinaBelle on April 10, 2012, 03:44:03 PM
That makes more sense.  I am sorry that I do not read Polish.
It could help if you change the redirect so it goes to yoump3.pl/index.php

Everything seems to be fine if you start at  yoump3.pl/index.php
Title: Re: Error with /index.php?news8=
Post by: MESSIAH on April 10, 2012, 04:23:47 PM
That makes more sense.  I am sorry that I do not read Polish.
It could help if you change the redirect so it goes to yoump3.pl/index.php

Everything seems to be fine if you start at  yoump3.pl/index.php

Can You explain why? Why i need redirect to file? Now i just fine i have no errors. I wait few days and will see what's happening
Title: Re: Error with /index.php?news8=
Post by: AngelinaBelle on April 11, 2012, 08:09:13 AM
When you use http://yoump3.pl/, the links for the pages are malformed (search the HTML for news8, and you will see this). Whenever I clicked on them, it was some kind of error, and the next page did not show like it should show.

Today, when I use http://yoump3.pl/, I see the same malformed links (when I search the HTML for news8), but they do not seem to cause any error.

What has changed?

Did this fix your problem entirely?
Title: Re: Error with /index.php?news8=
Post by: MESSIAH on April 15, 2012, 06:31:05 AM
Today, GoogleBot once again made ​​the same error:
Guest: Ip - 66.249.66.85
Quote
http://yoump3.pl/index.php?news8=http%3A%2F%2Fmittelseiferswitz.de%2Fgb%2Fdatenbank%2Fsanopid%2Fevoxuf%2F
and
Quote
http://yoump3.pl/index.php?news8=http%3A%2F%2Fwww.sjoseoperario.com.br%2Ffotos%2Faney%2Fisow%2F
Tell me simple as You can - what I need to do.

My formu are using UTF-8.
Title: Re: Error with /index.php?news8=
Post by: MESSIAH on April 16, 2012, 08:19:06 AM
In CPanel -> Error log
I see something like that:

Quote
[Mon Apr 16 13:11:44 2012] [error] [client "My IP"] File does not exist: /home/messiah/public_html/[object Object]

What is this [object Object]
SMF is a problem or SimplePortal?
Title: Re: Error with /index.php?news8=
Post by: AngelinaBelle on April 16, 2012, 09:20:34 AM
Redirect to http://yoump3.pl/index.php and this will work around the problem.

I am not familiar with this cpanel error.  How often does this one happen?
Is there any SMF error at the same time?

Title: Re: Error with /index.php?news8=
Post by: MESSIAH on April 16, 2012, 09:36:19 AM
How to do redirect to file index.php?
Error in CPanel is always when someone enters the site
Look at this:
http://yoump3.pl/index.php?/%5Bobject%20Object%5D
2: sprintf() [<a href='function.sprintf'>function.sprintf</a>]: Too few arguments
Plik: /home/messiah/public_html/Sources/Subs.php
Linia: 662
Quote
[Mon Apr 16 13:11:44 2012] [error] [client "My IP"] File does not exist: /home/messiah/public_html/[object Object]
this %5Bobject%20Object%5D is this same [object Object]

Yes I got allways doubled error - second error after 2 sec
Title: Re: Error with /index.php?news8=
Post by: AngelinaBelle on April 16, 2012, 09:43:09 AM
I understand now.  Yes.  I think there is a bug. When "index.php" does not appear in the URL, but prettyprint is not on, SimplePortal is making the URL wrong in the pagination.

The workaround I gave above should help.
You might even consider using an .htaccess file to force the URL to be rewritten to include index.php.
Title: Re: Error with /index.php?news8=
Post by: MESSIAH on April 16, 2012, 10:28:31 AM
 :|
I uninstall SimplePortal (with one error in QuerySting.php but I delete manualy) the error is still in CPanel
This is my .htaccess:
Code: [Select]
RewriteEngine on

# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName messiah.star-kom.pl
AuthUserFile /home/messiah/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/messiah/public_html/_vti_pvt/service.grp

RewriteCond %{HTTP_HOST} ^herbate\.pl$ [OR]
RewriteCond %{HTTP_HOST} ^www\.herbate\.pl$
RewriteRule ^/?$ "http\:\/\/herbate\.pl\/herbate" [R=301,L]

RewriteCond %{HTTP_HOST} ^audioground\.pl$ [OR]
RewriteCond %{HTTP_HOST} ^www\.audioground\.pl$
RewriteRule ^/?$ "http\:\/\/yoump3\.pl\/index\.php" [R=301,L]
Title: Re: Error with /index.php?news8=
Post by: MESSIAH on April 16, 2012, 12:02:14 PM
I found what is this [object Object] - this is from Facebook slider.
Now I need to clue news8=URLs
Title: Re: Error with /index.php?news8=
Post by: AngelinaBelle on April 16, 2012, 01:41:39 PM
I think this is caused by a bug in how SimplePortal writes the pagination if
1) you are not using pretty URLS
2) You do not have index.php in the URL

I am not sure how to fix the code.

The workaround is
1) On the other website, which is now redirecting to http://yoump3.pl (http://yoump3.pl), instead use http://yoump3.pl/index.php (http://yoump3.pl/index.php)
2) It seems as though your rewrite rule is not doing this job.  I think that is because ? does not match the empty string.  I am no expert at rewrite rules. So I will guess.  I think you will have to play some with this.  Please give it a try.
Code: [Select]
# If the filename is empty, then there is also no query string (assuming you are not using pretty URLs)
# This RewriteCond might not be necessary; please try with and without the RewriteCond
RewriteCond expr "%{SCRIPT_FILENAME}  -z"
# No redirection is required; simply fix the URL on the fly before SMF gets hold of it.
RewriteRule ^$ index\.php
Title: Re: Error with /index.php?news8=
Post by: emanuele on April 25, 2014, 04:56:19 PM
Digging this out from the depths of oblivion. :P

Actually I would consider this a small bug in SP.
In particular the problem is with this regex:
Code: [Select]
$clean_url = preg_replace('~news' . $id . '=\d+;?~', '', $_SERVER['REQUEST_URL']);it expects that news8 is a number, and if it is not it gets confused.
It may be a bit drastic, only SiNaN can tell for sure I think, though I'd change it to:
Code: [Select]
$clean_url = preg_replace('~news' . $id . '=[^;]+~', '', $_SERVER['REQUEST_URL']);
At least that way the code passed url is for sure clean. No idea if it breaks anything else... :angel:
Title: Re: Error with /index.php?news8=
Post by: AngelinaBelle on April 28, 2014, 02:32:08 PM
Thanks for the suggestion, emanuele.

I have reported it as an issue. I hope there will be a chance to evaluate this suggested fix.
Title: Re: Error with /index.php?news8=
Post by: [SiNaN] on August 13, 2014, 03:39:37 PM
Thanks for the suggested fix - it makes sense, indeed. The real cause of the issue was that % characters weren't escaped for sprintf in constructPageIndex function. Both of them should be fixed now.
SimplePortal 2.3.8 © 2008-2024, SimplePortal