@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | /* @var PluginHost $host */ |
| 16 | - public function init($host ) { |
|
| 16 | + public function init($host) { |
|
| 17 | 17 | $this->host = $host; |
| 18 | 18 | $this->base = new Auth_Base(); |
| 19 | 19 | |
@@ -59,16 +59,16 @@ discard block |
||
| 59 | 59 | $_SESSION["hide_logout"] = true; |
| 60 | 60 | |
| 61 | 61 | // LemonLDAP can send user informations via HTTP HEADER |
| 62 | - if (defined('AUTH_AUTO_CREATE') && AUTH_AUTO_CREATE){ |
|
| 62 | + if (defined('AUTH_AUTO_CREATE') && AUTH_AUTO_CREATE) { |
|
| 63 | 63 | // update user name |
| 64 | 64 | $fullname = $_SERVER['HTTP_USER_NAME'] ? $_SERVER['HTTP_USER_NAME'] : $_SERVER['AUTHENTICATE_CN']; |
| 65 | - if ($fullname){ |
|
| 65 | + if ($fullname) { |
|
| 66 | 66 | $sth = $this->pdo->prepare("UPDATE ttrss_users SET full_name = ? WHERE id = ?"); |
| 67 | 67 | $sth->execute([$fullname, $user_id]); |
| 68 | 68 | } |
| 69 | 69 | // update user mail |
| 70 | 70 | $email = $_SERVER['HTTP_USER_MAIL'] ? $_SERVER['HTTP_USER_MAIL'] : $_SERVER['AUTHENTICATE_MAIL']; |
| 71 | - if ($email){ |
|
| 71 | + if ($email) { |
|
| 72 | 72 | $sth = $this->pdo->prepare("UPDATE ttrss_users SET email = ? WHERE id = ?"); |
| 73 | 73 | $sth->execute([$email, $user_id]); |
| 74 | 74 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | print "<div dojoType=\"dijit.layout.AccordionPane\" |
| 23 | 23 | title=\"<i class='material-icons'>bookmark</i> ".__('Bookmarklets')."\">"; |
| 24 | 24 | |
| 25 | - print "<h3>" . __("Drag the link below to your browser toolbar, open the feed you're interested in in your browser and click on the link to subscribe to it.") . "</h3>"; |
|
| 25 | + print "<h3>".__("Drag the link below to your browser toolbar, open the feed you're interested in in your browser and click on the link to subscribe to it.")."</h3>"; |
|
| 26 | 26 | |
| 27 | 27 | $bm_subscribe_url = str_replace('%s', '', Pref_Feeds::subscribe_to_feed_url()); |
| 28 | 28 | |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | $bm_url = htmlspecialchars("javascript:{if(confirm('$confirm_str'.replace('%s',window.location.href)))window.location.href='$bm_subscribe_url'+window.location.href}"); |
| 32 | 32 | |
| 33 | 33 | print "<p><label class='dijitButton'>"; |
| 34 | - print "<a href=\"$bm_url\">" . __('Subscribe in Tiny Tiny RSS'). "</a>"; |
|
| 34 | + print "<a href=\"$bm_url\">".__('Subscribe in Tiny Tiny RSS')."</a>"; |
|
| 35 | 35 | print "</label></p>"; |
| 36 | 36 | |
| 37 | - print "<h3>" . __("Use this bookmarklet to publish arbitrary pages using Tiny Tiny RSS") . "</h3>"; |
|
| 37 | + print "<h3>".__("Use this bookmarklet to publish arbitrary pages using Tiny Tiny RSS")."</h3>"; |
|
| 38 | 38 | |
| 39 | 39 | print "<label class='dijitButton'>"; |
| 40 | 40 | $bm_url = htmlspecialchars("javascript:(function(){var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='".get_self_url_prefix()."/public.php?op=sharepopup',l=d.location,e=encodeURIComponent,g=f+'&title='+((e(s))?e(s):e(document.title))+'&url='+e(l.href);function a(){if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=500,height=250')){l.href=g;}}a();})()"); |
| 41 | - print "<a href=\"$bm_url\">" . __('Share with Tiny Tiny RSS'). "</a>"; |
|
| 41 | + print "<a href=\"$bm_url\">".__('Share with Tiny Tiny RSS')."</a>"; |
|
| 42 | 42 | print "</label>"; |
| 43 | 43 | |
| 44 | 44 | print "<button dojoType='dijit.form.Button' class='alt-info' onclick='window.open(\"https://tt-rss.org/wiki/ShareAnything\")'> |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function get_js() { |
| 18 | - return file_get_contents(dirname(__FILE__) . "/init.js"); |
|
| 18 | + return file_get_contents(dirname(__FILE__)."/init.js"); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | public function hook_article_button($line) { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $sth->execute(array_merge($ids, [$_SESSION['uid']])); |
| 47 | 47 | |
| 48 | 48 | if (count($ids) > 1) { |
| 49 | - $subject = __("[Forwarded]") . " " . __("Multiple articles"); |
|
| 49 | + $subject = __("[Forwarded]")." ".__("Multiple articles"); |
|
| 50 | 50 | } else { |
| 51 | 51 | $subject = ""; |
| 52 | 52 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | while ($line = $sth->fetch()) { |
| 55 | 55 | |
| 56 | 56 | if (!$subject) |
| 57 | - $subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]); |
|
| 57 | + $subject = __("[Forwarded]")." ".htmlspecialchars($line["title"]); |
|
| 58 | 58 | |
| 59 | 59 | $tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"])); |
| 60 | 60 | $tpl->setVariable('ARTICLE_URL', strip_tags($line["link"])); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function get_js() { |
| 20 | - return file_get_contents(dirname(__FILE__) . "/note.js"); |
|
| 20 | + return file_get_contents(dirname(__FILE__)."/note.js"); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function get_js() { |
| 17 | - return file_get_contents(__DIR__ . "/init.js"); |
|
| 17 | + return file_get_contents(__DIR__."/init.js"); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function api_version() { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function hook_house_keeping() { |
| 36 | 36 | /* since HOOK_UPDATE_TASK is not available to user plugins, this hook is a next best thing */ |
| 37 | 37 | |
| 38 | - Debug::log("caching media of starred articles for user " . $this->host->get_owner_uid() . "..."); |
|
| 38 | + Debug::log("caching media of starred articles for user ".$this->host->get_owner_uid()."..."); |
|
| 39 | 39 | |
| 40 | 40 | $sth = $this->pdo->prepare("SELECT content, ttrss_entries.title, |
| 41 | 41 | ttrss_user_entries.owner_uid, link, site_url, ttrss_entries.id, plugin_data |
@@ -53,13 +53,13 @@ discard block |
||
| 53 | 53 | $usth = $this->pdo->prepare("UPDATE ttrss_entries SET plugin_data = ? WHERE id = ?"); |
| 54 | 54 | |
| 55 | 55 | while ($line = $sth->fetch()) { |
| 56 | - Debug::log("processing article " . $line["title"], Debug::$LOG_VERBOSE); |
|
| 56 | + Debug::log("processing article ".$line["title"], Debug::$LOG_VERBOSE); |
|
| 57 | 57 | |
| 58 | 58 | if ($line["site_url"]) { |
| 59 | 59 | $success = $this->cache_article_images($line["content"], $line["site_url"], $line["owner_uid"], $line["id"]); |
| 60 | 60 | |
| 61 | 61 | if ($success) { |
| 62 | - $plugin_data = "starred_cache_images,${line['owner_uid']}:" . $line["plugin_data"]; |
|
| 62 | + $plugin_data = "starred_cache_images,${line['owner_uid']}:".$line["plugin_data"]; |
|
| 63 | 63 | |
| 64 | 64 | $usth->execute([$plugin_data, $line['id']]); |
| 65 | 65 | } |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | /* actual housekeeping */ |
| 71 | 71 | |
| 72 | - Debug::log("expiring " . $this->cache->getDir() . "..."); |
|
| 72 | + Debug::log("expiring ".$this->cache->getDir()."..."); |
|
| 73 | 73 | |
| 74 | - $files = glob($this->cache->getDir() . "/*.{png,mp4,status}", GLOB_BRACE); |
|
| 74 | + $files = glob($this->cache->getDir()."/*.{png,mp4,status}", GLOB_BRACE); |
|
| 75 | 75 | |
| 76 | 76 | $last_article_id = 0; |
| 77 | 77 | $article_exists = 1; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | public function hook_enclosure_entry($enc, $article_id) { |
| 98 | - $local_filename = $article_id . "-" . sha1($enc["content_url"]); |
|
| 98 | + $local_filename = $article_id."-".sha1($enc["content_url"]); |
|
| 99 | 99 | |
| 100 | 100 | if ($this->cache->exists($local_filename)) { |
| 101 | 101 | $enc["content_url"] = $this->cache->getUrl($local_filename); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | if ($entry->hasAttribute('src')) { |
| 115 | 115 | $src = rewrite_relative_url($site_url, $entry->getAttribute('src')); |
| 116 | 116 | |
| 117 | - $local_filename = $article_id . "-" . sha1($src); |
|
| 117 | + $local_filename = $article_id."-".sha1($src); |
|
| 118 | 118 | |
| 119 | 119 | if ($this->cache->exists($local_filename)) { |
| 120 | 120 | $entry->setAttribute("src", $this->cache->getUrl($local_filename)); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | private function cache_url($article_id, $url) { |
| 131 | - $local_filename = $article_id . "-" . sha1($url); |
|
| 131 | + $local_filename = $article_id."-".sha1($url); |
|
| 132 | 132 | |
| 133 | 133 | if (!$this->cache->exists($local_filename)) { |
| 134 | 134 | Debug::log("cache_images: downloading: $url to $local_filename", Debug::$LOG_VERBOSE); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $data = fetch_file_contents(["url" => $url, "max_size" => MAX_CACHE_FILE_SIZE]); |
| 137 | 137 | |
| 138 | 138 | if ($data) |
| 139 | - return $this->cache->put($local_filename, $data);; |
|
| 139 | + return $this->cache->put($local_filename, $data); ; |
|
| 140 | 140 | |
| 141 | 141 | } else { |
| 142 | 142 | //Debug::log("cache_images: local file exists for $url", Debug::$LOG_VERBOSE); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | private function cache_article_images($content, $site_url, $owner_uid, $article_id) { |
| 151 | - $status_filename = $article_id . "-" . sha1($site_url) . ".status"; |
|
| 151 | + $status_filename = $article_id."-".sha1($site_url).".status"; |
|
| 152 | 152 | |
| 153 | 153 | /* housekeeping might run as a separate user, in this case status/media might not be writable */ |
| 154 | 154 | if (!$this->cache->isWritable($status_filename)) { |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $has_images = false; |
| 182 | 182 | $success = false; |
| 183 | 183 | |
| 184 | - if ($doc->loadHTML('<?xml encoding="UTF-8">' . $content)) { |
|
| 184 | + if ($doc->loadHTML('<?xml encoding="UTF-8">'.$content)) { |
|
| 185 | 185 | $xpath = new DOMXPath($doc); |
| 186 | 186 | $entries = $xpath->query('(//img[@src])|(//video/source[@src])'); |
| 187 | 187 | |
@@ -17,15 +17,15 @@ discard block |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function get_js() { |
| 20 | - return file_get_contents(dirname(__FILE__) . "/share.js"); |
|
| 20 | + return file_get_contents(dirname(__FILE__)."/share.js"); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | public function get_css() { |
| 24 | - return file_get_contents(dirname(__FILE__) . "/share.css"); |
|
| 24 | + return file_get_contents(dirname(__FILE__)."/share.css"); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | public function get_prefs_js() { |
| 28 | - return file_get_contents(dirname(__FILE__) . "/share_prefs.js"); |
|
| 28 | + return file_get_contents(dirname(__FILE__)."/share_prefs.js"); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | public function hook_prefs_tab_section($id) { |
| 43 | 43 | if ($id == "prefFeedsPublishedGenerated") { |
| 44 | 44 | |
| 45 | - print "<h3>" . __("You can disable all articles shared by unique URLs here.") . "</h3>"; |
|
| 45 | + print "<h3>".__("You can disable all articles shared by unique URLs here.")."</h3>"; |
|
| 46 | 46 | |
| 47 | 47 | print "<button class='alt-danger' dojoType='dijit.form.Button' onclick=\"return Plugins.Share.clearKeys()\">". |
| 48 | 48 | __('Unshare all articles')."</button> "; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $sth->execute([$uuid, $param, $_SESSION['uid']]); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - print "<header>" . __("You can share this article by the following unique URL:") . "</header>"; |
|
| 103 | + print "<header>".__("You can share this article by the following unique URL:")."</header>"; |
|
| 104 | 104 | |
| 105 | 105 | $url_path = get_self_url_prefix(); |
| 106 | 106 | $url_path .= "/public.php?op=share&key=$uuid"; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | public function get_js() { |
| 16 | - return file_get_contents(__DIR__ . "/init.js"); |
|
| 16 | + return file_get_contents(__DIR__."/init.js"); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function api_version() { |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function get_js() { |
| 17 | - return file_get_contents(__DIR__ . "/init.js"); |
|
| 17 | + return file_get_contents(__DIR__."/init.js"); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function api_version() { |