Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1b12ab4

Browse files
- Fixed a bug which caused a PHP notice, undefined index with accessing $_SERVER[ 'HTTP_USER_AGENT' ] when it is not set.
1 parent 98c6f34 commit 1b12ab4

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

‎ChangeLog.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
### 1.3.1
4+
- Fixed a bug which caused a PHP notice, undefined index with accessing `$_SERVER[ 'HTTP_USER_AGENT' ]` when it is not set.
5+
36
### 1.3.0 - 2018年10月23日
47
- Added the `width` and `height` parameters for the `screenshot` output type.
58
- Added the `cache-lifespan` parameter that determines the cache duration.

‎web/include/class/scraper/ScraperHandler.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ private function ___getBaseArguments( array $aRequest ) {
9898
}
9999
private function ___getUserAgent( array $aRequest ) {
100100
if ( ! isset( $aRequest[ 'user-agent' ] ) ) {
101-
return $_SERVER[ 'HTTP_USER_AGENT' ];
101+
return isset( $_SERVER[ 'HTTP_USER_AGENT' ] )
102+
? $_SERVER[ 'HTTP_USER_AGENT' ]
103+
: '';
102104
}
103105
return 'random' === $aRequest[ 'user-agent' ]
104106
? $this->getOneFromList( Registry::$sDirPath . '/include/user-agents.txt' )

‎web/index.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Registry {
1010
const SLUG = 'SimpleWebScraper';
1111
const DESCRIPTION = 'PHP & PhantomJS driven web content scraper';
1212
const PROGRAM_URI = 'https://github.com/michaeluno/php-simple-web-scraper';
13-
const VERSION = '1.3.0';
13+
const VERSION = '1.3.1';
1414
const AUTHOR = 'Michael Uno';
1515
const AUTHOR_URI = 'http://en.michaeluno.jp';
1616

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /