Standards: Remove EOF closing PHP tags

This commit is contained in:
Hypolite Petovan 2017-04-30 00:21:02 -04:00
parent 4b16de6d80
commit 1d427aa214
33 changed files with 28 additions and 66 deletions

View File

@ -854,4 +854,3 @@ function account_type($contact) {
return $account_type; return $account_type;
} }
?>

View File

@ -81,4 +81,3 @@ class Emailer {
return $res; return $res;
} }
} }
?>

View File

@ -1220,4 +1220,3 @@ class Probe {
return $data; return $data;
} }
} }
?>

View File

@ -334,4 +334,3 @@ class exAuth {
fclose($this->rLogFile); fclose($this->rLogFile);
} }
} }
?>

View File

@ -17,4 +17,3 @@ function create_shadowentry_run($argv, $argc) {
add_shadow_entry($message_id); add_shadow_entry($message_id);
} }
?>

View File

@ -149,4 +149,3 @@ function remove_orphans($stage = 0) {
} }
} }
?>

View File

@ -110,4 +110,3 @@ class dbm {
return date('Y-m-d H:i:s', $timestamp); return date('Y-m-d H:i:s', $timestamp);
} }
} }
?>

View File

@ -3745,4 +3745,3 @@ class Diaspora {
return true; return true;
} }
} }
?>

View File

@ -366,4 +366,3 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) {
return array("header" => $author, "items" => $items); return array("header" => $author, "items" => $items);
} }
} }
?>

View File

@ -47,4 +47,3 @@ function update_files_for_items() {
create_files_from_item($message["id"]); create_files_from_item($message["id"]);
} }
} }
?>

View File

@ -325,4 +325,3 @@ function html2bbcode($message)
return $message; return $message;
} }
?>

View File

@ -233,4 +233,3 @@ function html2plain($html, $wraplength = 75, $compact = false)
return(trim($message)); return(trim($message));
} }
?>

View File

@ -187,7 +187,7 @@ function removelinebreak($message)
(substr(trim($nextline), 0, 7) == 'http://') or (substr(trim($nextline), 0, 7) == 'http://') or
(substr(trim($nextline), 0, 8) == 'https://')); (substr(trim($nextline), 0, 8) == 'https://'));
if (!$specialchars) if (!$specialchars)
$specialchars = ((substr(rtrim($line), -1) == '-') or $specialchars = ((substr(rtrim($line), -1) == '-') or
(substr(rtrim($line), -1) == '=') or (substr(rtrim($line), -1) == '=') or
(substr(rtrim($line), -1) == '*') or (substr(rtrim($line), -1) == '*') or
@ -222,4 +222,3 @@ function removelinebreak($message)
return(implode("\n", $lines)); return(implode("\n", $lines));
} }
?>

View File

@ -2297,4 +2297,3 @@ class ostatus {
return(trim($doc->saveXML())); return(trim($doc->saveXML()));
} }
} }
?>

View File

@ -38,4 +38,3 @@ class pidfile {
return(posix_kill(file_get_contents($this->_file), SIGTERM)); return(posix_kill(file_get_contents($this->_file), SIGTERM));
} }
} }
?>

View File

@ -432,4 +432,3 @@ function plaintext(App $a, $b, $limit = 0, $includedlinks = false, $htmlmode = 2
return($post); return($post);
} }
?>

View File

@ -689,4 +689,3 @@ if (array_search(__file__,get_included_files())===0){
killme(); killme();
} }
?>

View File

@ -258,5 +258,3 @@ function post_update_1206() {
logger("Done", LOGGER_DEBUG); logger("Done", LOGGER_DEBUG);
return true; return true;
} }
?>

View File

@ -129,4 +129,3 @@ function removetofu($message)
return($message); return($message);
} }
?>

View File

@ -22,4 +22,3 @@ function remove_contact_run($argv, $argc) {
// Now we delete all the depending table entries // Now we delete all the depending table entries
dba::delete('contact', array('id' => $id)); dba::delete('contact', array('id' => $id));
} }
?>

View File

@ -2346,4 +2346,3 @@ function poco_serverlist() {
} }
return $r; return $r;
} }
?>

View File

@ -55,4 +55,3 @@ function spool_post_run($argv, $argc) {
} }
} }
} }
?>

View File

@ -148,4 +148,3 @@ function update_items() {
dba::close($messages); dba::close($messages);
} }
?>

View File

@ -296,4 +296,3 @@ function update_shadow_copy() {
dba::close($messages); dba::close($messages);
} }
?>

View File

@ -252,5 +252,3 @@ function nodeinfo_cron() {
logger('cron_end'); logger('cron_end');
Config::set('nodeinfo', 'last_calucation', time()); Config::set('nodeinfo', 'last_calucation', time());
} }
?>

View File

@ -160,5 +160,3 @@ function pubsubhubbub_init(App $a) {
killme(); killme();
} }
?>

View File

@ -14,7 +14,7 @@ class BaseObject {
/** /**
* Get the app * Get the app
* *
* Same as get_app from boot.php * Same as get_app from boot.php
*/ */
public function get_app() { public function get_app() {
@ -33,4 +33,3 @@ class BaseObject {
self::$app = $app; self::$app = $app;
} }
} }
?>

View File

@ -164,4 +164,3 @@ class Conversation extends BaseObject {
return false; return false;
} }
} }
?>

View File

@ -112,7 +112,7 @@ class Item extends BaseObject {
$conv = $this->get_conversation(); $conv = $this->get_conversation();
$lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid'])))) || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
? t('Private Message') ? t('Private Message')
: false); : false);
@ -754,20 +754,20 @@ class Item extends BaseObject {
if ((! $owner_linkmatch) && (! $alias_linkmatch) && (! $owner_namematch)) { if ((! $owner_linkmatch) && (! $alias_linkmatch) && (! $owner_namematch)) {
// The author url doesn't match the owner (typically the contact) // The author url doesn't match the owner (typically the contact)
// and also doesn't match the contact alias. // and also doesn't match the contact alias.
// The name match is a hack to catch several weird cases where URLs are // The name match is a hack to catch several weird cases where URLs are
// all over the park. It can be tricked, but this prevents you from // all over the park. It can be tricked, but this prevents you from
// seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn // seeing "Bob Smith to Bob Smith via Wall-to-wall" and you know darn
// well that it's the same Bob Smith. // well that it's the same Bob Smith.
// But it could be somebody else with the same name. It just isn't highly likely. // But it could be somebody else with the same name. It just isn't highly likely.
$this->owner_photo = $this->get_data_value('owner-avatar'); $this->owner_photo = $this->get_data_value('owner-avatar');
$this->owner_name = $this->get_data_value('owner-name'); $this->owner_name = $this->get_data_value('owner-name');
$this->wall_to_wall = true; $this->wall_to_wall = true;
// If it is our contact, use a friendly redirect link // If it is our contact, use a friendly redirect link
if ((link_compare($this->get_data_value('owner-link'),$this->get_data_value('url'))) if ((link_compare($this->get_data_value('owner-link'),$this->get_data_value('url')))
&& ($this->get_data_value('network') === NETWORK_DFRN)) { && ($this->get_data_value('network') === NETWORK_DFRN)) {
$this->owner_url = $this->get_redirect_url(); $this->owner_url = $this->get_redirect_url();
} else { } else {
@ -807,5 +807,3 @@ class Item extends BaseObject {
} }
} }
/// @TODO These are discouraged and should be removed:
?>

View File

@ -1,7 +1,7 @@
<?php <?php
/** /**
* tests several functions which are used to prevent xss attacks * tests several functions which are used to prevent xss attacks
* *
* @package test.util * @package test.util
*/ */
@ -27,31 +27,31 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase {
*/ */
public function testXmlify() { public function testXmlify() {
$text="<tag>I want to break\n this!11!<?hard?></tag>"; $text="<tag>I want to break\n this!11!<?hard?></tag>";
$xml=xmlify($text); $xml=xmlify($text);
$retext=unxmlify($text); $retext=unxmlify($text);
$this->assertEquals($text, $retext); $this->assertEquals($text, $retext);
} }
/** /**
* xmlify and put in a document * xmlify and put in a document
*/ */
public function testXmlifyDocument() { public function testXmlifyDocument() {
$tag="<tag>I want to break</tag>"; $tag="<tag>I want to break</tag>";
$xml=xmlify($tag); $xml=xmlify($tag);
$text='<text>'.$xml.'</text>'; $text='<text>'.$xml.'</text>';
$xml_parser=xml_parser_create(); $xml_parser=xml_parser_create();
//should be possible to parse it //should be possible to parse it
$values=array(); $index=array(); $values=array(); $index=array();
$this->assertEquals(1, xml_parse_into_struct($xml_parser, $text, $values, $index)); $this->assertEquals(1, xml_parse_into_struct($xml_parser, $text, $values, $index));
$this->assertEquals(array('TEXT'=>array(0)), $this->assertEquals(array('TEXT'=>array(0)),
$index); $index);
$this->assertEquals(array(array('tag'=>'TEXT', 'type'=>'complete', 'level'=>1, 'value'=>$tag)), $this->assertEquals(array(array('tag'=>'TEXT', 'type'=>'complete', 'level'=>1, 'value'=>$tag)),
$values); $values);
xml_parser_free($xml_parser); xml_parser_free($xml_parser);
} }
/** /**
@ -68,4 +68,3 @@ class AntiXSSTest extends PHPUnit_Framework_TestCase {
//get_mentions //get_mentions
//get_contact_block, bis Zeile 538 //get_contact_block, bis Zeile 538
} }
?>

View File

@ -91,4 +91,3 @@ function add_documentation($line) {
return $block; return $block;
} }
?>

View File

@ -98,4 +98,3 @@ while (true) {
// Now sleep for 5 minutes // Now sleep for 5 minutes
sleep(300); sleep(300);
} }
?>

View File

@ -6,7 +6,7 @@ $uid = get_theme_uid();
$s_colorset = get_config('duepuntozero','colorset'); $s_colorset = get_config('duepuntozero','colorset');
$colorset = get_pconfig( $uid, 'duepuntozero', 'colorset'); $colorset = get_pconfig( $uid, 'duepuntozero', 'colorset');
if (!x($colorset)) if (!x($colorset))
$colorset = $s_colorset; $colorset = $s_colorset;
if ($colorset) { if ($colorset) {
@ -25,5 +25,3 @@ if ($colorset) {
} }
echo $setcss; echo $setcss;
?>