summaryrefslogtreecommitdiffabout
authorWojciech Polak <polak@gnu.org>2010-04-14 15:56:12 (GMT)
committer Wojciech Polak <polak@gnu.org>2010-04-14 15:56:12 (GMT)
commit5a864878730d3b10fb92e37c9720739c7ac18eff (patch) (side-by-side diff)
tree577c465a6706a81c755457e45a482b940af887c9
parentcdfad86f5c1dc24788b56318cfeaf4763213ef24 (diff)
downloadcheetah-5a864878730d3b10fb92e37c9720739c7ac18eff.tar.gz
cheetah-5a864878730d3b10fb92e37c9720739c7ac18eff.tar.bz2
Remove unused hash code in feeds.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/import.php17
-rw-r--r--frontend/lib/feed.class.php5
-rw-r--r--sql/cheetah.sql1
3 files changed, 6 insertions, 17 deletions
diff --git a/frontend/import.php b/frontend/import.php
index 51da2fe..ebc7c57 100644
--- a/frontend/import.php
+++ b/frontend/import.php
@@ -2,7 +2,7 @@
/*
Cheetah News import.php
- Copyright (C) 2005, 2006 Wojciech Polak.
+ Copyright (C) 2005, 2006, 2010 Wojciech Polak.
Copyright (C) 2006 The Cheetah News Team.
This program is free software; you can redistribute it and/or modify it
@@ -72,7 +72,6 @@ class OPMLProcessor
{
var $isOPML = false;
var $feedId = -1;
- var $feedHash = '';
var $folderId = -1;
var $insideFeed = false;
var $insideFolder = false;
@@ -149,17 +148,13 @@ class OPMLProcessor
if ($this->xmlUrl[strlen ($this->xmlUrl) - 1] == '/') {
$this->xmlUrl = substr ($this->xmlUrl, 0, -1);
}
- $url_parts = parse_url ($this->xmlUrl);
- $url = $url_parts['host'].(!empty ($url_parts['path'])
- ? $url_parts['path'] : '');
- $this->feedHash = md5 ($url);
}
else
$this->xmlUrl = '';
if ($this->insideFolder) {
$this->insideFeed = true;
- if ($this->xmlUrl != '') { // feed w folderze
+ if ($this->xmlUrl != '') { // feed in folder
if (!preg_match ('/^http:\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}'
.'((:[0-9]{1,5})?\/.*)?$/i' , $this->xmlUrl))
@@ -178,8 +173,7 @@ class OPMLProcessor
}
}
else {
- $this->db->query ("INSERT INTO feed SET hash='".
- $this->feedHash."', url='".
+ $this->db->query ("INSERT INTO feed SET url='".
$this->xmlUrl."'");
$this->db->query ("SELECT LAST_INSERT_ID() AS id FROM feed");
if ($this->db->next_record ()) {
@@ -237,7 +231,7 @@ class OPMLProcessor
}
}
}
- else { // feed bez folderu
+ else { // feed without a folder
$this->insideFeed = true;
if (!preg_match ('/^http:\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}'
@@ -258,8 +252,7 @@ class OPMLProcessor
}
}
else {
- $this->db->query ("INSERT INTO feed SET hash='".
- $this->feedHash."', url='".$this->xmlUrl."'");
+ $this->db->query ("INSERT INTO feed SET url='".$this->xmlUrl."'");
$this->db->query ("SELECT LAST_INSERT_ID() AS id FROM feed");
if ($this->db->next_record ()) {
$this->feedId = $this->db->f ('id');
diff --git a/frontend/lib/feed.class.php b/frontend/lib/feed.class.php
index 8348170..4d3db53 100644
--- a/frontend/lib/feed.class.php
+++ b/frontend/lib/feed.class.php
@@ -23,7 +23,6 @@ require_once 'lib/feedparser.class.php';
class Feed
{
var $id;
- var $hash;
var $url;
var $lastModified;
var $eTag;
@@ -34,7 +33,6 @@ class Feed
function Feed ()
{
$this->id = null;
- $this->hash = null;
$this->url = null;
$this->lastModified = null;
$this->eTag = null;
@@ -279,14 +277,13 @@ class Feed
}
$url_parts = parse_url ($this->url);
$url = $url_parts['host'].(!empty ($url_parts['path']) ? $url_parts['path'] : '');
- $this->hash = md5 ($url);
if (empty ($this->description)) {
$this->description = $url;
}
$this->description = str_replace ("\n", ' ', $this->description);
- $db->query ("INSERT INTO feed SET hash='".$this->hash."', url='".$this->url."', ".
+ $db->query ("INSERT INTO feed SET url='".$this->url."', ".
"description='".$db->escape ($this->description)."'");
if ($db->affected_rows () == 1)
{
diff --git a/sql/cheetah.sql b/sql/cheetah.sql
index 6547751..2ed00ce 100644
--- a/sql/cheetah.sql
+++ b/sql/cheetah.sql
@@ -50,7 +50,6 @@ CREATE TABLE openid (
-- DROP TABLE IF EXISTS feed;
CREATE TABLE feed (
id int(11) NOT NULL auto_increment,
- hash varchar(64) NOT NULL default '',
url varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
PRIMARY KEY (id)

Return to:

Send suggestions and report system problems to the System administrator.