@@ -6,4 +6,4 @@ |
||
| 6 | 6 | # Take a look at the PSR-0-compatible class autoloading implementation |
| 7 | 7 | # in the Readme.php file if you want a simple autoloader setup. |
| 8 | 8 | |
| 9 | -require_once dirname(__FILE__) . '/MarkdownInterface.php'; |
|
| 9 | +require_once dirname(__FILE__).'/MarkdownInterface.php'; |
|
@@ -6,5 +6,5 @@ |
||
| 6 | 6 | # Take a look at the PSR-0-compatible class autoloading implementation |
| 7 | 7 | # in the Readme.php file if you want a simple autoloader setup. |
| 8 | 8 | |
| 9 | -require_once dirname(__FILE__) . '/MarkdownInterface.php'; |
|
| 10 | -require_once dirname(__FILE__) . '/Markdown.php'; |
|
| 9 | +require_once dirname(__FILE__).'/MarkdownInterface.php'; |
|
| 10 | +require_once dirname(__FILE__).'/Markdown.php'; |
|
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | # you like. |
| 6 | 6 | |
| 7 | 7 | # Install PSR-0-compatible class autoloader |
| 8 | -spl_autoload_register(function($class){ |
|
| 8 | +spl_autoload_register(function($class) { |
|
| 9 | 9 | require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php'; |
| 10 | 10 | }); |
| 11 | 11 | |
@@ -2,6 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | // autoload.php @generated by Composer |
| 4 | 4 | |
| 5 | -require_once __DIR__ . '/composer' . '/autoload_real.php'; |
|
| 5 | +require_once __DIR__.'/composer'.'/autoload_real.php'; |
|
| 6 | 6 | |
| 7 | 7 | return ComposerAutoloaderInit7b593c329d00694ef3fa74c9b77a3c76::getLoader(); |
@@ -30,10 +30,10 @@ |
||
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** Returns the filename of the file. */ |
| 33 | - public function getName() {return $this->name;} |
|
| 33 | + public function getName() {return $this->name; } |
|
| 34 | 34 | |
| 35 | 35 | /** Returns directory of the file without trailing slash */ |
| 36 | - public function getDirectory() {return $this->fs->dirname($this->name);} |
|
| 36 | + public function getDirectory() {return $this->fs->dirname($this->name); } |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Retrieves the contents of a file |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | ) return false; |
| 24 | 24 | // Custom implementations can go here |
| 25 | 25 | // Standard implementation: |
| 26 | - return str_replace('_', '/', $class) . '.php'; |
|
| 26 | + return str_replace('_', '/', $class).'.php'; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | } |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $folders = preg_split("#[\\\\/]#", $folder); |
| 41 | 41 | $base = ''; |
| 42 | - for($i = 0, $c = count($folders); $i < $c; $i++) { |
|
| 43 | - if(empty($folders[$i])) { |
|
| 42 | + for ($i = 0, $c = count($folders); $i < $c; $i++) { |
|
| 43 | + if (empty($folders[$i])) { |
|
| 44 | 44 | if (!$i) { |
| 45 | 45 | // special case for root level |
| 46 | 46 | $base .= DIRECTORY_SEPARATOR; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | continue; |
| 49 | 49 | } |
| 50 | 50 | $base .= $folders[$i]; |
| 51 | - if(!is_dir($base)){ |
|
| 51 | + if (!is_dir($base)) { |
|
| 52 | 52 | $this->mkdir($base); |
| 53 | 53 | } |
| 54 | 54 | $base .= DIRECTORY_SEPARATOR; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | // Loop through the folder |
| 74 | 74 | $dir = $this->dir($source); |
| 75 | - while ( false !== ($entry = $dir->read()) ) { |
|
| 75 | + while (false !== ($entry = $dir->read())) { |
|
| 76 | 76 | // Skip pointers |
| 77 | 77 | if ($entry == '.' || $entry == '..') { |
| 78 | 78 | continue; |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | continue; |
| 126 | 126 | } |
| 127 | 127 | // Recurse |
| 128 | - $this->rmdirr($dirname . DIRECTORY_SEPARATOR . $entry); |
|
| 128 | + $this->rmdirr($dirname.DIRECTORY_SEPARATOR.$entry); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | // Clean up |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | $PHORUM = $GLOBALS["PHORUM"]; |
| 34 | 34 | |
| 35 | - $purifier =& HTMLPurifier::getInstance(); |
|
| 35 | + $purifier = & HTMLPurifier::getInstance(); |
|
| 36 | 36 | $cache_serial = $PHORUM['mod_htmlpurifier']['body_cache_serial']; |
| 37 | 37 | |
| 38 | - foreach($data as $message_id => $message){ |
|
| 39 | - if(isset($message['body'])) { |
|
| 38 | + foreach ($data as $message_id => $message) { |
|
| 39 | + if (isset($message['body'])) { |
|
| 40 | 40 | |
| 41 | 41 | if ($message_id) { |
| 42 | 42 | // we're dealing with a real message, not a fake, so |
@@ -82,16 +82,16 @@ discard block |
||
| 82 | 82 | $body = $fake_data[$message_id]['body']; |
| 83 | 83 | $body = str_replace("<phorum break>\n", "\n", $body); |
| 84 | 84 | $updated_message['body'] = $body; // save it in |
| 85 | - $body .= $signature . $edit_message; // add it back in |
|
| 85 | + $body .= $signature.$edit_message; // add it back in |
|
| 86 | 86 | } else { |
| 87 | 87 | // reverse Phorum's pre-processing |
| 88 | 88 | $body = $message['body']; |
| 89 | 89 | // order is important |
| 90 | 90 | $body = str_replace("<phorum break>\n", "\n", $body); |
| 91 | - $body = str_replace(array('<','>','&', '"'), array('<','>','&','"'), $body); |
|
| 91 | + $body = str_replace(array('<', '>', '&', '"'), array('<', '>', '&', '"'), $body); |
|
| 92 | 92 | if (!$message_id && defined('PHORUM_CONTROL_CENTER')) { |
| 93 | 93 | // we're in control.php, so it was double-escaped |
| 94 | - $body = str_replace(array('<','>','&', '"'), array('<','>','&','"'), $body); |
|
| 94 | + $body = str_replace(array('<', '>', '&', '"'), array('<', '>', '&', '"'), $body); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -129,11 +129,11 @@ discard block |
||
| 129 | 129 | function phorum_htmlpurifier_generate_sig($row) |
| 130 | 130 | { |
| 131 | 131 | $phorum_sig = ''; |
| 132 | - if(isset($row["user"]["signature"]) |
|
| 133 | - && isset($row['meta']['show_signature']) && $row['meta']['show_signature']==1){ |
|
| 134 | - $phorum_sig=trim($row["user"]["signature"]); |
|
| 135 | - if(!empty($phorum_sig)){ |
|
| 136 | - $phorum_sig="\n\n$phorum_sig"; |
|
| 132 | + if (isset($row["user"]["signature"]) |
|
| 133 | + && isset($row['meta']['show_signature']) && $row['meta']['show_signature'] == 1) { |
|
| 134 | + $phorum_sig = trim($row["user"]["signature"]); |
|
| 135 | + if (!empty($phorum_sig)) { |
|
| 136 | + $phorum_sig = "\n\n$phorum_sig"; |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | return $phorum_sig; |
@@ -146,10 +146,10 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | $PHORUM = $GLOBALS['PHORUM']; |
| 148 | 148 | $editmessage = ''; |
| 149 | - if(isset($row['meta']['edit_count']) && $row['meta']['edit_count'] > 0) { |
|
| 150 | - $editmessage = str_replace ("%count%", $row['meta']['edit_count'], $PHORUM["DATA"]["LANG"]["EditedMessage"]); |
|
| 151 | - $editmessage = str_replace ("%lastedit%", phorum_date($PHORUM["short_date_time"],$row['meta']['edit_date']), $editmessage); |
|
| 152 | - $editmessage = str_replace ("%lastuser%", $row['meta']['edit_username'], $editmessage); |
|
| 149 | + if (isset($row['meta']['edit_count']) && $row['meta']['edit_count'] > 0) { |
|
| 150 | + $editmessage = str_replace("%count%", $row['meta']['edit_count'], $PHORUM["DATA"]["LANG"]["EditedMessage"]); |
|
| 151 | + $editmessage = str_replace("%lastedit%", phorum_date($PHORUM["short_date_time"], $row['meta']['edit_date']), $editmessage); |
|
| 152 | + $editmessage = str_replace("%lastuser%", $row['meta']['edit_username'], $editmessage); |
|
| 153 | 153 | $editmessage = "\n\n\n\n$editmessage"; |
| 154 | 154 | } |
| 155 | 155 | return $editmessage; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | function phorum_htmlpurifier_quote($array) |
| 196 | 196 | { |
| 197 | 197 | $PHORUM = $GLOBALS["PHORUM"]; |
| 198 | - $purifier =& HTMLPurifier::getInstance(); |
|
| 198 | + $purifier = & HTMLPurifier::getInstance(); |
|
| 199 | 199 | $text = $purifier->purify($array[1]); |
| 200 | 200 | $source = htmlspecialchars($array[0]); |
| 201 | 201 | return "<blockquote cite=\"$source\">\n$text\n</blockquote>"; |
@@ -217,8 +217,8 @@ discard block |
||
| 217 | 217 | $GLOBALS['PHORUM']['mod_htmlpurifier']['body_cache_serial'] = $config->getSerial(); |
| 218 | 218 | |
| 219 | 219 | // load migration |
| 220 | - if (file_exists(dirname(__FILE__) . '/migrate.php')) { |
|
| 221 | - include(dirname(__FILE__) . '/migrate.php'); |
|
| 220 | + if (file_exists(dirname(__FILE__).'/migrate.php')) { |
|
| 221 | + include(dirname(__FILE__).'/migrate.php'); |
|
| 222 | 222 | } else { |
| 223 | 223 | echo '<strong>Error:</strong> No migration path specified for HTML Purifier, please check |
| 224 | 224 | <tt>modes/htmlpurifier/migrate.bbcode.php</tt> for instructions on |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | if (!function_exists('phorum_htmlpurifier_migrate')) { |
| 230 | 230 | // Dummy function |
| 231 | - function phorum_htmlpurifier_migrate($data) {return $data;} |
|
| 231 | + function phorum_htmlpurifier_migrate($data) {return $data; } |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | } |
@@ -243,8 +243,8 @@ discard block |
||
| 243 | 243 | if (!empty($message['body'])) { |
| 244 | 244 | $body = $message['body']; |
| 245 | 245 | // de-entity-ize contents |
| 246 | - $body = str_replace(array('<','>','&'), array('<','>','&'), $body); |
|
| 247 | - $purifier =& HTMLPurifier::getInstance(); |
|
| 246 | + $body = str_replace(array('<', '>', '&'), array('<', '>', '&'), $body); |
|
| 247 | + $purifier = & HTMLPurifier::getInstance(); |
|
| 248 | 248 | $body = $purifier->purify($body); |
| 249 | 249 | // re-entity-ize contents |
| 250 | 250 | $body = htmlspecialchars($body, ENT_QUOTES, $GLOBALS['PHORUM']['DATA']['CHARSET']); |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | <strong>HTML input</strong> is enabled. Make sure you escape all HTML and |
| 280 | 280 | angled brackets with <code>&lt;</code> and <code>&gt;</code>. |
| 281 | 281 | </p><?php |
| 282 | - $purifier =& HTMLPurifier::getInstance(); |
|
| 282 | + $purifier = & HTMLPurifier::getInstance(); |
|
| 283 | 283 | $config = $purifier->config; |
| 284 | 284 | if ($config->get('AutoFormat.AutoParagraph')) { |
| 285 | 285 | ?><p> |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if(!defined("PHORUM")) exit; |
|
| 3 | +if (!defined("PHORUM")) exit; |
|
| 4 | 4 | |
| 5 | 5 | // default HTML Purifier configuration settings |
| 6 | 6 | $config->set('HTML.Allowed', |