403 on geshi files on netmirror.org

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
winkiller
Regular
Posts: 77
Joined: Tue May 17, 2005 7:52 pm
Location: Munich, Germany
Contact:

403 on geshi files on netmirror.org

Post by winkiller »

Hey there,
think I remember having this once or twice only in the last few years, but atm http://netmirror.org/mirror/serendipity ... hi/asp.php and several other files in that directory yield a 403 in spartacus and the browser

Can't tell on which side the problem exists (i.e weong permissions before or after mirroring)

This and several others:
Versuche URL actionscript.php?rev=1.9999 zu öffnen...
Die URL http://netmirror.org/mirror/serendipity ... rev=1.9999 (IP 212.227.94.132) konnte nicht geöffnet werden. Möglicherweise existieren Server- oder Netzwerkprobleme.

(Der Mirror-Speicherort antwortet mit Fehler 403.)
Trying to use cURL library as fallback...
Forbidden

You don't have permission to access /mirror/serendipity/additional_plugins/serendipity_event_geshi/geshi/actionscript.php on this server.
cURL library returned a failure, too.
But cheers for 1.4 release :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: 403 on geshi files on netmirror.org

Post by garvinhicking »

Hi!

Thanks for reporting. My mirroring process mirrored the files and did not have read privileges, so the server didn't allow other users to read it. I tried to fix it, we'll see if it works tomorrow :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bugrep
Regular
Posts: 74
Joined: Tue Feb 24, 2009 8:19 am
Contact:

Re: 403 on geshi files on netmirror.org

Post by bugrep »

thats still a problem and the spartacus installation of geshi fails (silently? i didnt notice anything).

only the following files got installed:

Code: Select all

serendipity_event_geshi# find
.
./geshi
./geshi/css-gen.cfg
./geshi/actionscript-french.php
./readme.txt
./serendipity_event_geshi.php
./lang_de.inc.php
./UTF-8
./UTF-8/lang_de.inc.php
./UTF-8/lang_cs.inc.php
./UTF-8/lang_bg.inc.php
./UTF-8/lang_cz.inc.php
./lang_cs.inc.php
./lang_bg.inc.php
./lang_en.inc.php
./ChangeLog
./lang_cz.inc.php
after fetching the zip from http://spartacus.s9y.org/cvs/additional ... _geshi.zip and copying the missing files it works fine.

ive spotted two bugs.
1. when i tried to markup the example mentioned in the readme (http://php-blog.cvs.sourceforge.net/vie ... vision=1.2) in a comment, everything after "for (int i=0; i<" is deleted.
the whole line is "for (int i=0; i<nPlutoCoefficients; i++)".
it seems the html tag filter is (partly?) applied to geshi sections too. when i added a space after the "<" everything worked fine.
2. if you enable the markup for comments the help text "You can use [geshi lang=lang_name [,ln={y|n}]][/lang] tags to embed source code snippets" is added.
the [/lang] part should be [/geshi] and a full stop should be at the end as in the other markup help text "Enclosing asterisks marks text as bold (*word*), underscore are made via _word_."
and the full stop is missing in the spam avoidance help text too: "E-Mail addresses will not be displayed and will only be used for E-Mail notifications"
this should be at least consistant in all help texts... minor problem, but im a perfectionist (as you probably know by now ;)
bugrep
Regular
Posts: 74
Joined: Tue Feb 24, 2009 8:19 am
Contact:

Re: 403 on geshi files on netmirror.org

Post by bugrep »

the colors on dark background look - of course - not so well.
since they are encoded all over the $lang.php files, i dont want to change them.
id like to change the background of the div (or do you have a better idea?) instead.

EDIT: and i solved this, next posting.

problem is... the div class is named after the language... eg

Code: Select all

<div class="cpp" style="text-align: left">
it is inserted on line 3893 in geshi.php and there is an "overall_class" thing and an "overall_id" variable. their comments (line 775+) suggest that they are exactly what i want.
im not sure where to set them yet, but i need some sleep now :)

i think it would also be a good idea to add a small header like in the forum

Code: Select all

 thingy.
iirc the java script syntax highlighter has even something similar to the "select all", that would be cool too </dreams> :)
Last edited by bugrep on Thu Feb 26, 2009 8:45 am, edited 2 times in total.
bugrep
Regular
Posts: 74
Joined: Tue Feb 24, 2009 8:19 am
Contact:

Re: 403 on geshi files on netmirror.org

Post by bugrep »

w00t!
first i added an overall class to the geshi object to be able to select it from css:

Code: Select all

--- serendipity_event_geshi.php?revision=1.17	2009-02-26 06:43:54.767682075 +0000
+++ serendipity_event_geshi.php	2009-02-26 06:22:40.578456328 +0000
@@ -194,6 +194,7 @@
         // Have to get rid of newlines.
         // Left align per suggestion from Norbert Mocsnik
         $geshi->set_overall_style('text-align: left');
+        $geshi->set_overall_class('serendipity_geshi_block');
         return str_replace("\n", '', $geshi->parse_code());
     }
 }
this should not break anything (i grepped through my installation, and overall_class is not mentioned anywhere outside geshi).

then i modified the mt-trendy style.css to apply the same style as used in wp for geshi (http://www.mediawiki.org/wiki/Extension ... ight_GeSHi).
the diff is below.

we already discussed the first diff regarding the color and you said its commited, does not seem so?
the quicksearch thing is to hide the button, not related to geshi.
the sidebar whitespace style is to get dynamic sidebar resizing, not related.
and after that... there is a big block of "Additional plugin styles".
i did not add them myself. do the plugins add this, when they are installed?
only the last selector (serendipity_geshi_block) is from me and uses the patch above to modify the geshi block.

Code: Select all

--- style.css?revision=1.25	2009-02-26 06:48:57.133190172 +0000
+++ style.css	2009-02-26 06:51:35.791856828 +0000
@@ -2,11 +2,16 @@
 
 body {
   background-color: #333333;
-  color: black;
+/*  color: black;*/
+  color: #cccccc;
   font-family: Verdana, Arial, sans-serif;
   margin: 0px;
 }
 
+.quicksearch_submit{
+    display: none;
+}
+
 a,
 a:link,
 a:visited {
@@ -87,6 +92,7 @@
   margin-top: 35px;
   padding: 10px;
   vertical-align: top;
+  white-space: nowrap;
 }
 
 .serendipitySideBarTitle {
@@ -285,3 +291,62 @@
 .serendipity_comment_author_self {
     background-color: #000000;
 }
+
+
+/*** Additional plugin styles needed for the modernized output code ***/
+/*** added by Matthias 'YellowLed' Mees                             ***/
+
+.container_serendipity_archives_plugin ul,
+.container_serendipity_syndication_plugin ul,
+.container_serendipity_authors_plugin ul,
+.container_serendipity_plugin_entrylinks ul {
+    list-style: none;
+    margin-left: 0;
+    padding-left: 0;
+}
+
+.container_serendipity_authors_plugin .serendipitySideBarContent div {
+    margin: 5px 0;
+    padding-left: 0;
+}
+
+.serendipity_history_author { font-weight: bolder; }
+
+.serendipity_history_intro,
+.serendipity_history_info { margin-bottom: 3px; }
+
+.serendipity_history_body { margin-bottom: 10px; }
+
+.serendipity_recententries_entrylink { margin-bottom: 2px; }
+
+.serendipity_recententries_entrydate { margin: 0 0 4px 0; }
+
+.plugin_comment_body { padding: 3px 0; }
+
+.serendipity_shoutbox_date { margin: 5px 0 2px 0; }
+
+.serendipity_shoutbox_comment { padding: 4px 0; }
+
+.serendipity_geshi_block {
+  padding-top: 1em;
+  padding-right: 1em;
+  padding-bottom: 1em;
+  padding-left: 1em;
+  border-top-color: #2f6fab;
+  border-left-color: #2f6fab;
+  border-right-color: #2f6fab;
+  border-bottom-color: #2f6fab;
+  border-top-width: 1px;
+  border-left-width: 1px;
+  border-right-width: 1px;
+  border-bottom-width: 1px;
+  border-top-style: dashed;
+  border-left-style: dashed;
+  border-right-style: dashed;
+  border-bottom-style: dashed;
+  color: #000000;
+  background-color: #f9f9f9;
+  line-height: 1.1em;
+}
+
+/*** End Additional plugin styles                                   ***/
its not perfect... id like a whole new set of colors, so that i dont have bright big blocks inside my blog, but all the colors are spread over the php files... so for now, thats the best option for dark templates imho.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: 403 on geshi files on netmirror.org

Post by garvinhicking »

Hi!
bugrep wrote:thats still a problem and the spartacus installation of geshi fails (silently? i didnt notice anything).
On the screen where it says which files are getting installed, did you see download failures? The files should all be there in CVS, which is the base for downloading the files, as well as mirrored in netmirror.org: http://netmirror.org/mirror/serendipity ... shi/geshi/

1. when i tried to markup the example mentioned in the readme (http://php-blog.cvs.sourceforge.net/vie ... vision=1.2) in a comment, everything after "for (int i=0; i<" is deleted.
the whole line is "for (int i=0; i<nPlutoCoefficients; i++)".
it seems the html tag filter is (partly?) applied to geshi sections too. when i added a space after the "<" everything worked fine.
Comments do get HTML-Tags stripped completely, yes. I haven't used geshi personally, but I thought it would HTML-translate < to < - doesn't it?
2. if you enable the markup for comments the help text "You can use [geshi lang=lang_name [,ln={y|n}]][/lang] tags to embed source code snippets" is added.
the [/lang] part should be [/geshi] and a full stop should be at the end as in the other markup help text "Enclosing asterisks marks text as bold (*word*), underscore are made via _word_."
Thanks, fixed both grammar issues.

As for geshi output: We use the distributed geshi thing, so changes to the DIV structure or feature set must be implemented by the geshi developers, then we can upgrade to their latest library. I have added your set_overall_class though, but I used "geshi" as the classname to keep the HTML output a bit smaller.

Yes, plugins do add CSS styles to the serendipity.css.php output, so there is dynamic content. I've committed the necessary changes to the style.css of mt-trendy.

Thanks for your help,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bugrep
Regular
Posts: 74
Joined: Tue Feb 24, 2009 8:19 am
Contact:

Re: 403 on geshi files on netmirror.org

Post by bugrep »

garvinhicking wrote:
On the screen where it says which files are getting installed, did you see download failures? The files should all be there in CVS, which is the base for downloading the files, as well as mirrored in netmirror.org: http://netmirror.org/mirror/serendipity ... shi/geshi/
im not sure, if there were errors, sorry. but this event is a good show case for a design choice i did not like, when i noticed it: when installing plugins they produce quite verbose (but somewhat unstructured... as in "not in a table") output, even if everything is successful. users tend to get used to this, and scroll through quickly. imho it would be better to just show "everything installed correctly", when there are no errors and show verbose output only, if there are problems.

i could try to reinstall geshi, to debug this, but isnt the error obvious? if i try to download the php files (e.g. http://netmirror.org/mirror/serendipity ... i/abap.php) with my browser i get a 403.
garvinhicking wrote: Comments do get HTML-Tags stripped completely, yes. I haven't used geshi personally, but I thought it would HTML-translate < to < - doesn't it?
the problem is not that html-tags get stripped, but that "<nPlutoCoefficients; i++)...." is not a html-tag.
"<" is converted to &lt, if it passes the html stripper, ie if there is a space after it.
is it possible to get geshi to parse before the html stripper? because to me it looks like thats the problem.
garvinhicking wrote: As for geshi output: We use the distributed geshi thing, so changes to the DIV structure or feature set must be implemented by the geshi developers, then we can upgrade to their latest library. I have added your set_overall_class though, but I used "geshi" as the classname to keep the HTML output a bit smaller.

... I've committed the necessary changes to the style.css of mt-trendy.
the intention of "_block" was to be prepared for further changes, but could be changed, when there is a need to.

thanks for committing! :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: 403 on geshi files on netmirror.org

Post by garvinhicking »

Hi!

Ah, I see that HTTP error now. Sorry I didn't notice before. It might be the synchronized access privileges; I'll try to touch the files to force an update, I can see tomorrow if that worked.

About the verbose output: It was added to early spartacus versions to ensure that people saw something when they had network issues, and they would always transparently see what's going on. I agree that it would be much nicer now if the output could be grouped, so that errors become more apparent.
the problem is not that html-tags get stripped, but that "<nPlutoCoefficients; i++)...." is not a html-tag.
Yeah, but PHP's strip_tags() functions sees this differently ;-)
"<" is converted to &lt, if it passes the html stripper, ie if there is a space after it.
is it possible to get geshi to parse before the html stripper? because to me it looks like thats the problem.
Currently, s9y applies that before the input is passed to plugins. This is mainly due to historical reasons to be compatible with markup plugins. There is a s9y plugin, serendipity_event_unstrip_tags which can "undo" the stripping - so I currently only see the possibility for you to use that plugin. Maybe functionality of this could be ported inside the geshi markup plugin, because it mostly always deals with code where unstripping should be done. On the other hand, this could imply some security issues, so it needs to be done thoroughly...

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
bugrep
Regular
Posts: 74
Joined: Tue Feb 24, 2009 8:19 am
Contact:

Re: 403 on geshi files on netmirror.org

Post by bugrep »

since its for geshi code in comments only, i dont think its worth fixing (since its not an easy fix)
at least its documented now in this thread, good enough for me :)

thanks!
Post Reply