Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 's10_MDL-27341_flickr_json_error_20' of git://github.com…

…/dongsheng/moodle into MOODLE_20_STABLE
  • Loading branch information...
commit 2c85a824fcf49ea688e7d188aa772827cd039fbd 2 parents 6ce26b0 + 466b23c
@stronk7 stronk7 authored
Showing with 13 additions and 13 deletions.
  1. +13 −13 repository/flickr_public/lib.php
View
26 repository/flickr_public/lib.php
@@ -280,19 +280,19 @@ public function search($search_text, $page = 1) {
$licenses = implode(',', $licenses);
- if (!empty($SESSION->{$this->sess_tag}) // use tag to search
- or !empty($SESSION->{$this->sess_text}) // use keyword to search
- or !empty($this->nsid)/*use pre-defined accound*/) {
- $photos = $this->flickr->photos_search(array(
- 'tags'=>$SESSION->{$this->sess_tag},
- 'page'=>$page,
- 'per_page'=>24,
- 'user_id'=>$this->nsid,
- 'license'=>$licenses,
- 'text'=>$SESSION->{$this->sess_text}
- )
- );
- }
+ $tag = !empty($SESSION->{$this->sess_tag}) ? $SESSION->{$this->sess_tag} : null;
+ $text = !empty($SESSION->{$this->sess_text}) ? $SESSION->{$this->sess_text} : null;
+ $nsid = !empty($this->nsid) ? $this->nsid : null;
+
+ $photos = $this->flickr->photos_search(array(
+ 'tags'=>$tag,
+ 'page'=>$page,
+ 'per_page'=>24,
+ 'user_id'=>$nsid,
+ 'license'=>$licenses,
+ 'text'=>$text
+ )
+ );
$ret['total'] = $photos['total'];
$ret['perpage'] = $photos['perpage'];
if (empty($photos)) {
Please sign in to comment.
Something went wrong with that request. Please try again.