From 71642f88dd4e6f5996626908fc7369c19793fcfd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 12 Feb 2013 11:59:02 +0000 Subject: [PATCH] 2013-02-12 12:49 UTC+0100 Viktor Szakats (harbour syenar.net) * src/rtl/hbstrfmt.c * HB_STRFORMAT(): changed to not RTE if there is format string reference to a parameter missing at runtime, but instead simply ignore that parameter specifier. Format strings are primarily meant to help language translation of human readable strings. Old behavior could result in very difficult to test or predict runtime errors caused by typos, mistakes in translation (.po) files. It may also be unsafe in some situations, allowing DoS attack. TODO: To implement parameter checking, Harbour compiler should handle HB_STRFORMAT() as intrinsic function and test and warn if the number of parameter specifiers differs from the actual number of parameters passed, at compile time. Similar to GCC/CLANG. * contrib/hbhttpd/tests/files/main.css * extras/hbdoc/hbdoc.css * extras/httpsrv/home/css/base.css * website/css/styles.css * cleanups and applied http://csscomb.com --- harbour/ChangeLog.txt | 23 ++++ harbour/contrib/hbhttpd/tests/files/main.css | 31 ++--- harbour/extras/hbdoc/hbdoc.css | 10 +- harbour/extras/httpsrv/home/css/base.css | 130 +++++++++---------- harbour/src/rtl/hbstrfmt.c | 9 +- harbour/website/css/styles.css | 91 +++++++------ 6 files changed, 154 insertions(+), 140 deletions(-) diff --git a/harbour/ChangeLog.txt b/harbour/ChangeLog.txt index 8c4357c191..c2fe9c9897 100644 --- a/harbour/ChangeLog.txt +++ b/harbour/ChangeLog.txt @@ -10,6 +10,29 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-02-12 12:49 UTC+0100 Viktor Szakats (harbour syenar.net) + * src/rtl/hbstrfmt.c + * HB_STRFORMAT(): changed to not RTE if there is format + string reference to a parameter missing at runtime, + but instead simply ignore that parameter specifier. + Format strings are primarily meant to help language + translation of human readable strings. Old behavior + could result in very difficult to test or predict + runtime errors caused by typos, mistakes in translation + (.po) files. It may also be unsafe in some situations, + allowing DoS attack. + TODO: To implement parameter checking, Harbour compiler + should handle HB_STRFORMAT() as intrinsic function + and test and warn if the number of parameter specifiers + differs from the actual number of parameters passed, + at compile time. Similar to GCC/CLANG. + + * contrib/hbhttpd/tests/files/main.css + * extras/hbdoc/hbdoc.css + * extras/httpsrv/home/css/base.css + * website/css/styles.css + * cleanups and applied http://csscomb.com + 2013-02-11 21:51 UTC+0100 Viktor Szakats (harbour syenar.net) * utils/hbmk2/hbmk2.prg + ability to output help text in MarkDown format: diff --git a/harbour/contrib/hbhttpd/tests/files/main.css b/harbour/contrib/hbhttpd/tests/files/main.css index fb9f2f99f2..1a889aeafd 100644 --- a/harbour/contrib/hbhttpd/tests/files/main.css +++ b/harbour/contrib/hbhttpd/tests/files/main.css @@ -1,35 +1,36 @@ body, td { - font-family: Arial, sans-serif; - font-size: 13px; + font-size: 13px; + font-family: Arial, sans-serif; } table.ubr { - font-family: Arial, sans-serif; - font-size: 13px; - border-width: 1px; + font-size: 13px; + font-family: Arial, sans-serif; + border-width: 1px; } table.ubr th { - padding: 0px 4px 0px 4px; - background-color: #C0C0C0; + padding: 0px 4px 0px 4px; + background-color: #C0C0C0; } table.ubr tr { - background-color: #F0F0F0; + background-color: #F0F0F0; } table.ubr tr:hover { - background-color: #D0D0FF; + background-color: #D0D0FF; } tr.ubrr div { - width: auto; - white-space: nowrap; - overflow: hidden; + overflow: hidden; + width: auto; + white-space: nowrap; } ulnk { - text-color:blue; - text-decoration:underline; -} \ No newline at end of file + text-decoration:underline; + text-color:blue; +} + diff --git a/harbour/extras/hbdoc/hbdoc.css b/harbour/extras/hbdoc/hbdoc.css index b9bba91288..ab6d7868a7 100644 --- a/harbour/extras/hbdoc/hbdoc.css +++ b/harbour/extras/hbdoc/hbdoc.css @@ -3,29 +3,29 @@ @charset "utf-8"; body { - font-family: arial; font-size: 14px; + font-family: arial; line-height: 18px; } .name { - font-weight: bold; - font-size: 18px; margin-left: 0; padding-top: 0; padding-bottom: 4px; + font-weight: bold; + font-size: 18px; } .oneliner { - font-style: italic; margin-bottom: 12px; + font-style: italic; } .itemtitle { - font-weight: bold; margin-left: 0; padding-top: 0; padding-bottom: 4px; + font-weight: bold; } .itemtext { diff --git a/harbour/extras/httpsrv/home/css/base.css b/harbour/extras/httpsrv/home/css/base.css index 543824704d..08413062c7 100644 --- a/harbour/extras/httpsrv/home/css/base.css +++ b/harbour/extras/httpsrv/home/css/base.css @@ -1,66 +1,64 @@ - -body {font-family:Tahoma,Helvetica, Arial;font-size:10pt;color:black;} - -a.pageSection:link {color: #ff0000} -a.pageSection:visited {color: #0000ff} -a.pageSection:hover {background: #66ff66} - -/* -a:link {color: #ff0000} -a:visited {color: #0000ff} -a:hover {background: #66ff66} -*/ - -A { - color: #0000FF; - text-decoration: none; -} - -A:hover { color: #6699cc; text-decoration: underline; } -A.urls { color: #0A68B6; text-decoration: none; } -A.urls:hover { color: #6699cc; text-decoration: underline; } -A.tags { color: #008080; text-decoration: none; } -A.tags:hover { color: #6699cc; text-decoration: underline; } - - - -table.pagetable td -{ - padding: 3px; -} - -table.datatable -{ - width: 100%; - font-family: Verdana; - font-size: 12px; -} - -table.datatable tr th -{ - border-bottom:1px solid black; - padding: 2px; - text-align: left; -} - -table.datatable tr td -{ - vertical-align: top; - padding: 2px; - border-bottom: 1px solid white; -} - -table.datatable tr.odd -{ - background-color: #7FFFD4; -} - -table.datatable tr.even -{ - background-color: #F0F0F0; -} - -table.datatable tr.blank -{ - background-color: #FFFFFF; -} \ No newline at end of file + +body { color:black; font-size:10pt; font-family:Tahoma,Helvetica,Arial; } + +a.pageSection:link { color: #ff0000; } +a.pageSection:visited { color: #0000ff; } +a.pageSection:hover { background: #66ff66; } + +/* a:link { color: #ff0000; } */ +/* a:visited { color: #0000ff; } */ +/* a:hover { background: #66ff66; } */ + +A { + color: #0000FF; + text-decoration: none; +} + +A:hover { color: #6699cc; text-decoration: underline; } +A.urls { color: #0A68B6; text-decoration: none; } +A.urls:hover { color: #6699cc; text-decoration: underline; } +A.tags { color: #008080; text-decoration: none; } +A.tags:hover { color: #6699cc; text-decoration: underline; } + + + +table.pagetable td +{ + padding: 3px; +} + +table.datatable +{ + width: 100%; + font-size: 12px; + font-family: Verdana; +} + +table.datatable tr th +{ + padding: 2px; + border-bottom:1px solid black; + text-align: left; +} + +table.datatable tr td +{ + padding: 2px; + border-bottom: 1px solid white; + vertical-align: top; +} + +table.datatable tr.odd +{ + background-color: #7FFFD4; +} + +table.datatable tr.even +{ + background-color: #F0F0F0; +} + +table.datatable tr.blank +{ + background-color: #FFFFFF; +} diff --git a/harbour/src/rtl/hbstrfmt.c b/harbour/src/rtl/hbstrfmt.c index 4ffa6b8fc2..46ae6947e0 100644 --- a/harbour/src/rtl/hbstrfmt.c +++ b/harbour/src/rtl/hbstrfmt.c @@ -203,14 +203,7 @@ PHB_ITEM hb_strFormat( PHB_ITEM pItemReturn, PHB_ITEM pItemFormat, int iCount, P if( iParamNo == -1 ) iParamNo = ++iParam; - if( iParamNo > iCount ) - { - hb_xfree( buffer.pData ); - hb_errRT_BASE_SubstR( EG_ARG, 1099, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); - return NULL; - } - - pItem = pItemArray[ iParamNo - 1 ]; + pItem = ( iParamNo > iCount ) ? NULL : pItemArray[ iParamNo - 1 ]; } else pItem = NULL; diff --git a/harbour/website/css/styles.css b/harbour/website/css/styles.css index c5ff5f6943..9214045d8f 100644 --- a/harbour/website/css/styles.css +++ b/harbour/website/css/styles.css @@ -2,38 +2,38 @@ /* CSS Document */ body,td,th { - font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; + font-family: Verdana, Arial, Helvetica, sans-serif; } body { - background-color: #333333; - margin-left: 0; margin-top: 0; margin-right: 0; margin-bottom: 0; + margin-left: 0; + background-color: #333333; } .header1 { - /*font-weight: bolder;*/ - font-size: 20px; color: #bc0000; + /* font-weight: bolder; */ + font-size: 20px; } .text_under { text-decoration: underline; } .footer { - font-family: Arial, Helvetica, sans-serif; - font-size: 8px; color: #FFFFFF; + font-size: 8px; + font-family: Arial, Helvetica, sans-serif; } .title { + color: #bc0000; font-weight: bolder; font-size: 14px; - color: #bc0000; } .title_blue { + color: #06639d; font-weight: bolder; font-size: 14px; - color: #06639d; } .title_text { color: #000000; @@ -52,10 +52,10 @@ body { color: #666666; } .sample_linkback { - font-size: 9px; - font-style: italic; color: #000000; text-decoration: none; + font-style: italic; + font-size: 9px; } .black_link { color: #000000; @@ -65,8 +65,8 @@ body { text-decoration: none; } .read_more { - font-size: 9px; font-style: italic; + font-size: 9px; } a:hover { color: #FF0000; @@ -75,10 +75,10 @@ a:active { color: #FF0000; } -.tabela_box_trans_TL { background-image: url('/images/table-azul-top-left.gif'); background-repeat: no-repeat; background-position: 0 0; width: 6px; height: 6px;} -.tabela_box_trans_TR { background-image: url('/images/table-azul-top-right.gif'); background-repeat: no-repeat; background-position: top right; width: 6px; height: 6px;} -.tabela_box_trans_BR { background-image: url('/images/table-azul-bottom-right.gif'); background-repeat: no-repeat; background-position: bottom right; width: 6px; height: 6px;} -.tabela_box_trans_BL { background-image: url('/images/table-azul-bottom-left.gif'); background-repeat: no-repeat; background-position: bottom left; width: 6px; height: 6px;} +.tabela_box_trans_TL { width: 6px; height: 6px; background-image: url('/images/table-azul-top-left.gif'); background-position: 0 0; background-repeat: no-repeat; } +.tabela_box_trans_TR { width: 6px; height: 6px; background-image: url('/images/table-azul-top-right.gif'); background-position: top right; background-repeat: no-repeat; } +.tabela_box_trans_BR { width: 6px; height: 6px; background-image: url('/images/table-azul-bottom-right.gif'); background-position: bottom right; background-repeat: no-repeat; } +.tabela_box_trans_BL { width: 6px; height: 6px; background-image: url('/images/table-azul-bottom-left.gif'); background-position: bottom left; background-repeat: no-repeat; } /* * From xDevStudio export HTML tool... @@ -100,15 +100,15 @@ a:active { .pagina_titulo { color: #0066CC; text-transform: uppercase; - font-family: Arial, Helvetica, sans-serif; - font-size: 12pt; font-weight: bold; + font-size: 12pt; + font-family: Arial, Helvetica, sans-serif; } .pagina_titulo_non_captalize { color: #0066CC; - font-family: Arial, Helvetica, sans-serif; - font-size: 12pt; font-weight: bold; + font-size: 12pt; + font-family: Arial, Helvetica, sans-serif; } .pagina_subtitulo { color: #990000; @@ -120,29 +120,28 @@ a:active { } .texto_subtitulo { color: #0066CC; - font-style: italic; font-weight: bold; + font-style: italic; } .texto_subtitulo_maiusculo { color: #0066CC; - font-weight: bold; text-transform: uppercase; + font-weight: bold; } .redbox { - color: #bc0000; margin: 3px; + /* padding: 3px; */ + /* background-color: #FF0000; */ + color: #bc0000; font-style: italic; -/* padding: 3px; - background-color: #FF0000; - /***/ } .crew_country { - font-weight: bolder; color: #BC0000; + font-weight: bolder; } .crew_person_name { - font-weight: bolder; color: #1C69B7; + font-weight: bolder; } .crew_mail { color: #0099FF; @@ -157,10 +156,10 @@ a:active { text-decoration: none; } .crew_page_top { - background-image: url(/images/arrow_up.gif); - background-repeat: no-repeat; - background-position: right bottom; width: 7px; + background-image: url(/images/arrow_up.gif); + background-position: right bottom; + background-repeat: no-repeat; } .whitelink { color: #FFFFFF; @@ -175,32 +174,32 @@ a:active { font-weight: bolder; } .news_item { - background-image: url(/images/button-ok.jpg); - background-repeat: no-repeat; - background-position: 2px center; padding-left: 15px; + background-image: url(/images/button-ok.jpg); + background-position: 2px center; + background-repeat: no-repeat; } .news_info { - background-image: url(/images/button-info.jpg); - background-repeat: no-repeat; - background-position: 2px center; padding-left: 15px; + background-image: url(/images/button-info.jpg); + background-position: 2px center; + background-repeat: no-repeat; } .news_warn { - background-image: url(/images/button-yellow.jpg); - background-repeat: no-repeat; - background-position: 2px center; padding-left: 15px; + background-image: url(/images/button-yellow.jpg); + background-position: 2px center; + background-repeat: no-repeat; } .news_error { - background-image: url(/images/button-red.jpg); - background-repeat: no-repeat; - background-position: 2px center; padding-left: 15px; + background-image: url(/images/button-red.jpg); + background-position: 2px center; + background-repeat: no-repeat; } .news_fixed { - background-image: url(/images/button-green.jpg); - background-repeat: no-repeat; - background-position: 2px center; padding-left: 15px; + background-image: url(/images/button-green.jpg); + background-position: 2px center; + background-repeat: no-repeat; }