|
From: Sebastian D. <se...@us...> - 2006-03-06 13:50:18
|
Update of /cvsroot/wackofork/wiki/actions/magpierss In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1832 Modified Files: CHANGES ChangeLog rss_cache.inc rss_fetch.inc rss_parse.inc Log Message: - Version 0.72 eingespielt Index: ChangeLog =================================================================== RCS file: /cvsroot/wackofork/wiki/actions/magpierss/ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ChangeLog 3 Feb 2006 23:09:01 -0000 1.1 --- ChangeLog 6 Mar 2006 13:50:11 -0000 1.2 *************** *** 1,19 **** ! 2004-11-21 22:45 kellan * rss_fetch.inc: detab, bump version ! 2004-11-21 20:52 kellan * rss_fetch.inc, rss_parse.inc: cache on $url . $output_encoding otherwise we can get munged output * rss_parse.inc: don't set ERROR on notice or warning (rss_fetch dies on parse errors) * rss_fetch.inc: add encoding defines (fix timeout error reporting) ! 2004-11-21 17:21 kellan * rss_parse.inc: incorporate steve's patch ! 2004-11-21 16:26 kellan * rss_parse.inc: remove old debugging functions, totally --- 1,78 ---- ! 2005-10-28 14:11 kellan ! ! * extlib/Snoopy.class.inc: a better solution ! ! 2005-10-28 11:51 kellan ! ! * extlib/Snoopy.class.inc: fix arbtriary code execution ! vulnerability when using curl+ssl ! ! http://www.sec-consult.com/216.html ! ! 2005-03-08 10:46 kellan ! ! * rss_parse.inc: fix bug w/ atom and date normalization ! ! 2005-02-09 14:59 kellan ! ! * rss_fetch.inc: fix stale cache bug ! ! 2005-01-28 02:27 kellan ! ! * rss_parse.inc: support php w/o array_change_case ! ! 2005-01-23 20:02 kellan ! ! * rss_fetch.inc: fix cache bug introduced by charset encoding ! ! 2005-01-12 09:14 kellan ! ! * rss_cache.inc, rss_fetch.inc: more sanity checks for when things ! go wrong ! ! 2004-12-12 13:44 kellan ! ! * INSTALL, rss_cache.inc, rss_utils.inc: detab ! ! 2004-11-23 20:15 kellan ! ! * rss_parse.inc: fix calling iconv instead of mb_convert_encoding ! ! 2004-11-22 02:11 kellan ! ! * CHANGES, ChangeLog, rss_parse.inc, scripts/magpie_debug.php: last ! bit of tidying ! ! 2004-11-22 01:45 kellan * rss_fetch.inc: detab, bump version ! 2004-11-22 01:43 kellan ! ! * rss_parse.inc: was filtering too much ! ! 2004-11-22 00:03 kellan * rss_fetch.inc, rss_parse.inc: cache on $url . $output_encoding otherwise we can get munged output + + 2004-11-21 23:52 kellan + + * rss_parse.inc: add WARNING + + 2004-11-21 23:45 kellan + * rss_parse.inc: don't set ERROR on notice or warning (rss_fetch dies on parse errors) + + 2004-11-21 23:44 kellan + * rss_fetch.inc: add encoding defines (fix timeout error reporting) ! 2004-11-21 20:21 kellan * rss_parse.inc: incorporate steve's patch ! 2004-11-21 19:26 kellan * rss_parse.inc: remove old debugging functions, totally *************** *** 21,54 **** doing this. ! 2004-10-28 12:52 kellan * rss_parse.inc: fixed '=' instead of '==' ! 2004-10-25 21:48 kellan * rss_parse.inc: chance epoch to timestamp to conform w/ php naming conventions ! 2004-06-15 09:00 kellan * rss_parse.inc: [no log message] ! 2004-04-26 11:16 kellan * rss_fetch.inc: bump version ! 2004-04-26 09:36 kellan * rss_parse.inc: fix field doubling ! 2004-04-24 14:47 kellan * CHANGES, ChangeLog: updated ! 2004-04-24 14:35 kellan * rss_fetch.inc: bumped version ! 2004-04-24 13:52 kellan * rss_parse.inc: support arbitrary atom content constructs --- 80,113 ---- doing this. ! 2004-10-28 15:52 kellan * rss_parse.inc: fixed '=' instead of '==' ! 2004-10-26 00:48 kellan * rss_parse.inc: chance epoch to timestamp to conform w/ php naming conventions ! 2004-06-15 12:00 kellan * rss_parse.inc: [no log message] ! 2004-04-26 14:16 kellan * rss_fetch.inc: bump version ! 2004-04-26 12:36 kellan * rss_parse.inc: fix field doubling ! 2004-04-24 17:47 kellan * CHANGES, ChangeLog: updated ! 2004-04-24 17:35 kellan * rss_fetch.inc: bumped version ! 2004-04-24 16:52 kellan * rss_parse.inc: support arbitrary atom content constructs *************** *** 56,69 **** some refactoring ! 2004-04-24 13:15 kellan * rss_parse.inc: support summary content contstruct. add normalize function ! 2004-03-27 13:29 kellan * extlib/Snoopy.class.inc: accept self-signed certs ! 2004-03-27 09:53 kellan * extlib/Snoopy.class.inc: fixed SSL support * set status * set --- 115,128 ---- some refactoring ! 2004-04-24 16:15 kellan * rss_parse.inc: support summary content contstruct. add normalize function ! 2004-03-27 16:29 kellan * extlib/Snoopy.class.inc: accept self-signed certs ! 2004-03-27 12:53 kellan * extlib/Snoopy.class.inc: fixed SSL support * set status * set *************** *** 73,187 **** were getting in my way ! 2004-01-24 23:25 kellan * rss_parse.inc: make RSS 1.0's rdf:about available ! 2004-01-24 23:07 kellan * rss_parse.inc: clean up text, and line formats. add support item rdf:about ! 2004-01-24 20:40 kellan * CHANGES, ChangeLog: update changes ! 2004-01-24 20:37 kellan * rss_fetch.inc: updated version ! 2004-01-24 20:35 kellan * rss_parse.inc: whitespace ! 2004-01-24 20:23 kellan * extlib/Snoopy.class.inc: support badly formatted http headers ! 2004-01-24 20:20 kellan * rss_parse.inc: added alpha atom parsing support ! 2003-06-25 19:34 kellan * extlib/Snoopy.class.inc: fixed fread 4.3.2 compatibility problems ! 2003-06-13 08:31 kellan * rss_fetch.inc: reset cache on 304 ! 2003-06-12 18:37 kellan * rss_cache.inc, rss_fetch.inc, rss_parse.inc, rss_utils.inc: bumped up version numbers ! 2003-06-12 18:32 kellan * htdocs/index.html: updated news ! 2003-06-12 18:27 kellan * NEWS: a manual blog :) ! 2003-06-12 18:22 kellan * htdocs/index.html: fully qualified img ! 2003-06-12 18:20 kellan * htdocs/index.html: clean up. added badge. ! 2003-06-12 18:04 kellan * rss_utils.inc: clean up regex ! 2003-06-12 18:02 kellan * rss_cache.inc: suppress some warnings ! 2003-05-30 17:44 kellan * extlib/Snoopy.class.inc: more comments, cleaned up notice ! 2003-05-30 12:14 kellan * extlib/Snoopy.class.inc: don't advertise gzip support if the user hasn't built php with gzinflate support ! 2003-05-12 19:32 kellan * ChangeLog: changes ! 2003-05-12 19:11 kellan * htdocs/index.html: announce 0.5 ! 2003-05-12 18:42 kellan * htdocs/index.html: change ! 2003-05-12 18:39 kellan * rss_fetch.inc: use gzip ! 2003-05-12 18:37 kellan * extlib/Snoopy.class.inc: added support gzip encoded content negoiation ! 2003-05-12 18:32 kellan * rss_cache.inc, rss_fetch.inc, rss_parse.inc, rss_utils.inc: fixed typoes ! 2003-04-26 18:44 kellan * rss_parse.inc: fix minor typo ! 2003-04-18 05:19 kellan * htdocs/cookbook.html: updated cookbook to show more code for limiting items ! 2003-03-03 13:02 kellan * rss_parse.inc, scripts/magpie_slashbox.php: committed (or --- 132,246 ---- were getting in my way ! 2004-01-25 02:25 kellan * rss_parse.inc: make RSS 1.0's rdf:about available ! 2004-01-25 02:07 kellan * rss_parse.inc: clean up text, and line formats. add support item rdf:about ! 2004-01-24 23:40 kellan * CHANGES, ChangeLog: update changes ! 2004-01-24 23:37 kellan * rss_fetch.inc: updated version ! 2004-01-24 23:35 kellan * rss_parse.inc: whitespace ! 2004-01-24 23:23 kellan * extlib/Snoopy.class.inc: support badly formatted http headers ! 2004-01-24 23:20 kellan * rss_parse.inc: added alpha atom parsing support ! 2003-06-25 22:34 kellan * extlib/Snoopy.class.inc: fixed fread 4.3.2 compatibility problems ! 2003-06-13 11:31 kellan * rss_fetch.inc: reset cache on 304 ! 2003-06-12 21:37 kellan * rss_cache.inc, rss_fetch.inc, rss_parse.inc, rss_utils.inc: bumped up version numbers ! 2003-06-12 21:32 kellan * htdocs/index.html: updated news ! 2003-06-12 21:27 kellan * NEWS: a manual blog :) ! 2003-06-12 21:22 kellan * htdocs/index.html: fully qualified img ! 2003-06-12 21:20 kellan * htdocs/index.html: clean up. added badge. ! 2003-06-12 21:04 kellan * rss_utils.inc: clean up regex ! 2003-06-12 21:02 kellan * rss_cache.inc: suppress some warnings ! 2003-05-30 20:44 kellan * extlib/Snoopy.class.inc: more comments, cleaned up notice ! 2003-05-30 15:14 kellan * extlib/Snoopy.class.inc: don't advertise gzip support if the user hasn't built php with gzinflate support ! 2003-05-12 22:32 kellan * ChangeLog: changes ! 2003-05-12 22:11 kellan * htdocs/index.html: announce 0.5 ! 2003-05-12 21:42 kellan * htdocs/index.html: change ! 2003-05-12 21:39 kellan * rss_fetch.inc: use gzip ! 2003-05-12 21:37 kellan * extlib/Snoopy.class.inc: added support gzip encoded content negoiation ! 2003-05-12 21:32 kellan * rss_cache.inc, rss_fetch.inc, rss_parse.inc, rss_utils.inc: fixed typoes ! 2003-04-26 21:44 kellan * rss_parse.inc: fix minor typo ! 2003-04-18 08:19 kellan * htdocs/cookbook.html: updated cookbook to show more code for limiting items ! 2003-03-03 16:02 kellan * rss_parse.inc, scripts/magpie_slashbox.php: committed (or *************** *** 189,193 **** Indexes' notices ! 2003-03-03 12:59 kellan * rss_fetch.inc: commited patch from nicola (www.technick.com) to --- 248,252 ---- Indexes' notices ! 2003-03-03 15:59 kellan * rss_fetch.inc: commited patch from nicola (www.technick.com) to *************** *** 197,209 **** user-agent, & whether cacheing is turned on. ! 2003-02-11 22:22 kellan * CHANGES, ChangeLog: ChangeLog now auto-generated by cvs2cl ! 2003-02-11 21:21 kellan * rss_fetch.inc: better errors, hopefully stomped on pesky notices ! 2003-02-11 21:19 kellan * rss_parse.inc: check to see is xml is supported, if not die --- 256,268 ---- user-agent, & whether cacheing is turned on. ! 2003-02-12 01:22 kellan * CHANGES, ChangeLog: ChangeLog now auto-generated by cvs2cl ! 2003-02-12 00:21 kellan * rss_fetch.inc: better errors, hopefully stomped on pesky notices ! 2003-02-12 00:19 kellan * rss_parse.inc: check to see is xml is supported, if not die *************** *** 211,215 **** also throw better xml errors ! 2003-02-11 21:18 kellan * rss_cache.inc: hopefully cleared up some notices that were being --- 270,274 ---- also throw better xml errors ! 2003-02-12 00:18 kellan * rss_cache.inc: hopefully cleared up some notices that were being *************** *** 218,222 **** fixed a debug statement that was being called as an error ! 2003-02-11 21:15 kellan * scripts/: magpie_simple.php, magpie_slashbox.php: moved --- 277,281 ---- fixed a debug statement that was being called as an error ! 2003-02-12 00:15 kellan * scripts/: magpie_simple.php, magpie_slashbox.php: moved *************** *** 224,228 **** demo. ! 2003-02-11 21:02 kellan * INSTALL, README, TROUBLESHOOTING: Improved documentation. Better --- 283,287 ---- demo. ! 2003-02-12 00:02 kellan * INSTALL, README, TROUBLESHOOTING: Improved documentation. Better *************** *** 231,255 **** TROUBLESHOOTING cover common installation and usage problems ! 2003-01-22 11:40 kellan * htdocs/cookbook.html: added cookbook.html ! 2003-01-21 20:47 kellan * cookbook: a magpie cookbook ! 2003-01-20 07:09 kellan * ChangeLog: updated ! 2003-01-20 06:23 kellan * scripts/simple_smarty.php: minor clean up ! 2003-01-20 06:15 kellan * scripts/README: added smarty url ! 2003-01-20 06:14 kellan * magpie_simple.php, htdocs/index.html, scripts/README, --- 290,314 ---- TROUBLESHOOTING cover common installation and usage problems ! 2003-01-22 14:40 kellan * htdocs/cookbook.html: added cookbook.html ! 2003-01-21 23:47 kellan * cookbook: a magpie cookbook ! 2003-01-20 10:09 kellan * ChangeLog: updated ! 2003-01-20 09:23 kellan * scripts/simple_smarty.php: minor clean up ! 2003-01-20 09:15 kellan * scripts/README: added smarty url ! 2003-01-20 09:14 kellan * magpie_simple.php, htdocs/index.html, scripts/README, *************** *** 266,270 **** smarty demo templates/simple.smary - template for the smarty demo ! 2003-01-20 06:11 kellan * rss_fetch.inc, rss_parse.inc: changes to error handling to give --- 325,329 ---- smarty demo templates/simple.smary - template for the smarty demo ! 2003-01-20 09:11 kellan * rss_fetch.inc, rss_parse.inc: changes to error handling to give *************** *** 274,295 **** variable for when fetch_rss() returns false ! 2002-10-26 16:02 kellan * htdocs/index.html: putting the website under source control ! 2002-10-26 15:43 kellan * AUTHORS, ChangeLog, INSTALL, README: some documentation to make it all look official :) ! 2002-10-25 20:04 kellan * magpie_simple.php: quxx ! 2002-10-25 20:04 kellan * rss_parse.inc: added support for textinput and image ! 2002-10-25 16:23 kellan * magpie_simple.php, rss_cache.inc, rss_fetch.inc, rss_parse.inc, --- 333,354 ---- variable for when fetch_rss() returns false ! 2002-10-26 19:02 kellan * htdocs/index.html: putting the website under source control ! 2002-10-26 18:43 kellan * AUTHORS, ChangeLog, INSTALL, README: some documentation to make it all look official :) ! 2002-10-25 23:04 kellan * magpie_simple.php: quxx ! 2002-10-25 23:04 kellan * rss_parse.inc: added support for textinput and image ! 2002-10-25 19:23 kellan * magpie_simple.php, rss_cache.inc, rss_fetch.inc, rss_parse.inc, *************** *** 299,303 **** added support for conditional gets ! 2002-10-25 16:22 kellan * rss_cache.inc, rss_fetch.inc, rss_parse.inc, rss_utils.inc: --- 358,362 ---- added support for conditional gets ! 2002-10-25 19:22 kellan * rss_cache.inc, rss_fetch.inc, rss_parse.inc, rss_utils.inc: *************** *** 305,314 **** found in Smarty and Snoopy :) ! 2002-10-25 16:18 kellan * extlib/Snoopy.class.inc: added Snoopy in order to support conditional gets ! 2002-10-23 20:19 kellan * magpie_simple.php, rss_cache.inc, rss_fetch.inc, rss_parse.inc: --- 364,373 ---- found in Smarty and Snoopy :) ! 2002-10-25 19:18 kellan * extlib/Snoopy.class.inc: added Snoopy in order to support conditional gets ! 2002-10-23 23:19 kellan * magpie_simple.php, rss_cache.inc, rss_fetch.inc, rss_parse.inc: *************** *** 335,344 **** along blithely unaware. ! 2002-09-11 08:11 kellan * rss_cache.inc, rss_parse.inc, magpie_simple.php, rss_fetch.inc, rss_utils.inc: Initial revision ! 2002-09-11 08:11 kellan * rss_cache.inc, rss_parse.inc, magpie_simple.php, rss_fetch.inc, --- 394,403 ---- along blithely unaware. ! 2002-09-11 11:11 kellan * rss_cache.inc, rss_parse.inc, magpie_simple.php, rss_fetch.inc, rss_utils.inc: Initial revision ! 2002-09-11 11:11 kellan * rss_cache.inc, rss_parse.inc, magpie_simple.php, rss_fetch.inc, Index: rss_parse.inc =================================================================== RCS file: /cvsroot/wackofork/wiki/actions/magpierss/rss_parse.inc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rss_parse.inc 3 Feb 2006 23:09:01 -0000 1.1 --- rss_parse.inc 6 Mar 2006 13:50:11 -0000 1.2 *************** *** 61,65 **** var $intextinput = false; var $inimage = false; - var $current_field = ''; var $current_namespace = false; --- 61,64 ---- *************** *** 260,264 **** function feed_cdata ($p, $text) { - if ($this->feed_type == ATOM and $this->incontent) { --- 259,262 ---- *************** *** 392,396 **** $atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified']; if ( $atom_date ) { ! $epoch = @parse_w3cdtf($item['modified']); if ($epoch and $epoch > 0) { $item['date_timestamp'] = $epoch; --- 390,394 ---- $atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified']; if ( $atom_date ) { ! $epoch = @parse_w3cdtf($atom_date); if ($epoch and $epoch > 0) { $item['date_timestamp'] = $epoch; *************** *** 561,565 **** function error ($errormsg, $lvl=E_USER_WARNING) { // append PHP's error message if track_errors enabled ! if ( $php_errormsg ) { $errormsg .= " ($php_errormsg)"; } --- 559,563 ---- function error ($errormsg, $lvl=E_USER_WARNING) { // append PHP's error message if track_errors enabled ! if ( isset($php_errormsg) ) { $errormsg .= " ($php_errormsg)"; } *************** *** 586,589 **** --- 584,605 ---- } + // patch to support medieval versions of PHP4.1.x, + // courtesy, Ryan Currie, ry...@di... + + if (!function_exists('array_change_key_case')) { + define("CASE_UPPER",1); + define("CASE_LOWER",0); + + + function array_change_key_case($array,$case=CASE_LOWER) { + if ($case=CASE_LOWER) $cmd=strtolower; + elseif ($case=CASE_UPPER) $cmd=strtoupper; + foreach($array as $key=>$value) { + $output[$cmd($key)]=$value; + } + return $output; + } + + } ?> Index: rss_cache.inc =================================================================== RCS file: /cvsroot/wackofork/wiki/actions/magpierss/rss_cache.inc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rss_cache.inc 3 Feb 2006 23:09:01 -0000 1.1 --- rss_cache.inc 6 Mar 2006 13:50:11 -0000 1.2 *************** *** 94,101 **** } ! $data = fread( $fp, filesize($cache_file) ); ! $rss = $this->unserialize( $data ); ! return $rss; } --- 94,105 ---- } ! if ($filesize = filesize($cache_file) ) { ! $data = fread( $fp, filesize($cache_file) ); ! $rss = $this->unserialize( $data ); ! return $rss; ! } ! ! return 0; } *************** *** 131,134 **** --- 135,150 ---- } + function cache_age( $cache_key ) { + $filename = $this->file_name( $url ); + if ( file_exists( $filename ) ) { + $mtime = filemtime( $filename ); + $age = time() - $mtime; + return $age; + } + else { + return -1; + } + } + /*=======================================================================*\ Function: serialize Index: CHANGES =================================================================== RCS file: /cvsroot/wackofork/wiki/actions/magpierss/CHANGES,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CHANGES 3 Feb 2006 23:09:01 -0000 1.1 --- CHANGES 6 Mar 2006 13:50:10 -0000 1.2 *************** *** 1,2 **** --- 1,6 ---- + Version 0.72 + ----------- + - fix security exploit: http://www.sec-consult.com/216.html + Version 0.7 ----------- Index: rss_fetch.inc =================================================================== RCS file: /cvsroot/wackofork/wiki/actions/magpierss/rss_fetch.inc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rss_fetch.inc 3 Feb 2006 23:09:01 -0000 1.1 --- rss_fetch.inc 6 Mar 2006 13:50:11 -0000 1.2 *************** *** 82,86 **** \*=======================================================================*/ ! define('MAGPIE_VERSION', '0.7'); $MAGPIE_ERROR = ""; --- 82,86 ---- \*=======================================================================*/ ! define('MAGPIE_VERSION', '0.72'); $MAGPIE_ERROR = ""; *************** *** 135,139 **** $cache_status = $cache->check_cache( $cache_key); } ! // if object cached, and cache is fresh, return cached obj if ( $cache_status == 'HIT' ) { --- 135,139 ---- $cache_status = $cache->check_cache( $cache_key); } ! // if object cached, and cache is fresh, return cached obj if ( $cache_status == 'HIT' ) { *************** *** 143,148 **** $rss->from_cache = 1; if ( MAGPIE_DEBUG > 1) { ! debug("MagpieRSS: Cache HIT", E_USER_NOTICE); ! } return $rss; } --- 143,148 ---- $rss->from_cache = 1; if ( MAGPIE_DEBUG > 1) { ! debug("MagpieRSS: Cache HIT", E_USER_NOTICE); ! } return $rss; } *************** *** 163,167 **** if (isset($resp) and $resp) { ! if ($resp->status == '304' ) { // we have the most current copy if ( MAGPIE_DEBUG > 1) { --- 163,167 ---- if (isset($resp) and $resp) { ! if ($resp->status == '304' ) { // we have the most current copy if ( MAGPIE_DEBUG > 1) { |