]> git.mxchange.org Git - mailer.git/blobdiff - inc/classes/rdf.class.php
Save cache 'compacted'
[mailer.git] / inc / classes / rdf.class.php
index 7ab88f773e80ae0858c33106e54439313899b38f..23df025b2817fbc5ef50ed81e62d8fa8c70e02ba 100644 (file)
@@ -1,35 +1,36 @@
 <?php
 /* $Id$ */
 
-//
-// +----------------------------------------------------------------------+
-// | rss Parser                                                           |
-// | Copyright (c) 2001 Stefan Saasen                                     |
-// +----------------------------------------------------------------------+
-// | The contents of this file are subject to the Mozilla Public License  |
-// | Version 1.1 (the "License"); you may not use this file except in     |
-// | compliance with the License. You may obtain a copy of the License at |
-// | http://www.mozilla.org/MPL/                                          |
-// |                                                                      |
-// | Software distributed under the License is distributed on an "AS IS"  |
-// | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See  |
-// | the License for the specific language governing rights and           |
-// | limitations under the License.                                       |
-// +----------------------------------------------------------------------+
-// |                                                                      |
-// | Maintainer and initial developer:                                    |
-// | Stefan Saasen <s@fase4.com>                                          |
-// |                                                                      |
-// | Proxy and authentication methods added by:                           |
-// | Marco Kraus <marco.kraus@siemens.com>                                |
-// |                                                                      |
-// | Decoding of data by htmlentities or utf8_decode added by:            |
-// | Roland Haeder <webmaster@mxchange.org>                               |
-// |                                                                      |
-// +----------------------------------------------------------------------+
-// | Ref:                                                                 |
-// |   @link http://www.fase4.com/rdf/                   Latest release   |
-// +----------------------------------------------------------------------+
+/*
+ * +----------------------------------------------------------------------+
+ * | rss Parser                                                           |
+ * | Copyright (c) 2001 Stefan Saasen                                     |
+ * +----------------------------------------------------------------------+
+ * | The contents of this file are subject to the Mozilla Public License  |
+ * | Version 1.1 (the "License"); you may not use this file except in     |
+ * | compliance with the License. You may obtain a copy of the License at |
+ * | http: *www.mozilla.org/MPL/                                          |
+ * |                                                                      |
+ * | Software distributed under the License is distributed on an "AS IS"  |
+ * | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See  |
+ * | the License for the specific language governing rights and           |
+ * | limitations under the License.                                       |
+ * +----------------------------------------------------------------------+
+ * |                                                                      |
+ * | Maintainer and initial developer:                                    |
+ * | Stefan Saasen <s@fase4.com>                                          |
+ * |                                                                      |
+ * | Proxy and authentication methods added by:                           |
+ * | Marco Kraus <marco.kraus@siemens.com>                                |
+ * |                                                                      |
+ * | Decoding of data by htmlentities or utf8_decode added by:            |
+ * | Roland Haeder <webmaster@mxchange.org>                               |
+ * |                                                                      |
+ * +----------------------------------------------------------------------+
+ * | Ref:                                                                 |
+ * |   @link http://www.fase4.com/rdf/                   Latest release   |
+ * +----------------------------------------------------------------------+
+ */
 
 /**
  * Class RSS Parser
@@ -53,7 +54,7 @@ class fase4_rdf {
         * @access private
         * @var    integer
         */
-       var $_word_wrap = 0;
+       var $_word_wrap = '0';
 
        /**
         * Wether to recode \n -> <br /> or not in description
@@ -61,18 +62,19 @@ class fase4_rdf {
         * @access private
         * @var    boolean
         */
-       var $_use_nl2br = true;
+       var $_use_nl2br = TRUE;
 
        /**
         * Sets the decoding mode of the read data (UTF8 scrambles some german umlauts here!)
         *
         * "htmlentities" - Use the function htmlentities()
         * "utf8_decode"  - Use the function ut8_decode() when you have UTF8 encoded text
+        * <empty>        - Use non of both
         *
         * @access private
         * @var    string
         */
-       var $_decoding_mode = 'utf8_decode';
+       var $_decoding_mode = '';
 
        /**
         * If $_link_target is set a target='xxx' attribute in each <a /> and <form accept-charset="utf-8" /> html tag will be added
@@ -124,7 +126,7 @@ class fase4_rdf {
         * @see      set_proxy()
         * @var      bool
         */
-       var $_use_proxy = false;
+       var $_use_proxy = FALSE;
 
        /**
         * just a flag for checking if proxy-support with authentication
@@ -135,7 +137,7 @@ class fase4_rdf {
         * @see      set_proxy()
         * @var      boolean
         */
-       var $_use_proxy_auth = false;
+       var $_use_proxy_auth = FALSE;
 
        /**
         * The time the Files will be cached (in seconds).
@@ -159,10 +161,10 @@ class fase4_rdf {
         * @access private
         * @var    boolean
         */
-       var $_use_cached_file = true;
+       var $_use_cached_file = TRUE;
 
        /**
-        * (fast|normal) depends on _use_dynamic_display(). _use_dynamic_display( TRUE ) -> 'normal', otherwise 'fast'
+        * (fast|normal) depends on _use_dynamic_display(). _use_dynamic_display(TRUE) -> 'normal', otherwise 'fast'
         *
         * @access private
         * @var    string
@@ -191,7 +193,7 @@ class fase4_rdf {
         * @access private
         * @var    boolean
         */
-       var $_cache_dir_ok = false;
+       var $_cache_dir_ok = FALSE;
 
        /**
         * Type of the file to be parsed (RSS or RDF).
@@ -238,7 +240,7 @@ class fase4_rdf {
         * @access private
         * @var    array
         */
-       var $_use_dynamic_display = false;
+       var $_use_dynamic_display = FALSE;
 
        /**
         * <item> count
@@ -246,7 +248,7 @@ class fase4_rdf {
         * @access private
         * @var    int
         */
-       var $_item_count = 0;
+       var $_item_count = '0';
 
        /**
         * No of max <item>s
@@ -254,7 +256,7 @@ class fase4_rdf {
         * @access private
         * @var    boolean
         */
-       var $_max_count = false;
+       var $_max_count = FALSE;
 
        /**
         * Array containing the content of <channel />
@@ -310,7 +312,7 @@ class fase4_rdf {
         * @access private
         * @var    array
         */
-       var $_ctags = array( 'x' );
+       var $_ctags = array('x');
 
        /**
         * Array containing the Channel content. Just For internal XML Parser Purposes.
@@ -334,7 +336,7 @@ class fase4_rdf {
         * @access private
         * @var    array
         */
-       var $_tags = array( 'x' );  // Array
+       var $_tags = array('x');  // Array
 
        /**
         * Garbage collection: probability in percent
@@ -371,7 +373,7 @@ class fase4_rdf {
         *
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
-        * @see          _refresh
+        * @see       _refresh
         */
        function fase4_rdf()
        {
@@ -387,10 +389,10 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @param     string $rdf    RDF File (Location)
-        * @return    string Displays RDF Content ( using _display() )
-        * @see          _remote_file, cache()
+        * @return    string Displays RDF Content (using _display())
+        * @see       _remote_file, cache()
         */
-       function parse_RDF( $rdf )
+       function parse_RDF($rdf)
        {
                unset($this->_array_item);
                $this->_remote_file = $rdf;
@@ -399,8 +401,8 @@ class fase4_rdf {
                $this->out .= $this->cache();
                $this->out .= "</table>";
                $this->_output = '';
-               $this->_item_count = 0;
-               return true;
+               $this->_item_count = '0';
+               return TRUE;
        }
 
        /**
@@ -409,17 +411,17 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @param     string $rdf    RDF File (Location)
-        * @return    string Displays RDF Content ( using _display() )
-        * @see          _remote_file, cache()
+        * @return    string Displays RDF Content (using _display())
+        * @see       _remote_file, cache()
         */
-       function finish($return = false)
-       {
+       function finish($return = FALSE) {
+               $this->out = str_replace('$', '&#36;', $this->out);
+
                if (!$return) {
                        echo $this->out;
                } else {
                        return $this->out;
                }
-               flush();
                $this->_garbage_collection();
        }
 
@@ -428,20 +430,19 @@ class fase4_rdf {
         *
         * In the first case the rdf/rss File will be stored locally, in the second case the html output of the specified source will be stored.
         * In this case you can not modify the display settings.
-        * processing time: ( 1.4792) --> remote file
-        * processing time: ( 0.0313) --> using 'normal cache' with display Modification turned on.
-        * processing time: ( 0.0019) --> using 'fast cache'
+        * processing time: (1.4792) --> remote file
+        * processing time: (0.0313) --> using 'normal cache' with display Modification turned on.
+        * processing time: (0.0019) --> using 'fast cache'
         *
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @param     string $rdf    RDF File (Location)
-        * @return    string Displays RDF Content ( using _display() )
-        * @see          _remote_file, cache()
+        * @return    string Displays RDF Content (using _display())
+        * @see       _remote_file, cache()
         */
-       function use_dynamic_display( $bool )
-       {
+       function use_dynamic_display($bool) {
                $this->_use_dynamic_display = $bool;
-               return true;
+               return TRUE;
        }
 
        /**
@@ -452,8 +453,7 @@ class fase4_rdf {
         * @param     string $data    RDF File XML Data
         * @see       _clear_Items()
         */
-       function _parse_xRDF( $data )
-       {
+       function _parse_xRDF($data) {
                $this->_clear_Items();
                $xml_parser = xml_parser_create();
                xml_set_object($xml_parser,$this);
@@ -464,7 +464,7 @@ class fase4_rdf {
                        $this->_throw_exception(sprintf("XML error: %s at line %d",
                        xml_error_string(xml_get_error_code($xml_parser)),
                        xml_get_current_line_number($xml_parser)).'<br /><br />Exception in function parse_RDF().');
-               }
+               } // END - if
                xml_parser_free($xml_parser);
        }
 
@@ -475,19 +475,17 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @param     int $seconds time files will be cached (in seconds).
-        * @return       boolean
-        * @see          _refresh
+        * @return    boolean
+        * @see       _refresh
         */
-       function set_refresh( $seconds )
-       {
+       function set_refresh($seconds) {
                $this->_refresh = (time() - $seconds);
-               return true;
+               return TRUE;
        }
 
-       function set_salt( $saltPara )
-       {
+       function set_salt($saltPara) {
                $this->salt = $saltPara;
-               return true;
+               return TRUE;
        }
 
        /**
@@ -496,13 +494,13 @@ class fase4_rdf {
         * @access    public
         * @param     int $int No of max <item>s
         * @author    Stefan Saasen <s@fase4.com>
-        * @return       boolean
-        * @see          _max_count, _endElement()
+        * @return    boolean
+        * @see       _max_count, _endElement()
         */
-       function set_max_item( $int )
+       function set_max_item($int)
        {
                $this->_max_count = $int;
-               return true;
+               return TRUE;
        }
 
        /**
@@ -511,12 +509,12 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @param     string $dir Path to Directory.
-        * @return       boolean
-        * @see          _cache_dir
+        * @return    boolean
+        * @see       _cache_dir
         */
-       function set_CacheDir( $dir )
+       function set_CacheDir($dir)
        {
-               if(substr($dir, -1) != '/') {
+               if (substr($dir, -1) != '/') {
                        $dir = $dir.'/';
                }
                $this->_cache_dir = $dir;
@@ -529,10 +527,10 @@ class fase4_rdf {
         * @param     string $msg Message to display on failure
         * @author    Stefan Saasen <s@fase4.com>
         */
-       function _throw_exception( $msg )
+       function _throw_exception($msg)
        {
                $this->out .= "<div style=\"font-family: verdana, helvetica, arial, sans-serif;font-size:11px; color: #6699cc;margin-top:10px;margin-bottom:10px;\" align=\"center\">fase4 RDF Error: ".$msg."</div>";
-               return true;
+               return TRUE;
        }
 
        /**
@@ -542,7 +540,7 @@ class fase4_rdf {
         * @author    Stefan Saasen <s@fase4.com>
         * @see       _item
         */
-       function _clear_Items( ) {
+       function _clear_Items() {
                $this->_item = array(
                        'title'         => '',
                        'link'          => '',
@@ -562,7 +560,7 @@ class fase4_rdf {
         * @author    Stefan Saasen <s@fase4.com>
         * @see       _item
         */
-       function _clear_cItems( ) {
+       function _clear_cItems() {
                $this->_citem = array(
                        'title'          => '',
                        'link'           => '',
@@ -597,37 +595,37 @@ class fase4_rdf {
         * @param     mixed  $parser a reference to the XML parser calling the handler.
         * @param     string $name contains the name of the element for which this handler is called.
         * @param     string $attrs contains an associative array with the element's attributes (if any).
-        * @see          _get_ChannelData(), _clear_Items(), _type, _parse_mode, _depth, _tags, _cdepth, _ctags
+        * @see       _get_ChannelData(), _clear_Items(), _type, _parse_mode, _depth, _tags, _cdepth, _ctags
         */
        function _startElement($parser, $name, $attrs) {
                // We have to determine, which type of xml data we have to parse
-               if($name == 'rss') {
+               if ($name == 'rss') {
                        $this->_type = 'rss';
-               } elseif($name == 'rdf:RDF' OR $name == 'rdf') {
+               } elseif ($name == 'rdf:RDF' || $name == 'rdf') {
                        $this->_type = 'rdf';
                }
 
 
-               if ( $name == 'channel' AND $this->_type != 'rdf' ) {
+               if ($name == 'channel' && $this->_type != 'rdf') {
                        $this->_parse_mode = 'channel';
-               } elseif ( ($name=='item')
-               ||($name=='image')
-               ||($name=='textinput')
-               ||(($name=='channel') && ($this->_type != 'rss')) ) {
-                       if($this->_parse_mode=='channel') {
-                               $this->_get_ChannelData( $parser );
+               } elseif (($name == 'item')
+               || ($name == 'image')
+               || ($name == 'textinput')
+               || (($name == 'channel') && ($this->_type != 'rss'))) {
+                       if ($this->_parse_mode == 'channel') {
+                               $this->_get_ChannelData($parser);
                        }
                        $this->_parse_mode = 'all';
                }
 
-               if( !isset( $this->_depth[$this->get_parser_id($parser)] ) ) {
-                       $this->_depth[$this->get_parser_id($parser)] = 0;
+               if (!isset($this->_depth[$this->get_parser_id($parser)])) {
+                       $this->_depth[$this->get_parser_id($parser)] = '0';
                }
                $this->_depth[$this->get_parser_id($parser)]++;
                array_push($this->_tags, $name);
 
-               if( !isset( $this->_cdepth[$this->get_parser_id($parser)] ) ) {
-                       $this->_cdepth[$this->get_parser_id($parser)] = 0;
+               if (!isset($this->_cdepth[$this->get_parser_id($parser)])) {
+                       $this->_cdepth[$this->get_parser_id($parser)] = '0';
                }
                $this->_cdepth[$this->get_parser_id($parser)]++;
                array_push($this->_ctags, $name);
@@ -639,9 +637,9 @@ class fase4_rdf {
         * @access    private
         * @author    Stefan Saasen <s@fase4.com>
         * @param     mixed  $parser a reference to the XML parser calling the handler.
-        * @see          _output, _display_opt, _citem
+        * @see       _output, _display_opt, _citem
         */
-       function _get_ChannelData( $parser )
+       function _get_ChannelData($parser)
        {
                $this->_citem['link'] = trim($this->_citem['link']);
                if (($this->_display_opt['sitelink'] == $this->_citem['link']) && (!empty($this->_display_opt['reflink'])) && (!empty($this->_display_opt['refid'])))
@@ -649,7 +647,7 @@ class fase4_rdf {
                        $this->_citem['link'] .= $this->_display_opt['reflink'].$this->_display_opt['refid'];
                }
 
-               if( empty($this->_display_opt['channel']) OR
+               if (empty($this->_display_opt['channel']) ||
                $this->_display_opt['channel'] != 'hidden') {
                        $this->_output .= "<tr><td>\n";
                        $this->_output .= "<table border=\"0\" width=\"100%\" class=\"fase4_rdf_meta\" cellspacing=\"5\" cellpadding=\"2\">\n";
@@ -657,15 +655,15 @@ class fase4_rdf {
                        $this->_output .= "<tr><td class=\"fase4_rdf\">".strip_tags($this->_citem['description'], '<a>, <img>')."</td></tr>\n";
                        $this->_output .= "<tr><td>&nbsp;</td></tr>\n";
                        $this->_output .= "<tr><td class=\"fase4_rdf\">\n";
-                       if(isset($this->_display_opt['build']) && $this->_display_opt['build'] != 'hidden') {
-                               if($this->_citem['lastBuildDate']){$this->_output .= 'build: '. $this->_citem['lastBuildDate'].'<br />';}
+                       if (isset($this->_display_opt['build']) && $this->_display_opt['build'] != 'hidden') {
+                               if ($this->_citem['lastBuildDate']) { $this->_output .= 'build: '. $this->_citem['lastBuildDate'].'<br />';}
                        }
-                       if(isset($this->_display_opt['cache_update']) && $this->_display_opt['cache_update'] != 'hidden' && ( $_update = $this->get_cache_update_time()) ) {
+                       if (isset($this->_display_opt['cache_update']) && $this->_display_opt['cache_update'] != 'hidden' && ($_update = $this->get_cache_update_time())) {
                                $this->_output .= 'cache update: '.$_update."<br />\n";
                        }
                        $this->_output .= "<a href=\"".$this->_citem['link']."\" ";
-                       if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
-                       $this->_output .= ">".$this->_cut_string($this->_citem['link'])."</a>";
+                       if (isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                       $this->_output .= ">".$this->_cut_string($this->_citem['link']) . '</a>';
                        $this->_output .= "</td></tr>\n";
                        $this->_output .= "<tr><td><hr noshade width=\"100%\" size=\"1\"></td></tr>\n";
                        $this->_output .= "</table></td></tr>";
@@ -684,7 +682,7 @@ class fase4_rdf {
         * @author    Stefan Saasen <s@fase4.com>
         * @param     mixed  $parser a reference to the XML parser calling the handler.
         * @param     string $name contains the name of the element for which this handler is called.
-        * @see          _clear_Items(), _type, _parse_mode, _depth, _tags, _cdepth, _ctags, _item, _output, _display_opt
+        * @see       _clear_Items(), _type, _parse_mode, _depth, _tags, _cdepth, _ctags, _item, _output, _display_opt
         */
        function _endElement($parser, $name) {
                array_pop($this->_tags);
@@ -694,25 +692,25 @@ class fase4_rdf {
                $this->_item['link'] = trim($this->_item['link']);
                if ((!empty($this->_display_opt['refid'])) && (!empty($this->_item['link'])))
                {
-                       if (!ereg('refid=', $this->_item['link'])) $this->_item['link'] .= '?refid=' . $this->_display_opt['refid'];
+                       if (!isInString('refid=', $this->_item['link'])) $this->_item['link'] .= '?refid=' . $this->_display_opt['refid'];
                }
                switch ($name) {
                        case 'item':
-                               if(empty($this->_max_count) OR $this->_item_count < $this->_max_count) {
-                                       if($this->_item['title'] != $this->_item['description']
-                                       AND $this->_item['description']) {
+                               if (empty($this->_max_count) || $this->_item_count < $this->_max_count) {
+                                       if ($this->_item['title'] != $this->_item['description']
+                                       && $this->_item['description']) {
 
                                                // word-wrapping added by Roland Haeder <webmaster@mxchange.org>
                                                if (($this->_word_wrap > 0) && (strlen($this->_item['description']) > $this->_word_wrap))
                                                {
                                                        // Switch off _use_nl2br
-                                                       $this->_use_nl2br = false;
+                                                       $this->_use_nl2br = FALSE;
                                                        // First remove all \n
                                                        $this->_item['description'] = str_replace('\n', ' ', $this->_item['description']);
                                                        // Wrap with <br />\n
-                                                       $this->_item['description'] = wordwrap($this->_item['description'], $this->_word_wrap, "*<br>\n");
+                                                       $this->_item['description'] = wordwrap($this->_item['description'], $this->_word_wrap, "*<br />\n");
                                                }
-                                               elseif (($this->_word_wrap == 0) && (!$this->_use_nl2br))
+                                               elseif (($this->_word_wrap == '0') && (!$this->_use_nl2br))
                                                {
                                                        // Strip tags out instead when word-wrap is disabled
                                                        $this->_item['description'] = strip_tags($this->_item['description'], '<a>, <img>');
@@ -722,7 +720,7 @@ class fase4_rdf {
                                                if ($this->_use_nl2br) $this->_item['description'] = nl2br($this->_item['description']);
 
                                                $this->_output .= "<tr><td class=\"fase4_rdf_title\"><div class=\"fase4_rdf_title\"><a class=\"fase4_rdf_title\" href=\"".$this->_item['link']."\" ";
-                                               if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                                               if (isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
                                                $this->_output .= ">".strip_tags($this->_item['title'], '<a>, <img>').'</a> ('.$this->_item['pubDate'].")</div></td></tr>\n";
                                                $this->_output .= "<tr><td class=\"fase4_rdf\">".$this->_item['description']."</td></tr>\n";
                                                // we just display the <hr> if there is a description
@@ -730,7 +728,7 @@ class fase4_rdf {
                                        } else {
                                                $this->_output .= "<tr><td class=\"fase4_rdf\">\n";
                                                $this->_output .= "<a href=\"".$this->_item["link"]."\" ";
-                                               if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                                               if (isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
                                                $this->_output .= ">".$this->_item["title"]."</a></td></tr>\n";
                                        }
 
@@ -746,12 +744,12 @@ class fase4_rdf {
                                break;
 
                        case 'image':
-                               if(isset($this->_display_opt['image']) && ($this->_display_opt['image'] != 'hidden') && $this->_item['url']) {
+                               if (isset($this->_display_opt['image']) && ($this->_display_opt['image'] != 'hidden') && $this->_item['url']) {
                                        $this->_output .= "<tr><td class=\"fase4_rdf\">\n";
                                        $this->_output .= "<a href=\"".$this->_item['link']."\" ";
-                                       if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                                       if (isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
                                        $this->_output .= "><img src=\"".$this->_item['url']."\"";
-                                       if(isset($this->_item['width']) && isset($this->_item['height'])) {
+                                       if (isset($this->_item['width']) && isset($this->_item['height'])) {
                                                $this->_output .= " width=\"".$this->_item['width']."\" height=\"".$this->_item['height']."\"";
                                        }
                                        $this->_output .= " alt=\"".$this->_item['title']."\" border=\"0\" /></a></td></tr>\n";
@@ -763,28 +761,28 @@ class fase4_rdf {
                                                'height' => $this->_item['height']
                                        );
                                        $this->_clear_Items();
-                               } elseif( isset($this->_display_opt['image'] ) && ($this->_display_opt['image'] == 'hidden') ) {
+                               } elseif (isset($this->_display_opt['image']) && ($this->_display_opt['image'] == 'hidden')) {
                                        $this->_clear_Items();
                                }
 
                                break;
 
                        case 'channel':
-                               if(isset($this->_display_opt['channel']) AND $this->_display_opt['channel'] != 'hidden' AND $this->_item['title'] != '') {
+                               if (isset($this->_display_opt['channel']) && $this->_display_opt['channel'] != 'hidden' && $this->_item['title'] != '') {
                                        $this->_output .= "<tr><td>\n";
                                        $this->_output .= "<table border=\"0\" width=\"100%\" class=\"fase4_rdf_meta\" cellspacing=\"5\" cellpadding=\"2\">\n";
                                        $this->_output .= "<tr><td class=\"fase4_rdf\"><div class=\"fase4_rdf_title\">".htmlspecialchars($this->_item['title'])."</div></td></tr>\n";
                                        $this->_output .= "<tr><td class=\"fase4_rdf\">".strip_tags($this->_item['description'], '<a>, <img>')."</td></tr>\n";
                                        $this->_output .= "<tr><td>&nbsp;</td></tr>\n";
                                        $this->_output .= "<tr><td class=\"fase4_rdf\">\n";
-                                       if($this->_display_opt['build'] != 'hidden') {
-                                               if($this->_item['lastBuildDate']){$this->_output .= 'build: '. $this->_item['lastBuildDate'].'<br />';}
+                                       if ($this->_display_opt['build'] != 'hidden') {
+                                               if ($this->_item['lastBuildDate']) { $this->_output .= 'build: '. $this->_item['lastBuildDate'].'<br />';}
                                        }
-                                       if($this->_display_opt['cache_update'] != 'hidden' && ( $_update = $this->get_cache_update_time()) ) {
+                                       if ($this->_display_opt['cache_update'] != 'hidden' && ($_update = $this->get_cache_update_time())) {
                                                $this->_output .= 'cache update: '.$_update."<br />\n";
                                        }
                                        $this->_output .= "<a href=\"".$this->_item['link']."\" ";
-                                       if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                                       if (isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
                                        $this->_output .= ">".$this->_cut_string($this->_item['link'])."</a>\n";
                                        $this->_output .= "</td></tr>\n";
                                        $this->_output .= "</table></td></tr>\n";
@@ -800,13 +798,13 @@ class fase4_rdf {
                                break;
 
                        case 'textinput':
-                               if(isset($this->_display_opt['textinput']) && ($this->_display_opt['textinput'] != 'hidden') && $this->_item['name'] && $this->_item['link']) {
+                               if (isset($this->_display_opt['textinput']) && ($this->_display_opt['textinput'] != 'hidden') && $this->_item['name'] && $this->_item['link']) {
                                        $this->_output .= "<tr><td class=\"fase4_rdf\">\n";
-                                       $this->_output .= "<form accept-charset=\"utf-8\" action=\"".$this->_item['link']."\" ";
-                                       if(isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
+                                       $this->_output .= "<form accept-charset=\"UTF-8\" action=\"".$this->_item['link']."\" ";
+                                       if (isset($this->_link_target)) { $this->_output .= "target=\"".$this->_link_target."\" "; }
                                        $this->_output .= "method=\"get\">\n";
                                        $this->_output .= "<div class=\"fase4_rdf_title\">".$this->_item['title']."</div>";
-                                       $this->_output .= strip_tags($this->_item['description'], '<a>, <img>')."<br><br>\n";
+                                       $this->_output .= strip_tags($this->_item['description'], '<a>, <img>')."<br /><br />\n";
                                        $this->_output .= "<input class=\"fase4_rdf_input\" type=\"text\" name=\"".$this->_item['name']."\">&nbsp;\n";
                                        $this->_output .= "<input class=\"fase4_rdf_input\" type=\"submit\" value=\"go\">";
                                        $this->_output .= "</form>\n";
@@ -818,7 +816,7 @@ class fase4_rdf {
                                                'description' => $this->_item['description']
                                        );
                                        $this->_clear_Items();
-                               } elseif( isset($this->_display_opt['textinput']) && ($this->_display_opt['textinput'] == 'hidden') ) {
+                               } elseif (isset($this->_display_opt['textinput']) && ($this->_display_opt['textinput'] == 'hidden')) {
                                        $this->_clear_Items();
                                }
 
@@ -834,7 +832,7 @@ class fase4_rdf {
         * @return    array
         * @see       _array_channel
         */
-       function get_array_channel( )
+       function get_array_channel()
        {
                return $this->_array_channel;
        }
@@ -845,9 +843,9 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @return    array
-        * @see          _array_item
+        * @see       _array_item
         */
-       function get_array_item( )
+       function get_array_item()
        {
                return $this->_array_item;
        }
@@ -858,9 +856,9 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @return    array
-        * @see          _array_textinput
+        * @see       _array_textinput
         */
-       function get_array_textinput( )
+       function get_array_textinput()
        {
                return $this->_array_textinput;
        }
@@ -868,13 +866,13 @@ class fase4_rdf {
        /**
         * Getter for parser id from resource
         *
-        * @access private
-        * @author      Roland Haeder <webmaster@mxchange.org>
-        * @return      int
+        * @access   private
+        * @author   Roland Haeder <webmaster@mxchange.org>
+        * @return   int
         */
        function get_parser_id ($parser) {
                // Default is zero
-               $id = 0;
+               $id = '0';
 
                // Is it a resource?
                if (is_resource($parser)) {
@@ -892,9 +890,9 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @return    array
-        * @see          _array_image
+        * @see       _array_image
         */
-       function get_array_image( )
+       function get_array_image()
        {
                return $this->_array_image;
        }
@@ -906,7 +904,7 @@ class fase4_rdf {
         * @author    Stefan Saasen <s@fase4.com>
         * @param     mixed  $parser a reference to the XML parser calling the handler.
         * @param     string $text contains the character data as a string.
-        * @see          _parse_mode, _item, _tags, _depth, _citem, _ctags, _cdepth
+        * @see       _parse_mode, _item, _tags, _depth, _citem, _ctags, _cdepth
         */
        function _parseData($parser, $text)
        {
@@ -925,15 +923,15 @@ class fase4_rdf {
                $clean = preg_replace("/\s/", "", $text);
                if ($clean) {
                        $text = preg_replace("/^\s+/", "", $text)."\n";
-                       if($this->_parse_mode == 'all') {
-                               if ( isset($this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]]) &&
-                               $this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]] ) {
+                       if ($this->_parse_mode == 'all') {
+                               if (isset($this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]]) &&
+                               $this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]]) {
                                        $this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]] .= $text;
                                } else {
                                        $this->_item[$this->_tags[$this->_depth[$this->get_parser_id($parser)]]] = $text;
                                }
                        } elseif (isset($this->_parse_mode) && $this->_parse_mode == 'channel') {
-                               if ( isset($this->_citem[$this->_ctags[$this->_cdepth[$this->get_parser_id($parser)]]]) ) {
+                               if (isset($this->_citem[$this->_ctags[$this->_cdepth[$this->get_parser_id($parser)]]])) {
                                        $this->_citem[$this->_ctags[$this->_cdepth[$this->get_parser_id($parser)]]] .= $text;
                                } else {
                                        $this->_citem[$this->_ctags[$this->_cdepth[$this->get_parser_id($parser)]]] = $text;
@@ -949,16 +947,16 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @param     array  $options
-        * @see          _display_opt
+        * @see       _display_opt
         */
-       function set_Options( $options = '' )
+       function set_Options($options = '')
        {
-               if(is_array( $options )) {
+               if (is_array($options)) {
                        $this->_display_opt = $options;
-                       return true;
+                       return TRUE;
                } else {
                        unset($this->_display_opt);
-                       return false;
+                       return FALSE;
                }
        }
 
@@ -968,12 +966,12 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @param     int  $width  attribute width in tag <table>
-        * @see          _table_width
+        * @see       _table_width
         */
-       function set_table_width( $width = 400 )
+       function set_table_width($width = 400)
        {
                $this->_table_width = $width;
-               return true;
+               return TRUE;
        }
 
        /**
@@ -985,7 +983,7 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @return    array  $options
-        * @see          _display_opt
+        * @see       _display_opt
         */
        function get_Options() {
                $options = array(
@@ -1005,16 +1003,16 @@ class fase4_rdf {
         * @author    Stefan Saasen <s@fase4.com>
         * @param     string $rdf    RDF File (Location)
         * @return    string XML Presentation of parsed RDF File
-        * @see          _cached_file, _remote_file, _cache_dir, _refresh, _update_cache()
+        * @see       _cached_file, _remote_file, _cache_dir, _refresh, _update_cache()
         */
        function cache()
        {
                // checks if the cache directory already exists
                // if not, the cache directory will be created
-               if(!$this->_cache_dir_ok) {
+               if (!$this->_cache_dir_ok) {
                        $this->_create_cache_dir();
                }
-               if($this->_use_dynamic_display == true) {
+               if ($this->_use_dynamic_display == TRUE) {
                        $this->_cached_file = md5('dynamic'.$this->salt.$this->_remote_file) . '.cache';
                        $this->_cache_type = 'normal';
                } else {
@@ -1024,37 +1022,46 @@ class fase4_rdf {
 
                $_cache_f = $this->_cache_dir.$this->_cached_file;
 
-               if ( (!file_exists($_cache_f)) || (filemtime($_cache_f) < $this->_refresh) || (filesize($_cache_f) == 0)) {
+               if ((!file_exists($_cache_f)) || (filemtime($_cache_f) < $this->_refresh) || (filesize($_cache_f) == 0)) {
                        // We have to parse the remote file
-                       $this->_use_cached_file = false;
+                       $this->_use_cached_file = FALSE;
                        // --> we want to provide proper Information for Use in
                        // get_cache_update_time()
                        clearstatcache();
-                       if($this->_use_dynamic_display == true) {
-                               $_rdf = @implode(' ', $this->_rdf_data()); // -> proxy
-                               if(!$_rdf) {
-                                       $this->_throw_exception( $this->_remote_file.' is not available' );
+                       if ($this->_use_dynamic_display == TRUE) {
+                               $_rdf = implode(' ', $this->_rdf_data()); // -> proxy
+                               if (!$_rdf) {
+                                       $this->_throw_exception($this->_remote_file.' is not available');
                                }
-                               $this->_parse_xRDF( $_rdf );
-                               $this->_update_cache( $_rdf );
+                               $this->_parse_xRDF($_rdf);
+                               $this->_update_cache($_rdf);
                                $data = $this->_output;
                        } else {
-                               $_rdf = @implode(' ', $this->_rdf_data()); // -> proxy
-                               if(!$_rdf) {
-                                       $this->_throw_exception( $this->_remote_file.' is not available' );
+                               $_rdf = implode(' ', $this->_rdf_data()); // -> proxy
+                               if (!$_rdf) {
+                                       $this->_throw_exception($this->_remote_file.' is not available');
                                }
-                               $this->_parse_xRDF( $_rdf );
-                               $this->_update_cache( $this->_output );
+                               $this->_parse_xRDF($_rdf);
+                               $this->_update_cache($this->_output);
+                               $data = $this->_output;
+                       }
+               } elseif (defined('__SECURITY') && function_exists('readFromFile')) {
+                       // Use readFromFile() from mailer project
+                       $this->_use_cached_file = TRUE;
+                       if ($this->_use_dynamic_display == TRUE) {
+                               $this->_parse_xRDF(readFromFile($_cache_f));
                                $data = $this->_output;
+                       } else {
+                               $data = readFromFile($_cache_f);
                        }
                } else {
                        // we can use the cached file
-                       $this->_use_cached_file = true;
-                       if($this->_use_dynamic_display == true) {
-                               $this->_parse_xRDF( implode(' ', file($_cache_f)) );
+                       $this->_use_cached_file = TRUE;
+                       if ($this->_use_dynamic_display == TRUE) {
+                               $this->_parse_xRDF(implode(' ', file($_cache_f)));
                                $data = $this->_output;
                        } else {
-                               $data = @implode(' ', file($_cache_f));
+                               $data = implode(' ', file($_cache_f));
                        }
                }
                return trim($data);
@@ -1066,35 +1073,34 @@ class fase4_rdf {
         * @access    private
         * @author    Stefan Saasen <s@fase4.com>
         * @param     string $dir Path to Directory.
-        * @return       boolean
-        * @see          _cache_dir, _cache_dir_ok
+        * @return    boolean
+        * @see       _cache_dir, _cache_dir_ok
         */
        function _create_cache_dir()
        {
                $path = '';
-               if(!@is_dir($this->_cache_dir)) {
+               if (!is_dir($this->_cache_dir)) {
                        $arr = explode('/', $this->_cache_dir);
                        $c = count($arr);
-                       if($arr[0]=='') {
+                       if ($arr[0] == '') {
                                $path = '/';
                        }
-                       for($i = 0;$i<$c;$i++)
-                       {
-                               if($arr[$i]!='') {
+                       for($i = '0';$i<$c;$i++) {
+                               if ($arr[$i]!='') {
                                        $path .= $arr[$i].'/';
-                                       if(!@is_dir($path)) {
-                                               if(!@mkdir($path, 0777)) {
+                                       if (!is_dir($path)) {
+                                               if (!mkdir($path, 0777)) {
                                                        $this->_throw_exception("failed to create directory:<b>".$this->_cache_dir."</b>.<br /><br />Exception on Line: ".__LINE__);
-                                                       return false;
+                                                       return FALSE;
                                                }
                                        }
                                }
                        }
-                       $this->_cache_dir_ok = true;
-                       return true;
+                       $this->_cache_dir_ok = TRUE;
+                       return TRUE;
                } else {
-                       $this->_cache_dir_ok = true;
-                       return true;
+                       $this->_cache_dir_ok = TRUE;
+                       return TRUE;
                }
        }   // END _create_cache_dir()
 
@@ -1104,22 +1110,26 @@ class fase4_rdf {
         * @access    private
         * @author    Stefan Saasen <s@fase4.com>
         * @param     string $rdf    RDF File (Location)
-        * @see          _cache_dir, _cached_file, _throw_exception()
+        * @see       _cache_dir, _cached_file, _throw_exception()
         */
-       function _update_cache( $content = '' )
+       function _update_cache($content = '')
        {
-               $_local = @fopen( $this->_cache_dir.$this->_cached_file, 'w' );
-               if(!$_local) {
-                       $this->_throw_exception( 'Cannot open '.$this->_cached_file.'<br /><br />Exception at Line: '.__LINE__ );
-                       return false;
+               if (defined('__SECURITY') && function_exists('writeToFile')) {
+                       // Use mailer-project function
+                       return writeToFile($this->_cache_dir.$this->_cached_file, compactContent($content));
                }
-               if (fwrite( $_local, $content) === false) {
-                       $this->_throw_exception( 'Cannot write to '.$this->_cached_file.'<br /<br />Exeception at Line: '.__LINE__);
-                       return false;
+               $_local = @fopen($this->_cache_dir.$this->_cached_file, 'w');
+               if (!$_local) {
+                       $this->_throw_exception('Cannot open '.$this->_cached_file.'<br /><br />Exception at Line: '.__LINE__);
+                       return FALSE;
                }
-               fclose( $_local );
-               @chmod( $this->_cache_dir.$this->_cached_file, 0666);
-               return true;
+               if (fwrite($_local, $content) === FALSE) {
+                       $this->_throw_exception('Cannot write to '.$this->_cached_file.'<br /<br />Exeception at Line: '.__LINE__);
+                       return FALSE;
+               }
+               fclose($_local);
+               @chmod($this->_cache_dir.$this->_cached_file, 0666);
+               return TRUE;
        }   // END _update_cache()
 
        /**
@@ -1127,8 +1137,8 @@ class fase4_rdf {
         *
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
-        * @return       string Date/Time of last Update
-        * @see          _cache_dir, _cached_file
+        * @return    string Date/Time of last Update
+        * @see       _cache_dir, _cached_file
         */
        function get_cache_update_time()
        {
@@ -1141,8 +1151,8 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @param     string $rdf    RDF File (Location)
-        * @return    string Displays RDF Content ( using _display() )
-        * @see          _remote_file, cache()
+        * @return    string Displays RDF Content (using _display())
+        * @see       _remote_file, cache()
         */
        function get_CacheType()
        {
@@ -1155,7 +1165,7 @@ class fase4_rdf {
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
         * @return    array  $options
-        * @see          _use_cached_file
+        * @see       _use_cached_file
         */
        function is_cachedFile()
        {
@@ -1171,7 +1181,7 @@ class fase4_rdf {
         *
         * @access    public
         * @author    Stefan Saasen <s@fase4.com>
-        * @see          _cache_dir
+        * @see       _cache_dir
         */
        function clear_cache()
        {
@@ -1179,14 +1189,17 @@ class fase4_rdf {
                while($file=$dir->read()) {
                        // Exclude directories
                        if (is_file($dir->path.$file) && substr($file, -6, 6) != '.cache' && substr($file, -4, 4) != '.log')  {
-                               if(!@unlink($dir->path.$file)) {
-                                       $this->_throw_exception("Unable to unlink ".$dir->path.$file."<br />\n<br />\nException at Line: ".__LINE__ );
-                                       return false;
+                               if ((defined('__SECURITY') && function_exists('removeFile')) && (!removeFile($dir->path.$file))) {
+                                       $this->_throw_exception("removeFile() was unable to unlink ".$dir->path.$file."<br />\n<br />\nException at Line: ".__LINE__);
+                                       return FALSE;
+                               } elseif (!unlink($dir->path.$file)) {
+                                       $this->_throw_exception("Unable to unlink ".$dir->path.$file."<br />\n<br />\nException at Line: ".__LINE__);
+                                       return FALSE;
                                } // END - if
                        } // END - if
                } // END - while
                $dir->close();
-               return true;
+               return TRUE;
        }   // END clear_cache()
 
        /**
@@ -1197,10 +1210,10 @@ class fase4_rdf {
         * @param    int     $str_len length of the returned String (overall length including '... ')
         * @return   string  Cut String
         */
-       function _cut_string( $string, $str_len = '30' )
+       function _cut_string($string, $str_len = '30')
        {
-               if(strlen(trim($string))>$str_len) {
-                       $string = substr( trim($string) , 0, $str_len - 4);
+               if (strlen(trim($string))>$str_len) {
+                       $string = substr(trim($string) , 0, $str_len - 4);
                        $string .= ' ...';
                }
                return $string;
@@ -1211,7 +1224,7 @@ class fase4_rdf {
         *
         * @access    private
         * @author    Stefan Saasen <s@fase4.com>
-        * @see          _cache_dir, gc_probability, gc_maxlifetime
+        * @see       _cache_dir, gc_probability, gc_maxlifetime
         */
        function _garbage_collection()
        {
@@ -1219,7 +1232,7 @@ class fase4_rdf {
                if (mt_rand(1, 100) <= $this->gc_probability) {
                        $dir = dir($this->_cache_dir);
                        while($file=$dir->read()) {
-                               if (is_file($dir->path.$file) && substr($file, -6, 6) != '.cache' && substr($file, -4, 4) != '.log' && filemtime($dir->path.$file) <= time() - $this->_refresh )  {
+                               if (is_file($dir->path.$file) && substr($file, -6, 6) != '.cache' && substr($file, -4, 4) != '.log' && filemtime($dir->path.$file) <= time() - $this->_refresh)  {
                                        @unlink($dir->path.$file);
                                } // END - if
                        }
@@ -1239,7 +1252,7 @@ class fase4_rdf {
         */
        function set_proxy($phost, $pport)
        {
-               $this->_use_proxy = true;
+               $this->_use_proxy = TRUE;
 
                if ($phost != '')
                $this->_phost = $phost;
@@ -1256,9 +1269,9 @@ class fase4_rdf {
         * @param     string $ppaswd Password
         * @author    Marco Kraus <marco.kraus@siemens.com>
         */
-       function set_proxy_auth( $pname, $ppasswd )
+       function set_proxy_auth($pname, $ppasswd)
        {
-               $this->_use_proxy_auth = true;
+               $this->_use_proxy_auth = TRUE;
 
                if ($pname != '')
                $this->_pname = $pname;
@@ -1276,20 +1289,22 @@ class fase4_rdf {
         *
         * @access    private
         * @author    Marco Kraus <Marco.Kraus@siemens.com>
-        * @return array
-        * @see _use_proxy, cache()
+        * @return     array
+        * @see       _use_proxy, cache()
         */
        function _rdf_data()
        {
-               if ( $this->_use_proxy == true )
-               {
+               if (defined('__SECURITY') && function_exists('sendHttpGetRequest')) {
+                       // Use mailer-project instead (see http://mxchange.org)
+                       return sendHttpGetRequest($this->_remote_file, array(), TRUE);
+               } elseif ($this->_use_proxy == TRUE) {
                        // we need a raw socket here to connect to proxy
                        $fp = fsockopen($this->_phost,$this->_pport);
 
                        if (!$fp) {
-                               $this->_throw_exception( $this->_remote_file.' is not available with proxy' );
+                               $this->_throw_exception($this->_remote_file.' is not available with proxy');
                        } else {
-                               if ( $this->_use_proxy_auth == true ) {
+                               if ($this->_use_proxy_auth == TRUE) {
                                        fputs($fp, "GET ".$this->_remote_file." HTTP/1.0\r\nUser-Agent: Fase4 RDF-Reader/1.40 modified by Quix0r\r\n\r\n");
                                } else {
                                        fputs($fp, "GET ".$this->_remote_file." HTTP/1.0\r\nUser-Agent: Fase4 RDF-Reader/1.40 modified by Quix0r\r\nProxy-Authorization: Basic ".base64_encode("$this->_pname:$this->_ppasswd") ."\r\n\r\n");
@@ -1297,7 +1312,7 @@ class fase4_rdf {
                        }
 
 
-                       for ( $i = 0; !feof ($fp) ; $i++)
+                       for ($i = '0'; !feof ($fp) ; $i++)
                        {
                                $usable_data[$i] = "";
                                $usable_data[$i] = fgets($fp,4096);
@@ -1305,29 +1320,29 @@ class fase4_rdf {
                                // PARSE HEADER ---- first line has to be <?xml, second rdf or rss, and third is blank
 
                                // strstr did not fit (ask Rasmus why), so we compare each character
-                               if ( ($usable_data[$i][0] == '<' ) &&
-                               ($usable_data[$i][1] == '?' ) &&
-                               ($usable_data[$i][2] == 'x' ) &&
-                               ($usable_data[$i][3] == 'm' ) &&
-                               ($usable_data[$i][4] == 'l' ) ) {
+                               if (($usable_data[$i][0] == '<') &&
+                               ($usable_data[$i][1] == '?') &&
+                               ($usable_data[$i][2] == 'x') &&
+                               ($usable_data[$i][3] == 'm') &&
+                               ($usable_data[$i][4] == 'l')) {
                                        $usable_data[0] = $usable_data[$i]; // save current field
                                        $i = 1; // just reset array to start
                                }
 
                                // there seems to be proxystuff after the <?xml....we delete this
-                               if ( (
-                               ($usable_data[$i][0] == '<' ) &&
-                               ($usable_data[$i][1] == 'r' ) &&
-                               ($usable_data[$i][2] == 'd' ) &&
-                               ($usable_data[$i][3] == 'f' ) &&
-                               ($usable_data[$i][4] == ':' )
+                               if ((
+                               ($usable_data[$i][0] == '<') &&
+                               ($usable_data[$i][1] == 'r') &&
+                               ($usable_data[$i][2] == 'd') &&
+                               ($usable_data[$i][3] == 'f') &&
+                               ($usable_data[$i][4] == ':')
                                )
                                ||
                                (
-                               ($usable_data[$i][0] == '<' ) &&
-                               ($usable_data[$i][1] == 'r' ) &&
-                               ($usable_data[$i][2] == 's' ) &&
-                               ($usable_data[$i][3] == 's' )
+                               ($usable_data[$i][0] == '<') &&
+                               ($usable_data[$i][1] == 'r') &&
+                               ($usable_data[$i][2] == 's') &&
+                               ($usable_data[$i][3] == 's')
                                )
                                ) {
 
@@ -1341,7 +1356,7 @@ class fase4_rdf {
                        return $usable_data;
                } else {
                        if (substr($this->_remote_file, 0, 7) != 'http://') {
-                               $this->_throw_exception( 'Cannot find http:// in '.$this->_remote_file.'!' );
+                               $this->_throw_exception('Cannot find http:// in '.$this->_remote_file.'!');
                                return '';
                        } else {
                                // Extract host information
@@ -1362,22 +1377,22 @@ class fase4_rdf {
                                // Start connection to server
                                $fp = fsockopen($host, $port);
                                if (!$fp) {
-                                       $this->_throw_exception( $this->_remote_file.' is maybe not available.' );
-                         return '';
+                                       $this->_throw_exception($this->_remote_file.' is maybe not available.');
+                                       return '';
                                }
                                // Repare request line
                                $request = sprintf("GET %s HTTP/1.0\r\nHost: %s\r\nUser-Agent: Fase4 RDF-Reader/1.40 modified by Quix0r\r\n\r\n", $get, $host);
                                // Send request out
                                fputs($fp, $request);
-                               $reply = ''; $isContent = false; $dummy = '';
+                               $reply = ''; $isContent = FALSE; $dummy = '';
                                // Read reply
                                $i=0;
-                               while ( !feof($fp) ) {
+                               while (!feof($fp)) {
                                        $read = trim(fgets($fp, 4096));
                                        if (substr($read, 0, 5) == '<?xml' || $isContent) {
                                                // Add content
                                                $reply[] = $read;
-                                               $isContent = true;
+                                               $isContent = TRUE;
                                        } else {
                                                // Put in dummy
                                                $dummy[] = $read;