소스 검색

Corrected default number of articles in CryptomeBridge.

The bridge was outputting a single entry when parameter n was empty.
Sebastien SAUVAGE 10 년 전
부모
커밋
50a96a3f21
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      bridges/CryptomeBridge.php

+ 2 - 1
bridges/CryptomeBridge.php

@@ -18,10 +18,11 @@ class CryptomeBridge extends BridgeAbstract{
         //$link = 'https://secure.netsolhost.com/cryptome.org/';
 
         $html = file_get_html($link) or $this->returnError('Could not request Cryptome.', 404);
-        if (isset($param['n'])) {   /* number of documents */
+        if (!empty($param['n'])) {   /* number of documents */
             $num = min(max(1, $param['n']+0), $num);
         }
 
+
         foreach($html->find('pre') as $element) {
             for ( $i = 0; $i < $num; ++$i ) {
                 $item = new \Item();