Commit graph

163 commits

Author SHA1 Message Date
logmanoriginal
2595b5d7d8 [index] Bump version 2017-08-19 21:09:48 +02:00
logmanoriginal
f91309c7e4 [index] Use constant WHITELIST_FILE all the way 2017-08-12 19:15:16 +02:00
logmanoriginal
cd012e115b [index] Show bridge options when loading with URL fragment
Loading the page with an URL fragement (#bridge-*) should result in
the bridge showing all parameters by default. Unfortunately this is
not possible using PHP, which is why a new JavaScript function is
needed (select.js)

That way, when returning from a bridge ('back to rss-bridge') will
keep the selected bridge active (only works for HTML format).
2017-08-11 19:39:16 +02:00
logmanoriginal
df9e3968dc [index] Add GET parameter 'q' for search queries 2017-08-11 17:43:15 +02:00
logmanoriginal
99e7e7876e exception: Use built-in HTTP response codes
PHP >= 5.4 provides a built-in function to generate valid HTTP
error header including the error description: http_response_code()

See: http://php.net/manual/en/function.http-response-code.php
See also: https://stackoverflow.com/a/12018482

This commit removes the '\Http' utility class and replaces all
calls to 'Http::getMessageForCode()' by 'http_response_code()'
2017-08-06 12:55:11 +02:00
logmanoriginal
84d2c02a09 whitelist: Do case-insensitive whitelist matching
Matching whitelisted bridges using a case-insensitive match makes
sense for following reasons:

- Wrong upper/lower case spelling in the whitelist is not easily
discovered. Example: Misspelling 'Youtube' as 'YouTube' will not
show the 'Youtube' bridge (while it is expected to show)

- Two bridges with the same name but different letter casing are
discouraged to prevent confusion and keep the project compatible
with Windows machines
2017-08-06 00:01:32 +02:00
logmanoriginal
ccd8af09b9 [index] Use single quotes instead of double quotes 2017-08-05 15:46:16 +02:00
logmanoriginal
f2d02a4187 [index] Simplify debug mode detection
This removes superfluous variables and if-statements when checking
whether the debug mode is active or not.
2017-08-05 15:43:48 +02:00
logmanoriginal
f19d34a5a1 [index] Check permissions for cache folder and whitelist file
* The cache folder requires write permissions at all times
* The whitelist file requires write permissions if it does not
exist (can be created manually)
2017-08-05 15:23:30 +02:00
logmanoriginal
f1534c91e2 [index] Use constant instead of variable for the whitelist file path
Like the cache folder the whitelist file is assumed static and thus
should be defined as constant.
2017-08-05 15:23:08 +02:00
logmanoriginal
f7265ca77b [index] Bump version number 2017-08-03 20:51:59 +02:00
logmanoriginal
a4b9611e66 [phpcs] Add missing rules
- Do not add spaces after opening or before closing parenthesis

  // Wrong
  if( !is_null($var) ) {
    ...
  }

  // Right
  if(!is_null($var)) {
    ...
  }

- Add space after closing parenthesis

  // Wrong
  if(true){
    ...
  }

  // Right
  if(true) {
    ...
  }

- Add body into new line
- Close body in new line

  // Wrong
  if(true) { ... }

  // Right
  if(true) {
    ...
  }

Notice: Spaces after keywords are not detected:

  // Wrong (not detected)
  // -> space after 'if' and missing space after 'else'
  if (true) {
    ...
  } else{
    ...
  }

  // Right
  if(true) {
    ...
  } else {
    ...
  }
2017-07-29 19:55:12 +02:00
LogMANOriginal
38b56bf23a [index] Improve error handling (#555)
Add additional information to error message:

- Name of the bridge
- Possible solutions
- Error description
- Error code
- Error message

* Output type changed from 'text' to 'html'
* Added styles for the error page
* Added a button to remotely open a GitHub issue

Closes #525
2017-07-29 19:16:16 +02:00
Teromene
1a4c3f4418 Add a search bar to simplify looking for a bridge. (#494)
* Add a search bar to simplify looking for a bridge.

* Fix phpcs line length.

* Change the phpcs config.
2017-03-21 20:31:10 +00:00
Teromene
c803396d7e Correct phpcs check. 2017-03-09 22:27:14 +00:00
Teromene
ac518ca297 Fix line return in user-agent. 2017-03-08 11:47:55 +00:00
Teromene
1763a1518c Restore the ability to whitelist all the bridges by putting a wildcard into the whitelist file. 2017-03-08 10:56:39 +00:00
logmanoriginal
ff83410534 style: Fix coding styles 2017-02-14 17:28:07 +01:00
Badet Aurélien
c702a0e69f Bridge getExtraInfos (#432)
* add function getExtraInfos() to BridgeAbstract

* replace call to $bridge->getName() and $bridge->getURI() by $bridge->getExtraInfos()

replace call to $bridge->getName() and $bridge->getURI() by $bridge->getExtraInfos() defined by default in BridgeAbstract.
So we could pass additionals ExtraInfos from custom bridges to custom formats.
2016-11-29 00:48:59 +00:00
logmanoriginal
d39c1ed63a [index] Add check for 'allow_url_fopen' 2016-11-05 13:09:20 +01:00
logmanoriginal
04a195361a [index] Add check for 'libxml' extension 2016-11-05 13:05:28 +01:00
logmanoriginal
3bcd98404b [index] Add check for correct PHP version 2016-11-05 13:02:48 +01:00
logmanoriginal
5790ebc6ba [index] Initialize variable before using it 2016-10-20 22:12:54 +02:00
logmanoriginal
85149add61 [index] Fixes a bug where requests could result in same cache file names
Previously the cache file name was only build upon bridge
parameters. If two bridges don't make use of any parameter
this would result into equal file names.
2016-10-20 22:03:23 +02:00
logmanoriginal
8fb4db8914 [index] Introduce CACHE_DIR 2016-10-08 16:21:00 +02:00
logmanoriginal
5c309e93dc [cache] Specify cache duration for 'purgeCache' 2016-10-08 16:18:10 +02:00
logmanoriginal
2d56b717cf [FileCache] Add property to define cache folder 2016-10-08 16:03:08 +02:00
logmanoriginal
5de4a59d41 [index] Initialize cache before loading to bridge
Previously BridgeAbstract needed to know which exact implementation
of CacheInterface was used (since we only got one right now its
not a problem). Initializing the cache in index.php instead allows
to change cache types more easily.
2016-10-08 15:29:21 +02:00
logmanoriginal
9ac678aac5 [Cache] Move 'purge' function to implementations
The purge function is cache specific and thus belongs
to the specific implementation.
2016-10-07 22:33:45 +02:00
logmanoriginal
b61ea84950 [index] Show debug status on main page 2016-10-02 18:43:20 +02:00
logmanoriginal
b32cfd5dc3 [index] Explicitly define DEBUG with Boolean value 2016-10-02 17:16:21 +02:00
logmanoriginal
978e5cdbf5 [index] Define cache even in DEBUG mode 2016-10-02 16:43:08 +02:00
Pierre Mazière
747be13849 [core] extract HTMLUtils methods to make them functions
Methods displayBridgeCard, sanitize, defaultImageSrcTo are now
functions in lib/html.php
getHelperButtinsFormat and getFormHeader are now anonymous functions
defined in displayBridgeCard

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-09-25 23:58:52 +02:00
Pierre Mazière
f1fb95b257 [core] extract BridgeAbstract methods to make them functions
- returnError, returnServerError, returnClientError ,debugMessage are
  moved to lib/error.php

- getContents, getSimpleHTMLDOM, getSimpleHTMLDOMCached are moved to
  lib/contents.php

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-09-25 23:22:33 +02:00
logmanoriginal
3438b96197 [index] Fix another github URL 2016-09-17 20:21:48 +02:00
Pierre Mazière
2ca7129e22 [core] fix user agent url to rss-bridge github project
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-09-17 19:37:41 +02:00
logmanoriginal
e3392a738b [phpcs] Remove check for Zend OperatorSpacing
This check is not helping as code is quite readable
2016-09-10 21:05:29 +02:00
logmanoriginal
ab16af631e [core] Apply some fixes 2016-09-10 21:01:02 +02:00
logmanoriginal
a84016bcb6 [core] Rename item getter/setter
getDatas -> getItems
setDatas -> setItems

Note: Bridge->setDatas actually sets data, where Bridge->getItems
only returns items (this is why Bridge->setDatas was not changed)
2016-08-29 19:42:58 +02:00
Pierre Mazière
de1b39c8e5 [core + bridges] get rid of loadMetadata
if a bridge needs to modify some of the data that were initialized
there, ::__construct() should be used instead.

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-28 13:05:03 +02:00
Pierre Mazière
2670a0e400 [core] get parameters from $_GET rather than $_REQUEST
No need to play with parameters that RSS-Bridge did not ask for

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-25 17:28:47 +02:00
Pierre Mazière
1bb94aecc6 [core] leave $_REQUEST alone
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-25 01:07:49 +02:00
Pierre Mazière
b31b6667f6 [core] fix missing filter_input
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-23 17:22:51 +02:00
Pierre Mazière
3c089c1b11 [core] keep compatibility with nameBridge and nameFormat naming scheme
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-23 16:10:26 +02:00
Pierre Mazière
7e0ac1a6b6 [core] better use of filter_input
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-23 14:42:53 +02:00
Pierre Mazière
0a86d572c2 [core] simplify cache related code and remove misleading comment
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-23 14:41:41 +02:00
Pierre Mazière
13285f080a [core] use filter_input() instead of direct access to $_REQUEST
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-23 14:22:02 +02:00
logmanoriginal
251d7646b7 [index] Fix loading of metadata
Re-introduces commit a1257126bc
2016-08-19 14:46:22 +02:00
Pierre Mazière
10cd3a61a9 check for PROXY_NAME definition before using it
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:20:27 +02:00
Pierre Mazière
d71674d2ba proxy settings must be the service provider decision
therefore, the provider decides if the service use a
proxy or not, and if users can have the possibility to
disable it on a bridge basis.

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:19:56 +02:00
Pierre Mazière
09d4e21bdc possibility to hide proxy address
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:19:56 +02:00
Pierre Mazière
3dd63ab6fd enable proxy usage for individual bridge
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2016-08-19 10:19:56 +02:00
logmanoriginal
c0b607c841 [index] Fix whitelist default array
WikipediaBridge recently replaced WikipediaENBridge,
WikipediaEOBridge and WikipediaFRBridge
2016-08-07 15:36:50 +02:00
logmanoriginal
3f83763ff9 [index] Don't render 'Show inactive bridges' if non inactive 2016-08-07 15:15:55 +02:00
logmanoriginal
75f7a32b99 [index] Allow hiding of inactive bridges when shown 2016-08-07 15:06:48 +02:00
logmanoriginal
a1257126bc [index] Make sure metadata is loaded before requesting data
loadMetadatas must be executed before setDatas to load all
metadatas before using them in collectData (called by setDatas)
2016-08-06 18:38:42 +02:00
Teromene
6b7b38db54 Improved new style. 2016-08-02 22:16:43 +02:00
ORelio
a63773178a [Core] Allow IP whitelisting for debug mode
...Because we are never cautious enough
while debugging a live rss-bridge instance.
2016-06-12 22:12:49 +02:00
Teromene
d7f079e66b Modified the debug system to use a file as a trigger instead of a URL parameter.
Modified the gitignore accordingly.
2016-03-17 14:36:33 +00:00
teromene@teromene.fr
3e8a7624e1 Added an URL option to activate debug : debug activates all messages, and disables the cache. 2016-03-03 15:26:07 +00:00
ahiles3005
4fac0e382c bug fix: After adding a new bridge, it is not loaded because it was removed from the list of action 2016-03-01 20:39:09 +04:00
Mitsukarenai
9c8f552a2a Remove duplicate cache purge - issue #183 2015-12-06 19:01:56 +01:00
Mitsukarenai
b8ec283458 fucked up merge >< 2015-12-06 16:40:13 +01:00
Mitsukarenai
6866e508cb Merge branch 'experimental' of github.com:sebsauvage/rss-bridge 2015-12-06 16:01:30 +01:00
Teromene
1a4a428449 Correction de quelques problèmes avec RSSExpander suite à la migration dans lib/Bridge.
Correction de typos.
Ajout de la possibilité d'utiliser un proxy.
2015-12-06 15:56:39 +01:00
Teromene
e582c887fb Ajout du paramètre pattern pour les entrées de type texte, ajout du required côté HTML.
Correction de la page d'accueuil pour qu'elle soit conforme aux standards du W3C.
Correction de la regex de listage des fichiers pour qu'elle ignore les sauvegardes.
Ajout d'un nettoyeur HTML, par défaut.
2015-12-06 15:56:39 +01:00
teromene
38829e7739 Little refactoring to reduce logic on index.php.
Moved RssExpander as a core logic system to lib/Bridge.php

Signed-off-by: teromene <teromene@teromene.fr>
2015-12-06 15:56:39 +01:00
teromene
715ad3bf3f Checking if the parameter mode has a name, same for exampleValue.
Change the default bridge name.

Signed-off-by: teromene <teromene@teromene.fr>
2015-12-06 15:56:39 +01:00
teromene
2e4e89aff8 Correction of few bugs.
Warn if RSS-Bridge cannot write to disk.
Try/Catch the bridge RSS generation.

Signed-off-by: teromene <teromene@teromene.fr>
2015-12-06 15:56:39 +01:00
teromene
2d526f4e0a Correction de quelques bugs dans les bridges, qui apparaissent à cause du fait qu'ils sont tous instanciés lors du chargement de tout les bridges.
Ré-ajout et ré-utilisation de getName et getURI, qui permettent d'avoir des élements dynamiques.
Changement en public de certaines valeurs.
Changement du nom de certaines constantes, déja utilisés.

Signed-off-by: teromene <teromene@teromene.fr>
2015-12-06 15:56:39 +01:00
teromene
5d2e7ac83d Ajout d'options multiples pour les méta-données.
Ajout d'un bridge de démonstration, DemoBridge.
Ajout d'un début de documentation pour créer un bridge dans CREATE_BRIDGE.md
2015-12-06 15:56:39 +01:00
teromene
2deef45867 Première version du nouveau système de méta-données.
Voir exemple dans YoutubeBridge.
2015-12-06 15:56:39 +01:00
Teromene
f386fc4a10 Added the Cache cleaning system. 2015-12-04 09:19:05 +00:00
Mitsukarenai
c13c7a1d25 cache: check if cache folder exists 2015-12-03 22:09:18 +01:00
Mitsukarenai
40fdb17280 Implement basic cache purge (issue #178) 2015-11-30 10:47:16 +01:00
Teromene
a07839019e Correction de quelques problèmes avec RSSExpander suite à la migration dans lib/Bridge.
Correction de typos.
Ajout de la possibilité d'utiliser un proxy.
2015-11-27 14:20:33 +00:00
Teromene
e1cdca6971 Ajout du paramètre pattern pour les entrées de type texte, ajout du required côté HTML.
Correction de la page d'accueuil pour qu'elle soit conforme aux standards du W3C.
Correction de la regex de listage des fichiers pour qu'elle ignore les sauvegardes.
Ajout d'un nettoyeur HTML, par défaut.
2015-11-11 21:45:24 +00:00
teromene
d033bb51ac Little refactoring to reduce logic on index.php.
Moved RssExpander as a core logic system to lib/Bridge.php

Signed-off-by: teromene <teromene@teromene.fr>
2015-11-05 20:26:48 +00:00
teromene
2b54377148 Checking if the parameter mode has a name, same for exampleValue.
Change the default bridge name.

Signed-off-by: teromene <teromene@teromene.fr>
2015-11-05 15:49:55 +00:00
teromene
43f0fc93b7 Correction of few bugs.
Warn if RSS-Bridge cannot write to disk.
Try/Catch the bridge RSS generation.

Signed-off-by: teromene <teromene@teromene.fr>
2015-11-05 10:12:58 +00:00
teromene
a5a959dced Correction de quelques bugs dans les bridges, qui apparaissent à cause du fait qu'ils sont tous instanciés lors du chargement de tout les bridges.
Ré-ajout et ré-utilisation de getName et getURI, qui permettent d'avoir des élements dynamiques.
Changement en public de certaines valeurs.
Changement du nom de certaines constantes, déja utilisés.

Signed-off-by: teromene <teromene@teromene.fr>
2015-11-03 23:05:10 +00:00
teromene
1c869631d6 Ajout d'options multiples pour les méta-données.
Ajout d'un bridge de démonstration, DemoBridge.
Ajout d'un début de documentation pour créer un bridge dans CREATE_BRIDGE.md
2015-11-03 14:36:19 +00:00
teromene
c204b9d914 Première version du nouveau système de méta-données.
Voir exemple dans YoutubeBridge.
2015-11-01 11:17:36 +00:00
Mitsu
fcc072170c Merge pull request #156 from teromene/master
Add support for list parameters
2015-10-30 12:26:29 +01:00
Mitsukarenai
f11d6fc2ad [Facebook] Added to main bridges (#148) 2015-10-08 00:25:36 +02:00
teromene
eb24487807 Ajout d'une option de compatibilité pour les bridges n'utilisant pas le nouveau format 2015-09-14 14:04:38 +01:00
teromene
81f89b1246 Ajout de la possibilité d'avoir une liste en paramètre, voir exemple d'utilisation dans DauphineLibereBridge. 2015-09-14 13:59:20 +01:00
Mitsukarenai
d95f4024f5 [TheOatMeal] fixes 2015-07-30 11:57:26 +02:00
Nicolas Delsaux
6003daff9d fixed a small bug regarding url processing 2015-07-05 15:51:17 +02:00
unknown
0f6fdb0c5b Merge branch 'live' 2015-04-06 14:54:54 +02:00
Mitsukarenai
768a8a29d7 undefault ThePirateBay... issue #103 2014-12-11 11:57:19 +01:00
Mitsukarenai
950b3297e0 TPB: add to main bridges (incoming censorship in FR) 2014-12-04 18:45:09 +01:00
Mitsukarenai
3e6bd3ecc5 Add GooglePlus to main bridges 2014-07-20 17:43:29 +02:00
Grummfy
a6289150c1 Display the list of bridges 2014-07-20 17:18:49 +02:00
Grummfy
82749229a7 Display the lsit of bridges 2014-07-20 17:11:11 +02:00
Grummfy
fd574ce102 Display number of brige 2014-07-20 16:51:16 +02:00
Grummfy
c297869a3c - 2014-07-20 16:49:53 +02:00
Grummfy
42f6ee09e5 oups 2014-07-20 16:48:30 +02:00
Grummfy
785cf75d60 a bit of cleaning for reading 2014-07-20 16:47:02 +02:00
Mitsukarenai
1132c90674 catchphrase 2014-05-28 17:46:56 +02:00