@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | $event->data['subject'], |
| 22 | 22 | 'EmailNotification'); |
| 23 | 23 | if ($recipients): |
| 24 | - $method = '_' . $this->_handledEvents[$event->name()]; |
|
| 24 | + $method = '_'.$this->_handledEvents[$event->name()]; |
|
| 25 | 25 | if (method_exists($this, $method)) { |
| 26 | 26 | $this->$method($event, $recipients); |
| 27 | 27 | } |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | 'conditions' => ['Entry.id' => $event->data['data']['Entry'][$idKey]] |
| 44 | 44 | ]); |
| 45 | 45 | |
| 46 | - $lang = Configure::read( 'Config.language'); |
|
| 46 | + $lang = Configure::read('Config.language'); |
|
| 47 | 47 | $config = [ |
| 48 | 48 | 'subject' => __('New reply to "%s"', $subject['Entry']['subject']), |
| 49 | - 'template' => $lang . DS . 'notification-model-entry-afterReply', |
|
| 49 | + 'template' => $lang.DS.'notification-model-entry-afterReply', |
|
| 50 | 50 | 'viewVars' => [ |
| 51 | 51 | 'parentEntry' => $subject, |
| 52 | 52 | 'newEntry' => $event->data['data'], |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | 'subject' => __('Successfull registration'), |
| 77 | 77 | 'template' => Configure::read( |
| 78 | 78 | 'Config.language' |
| 79 | - ) . DS . 'notification-admin-user_activated', |
|
| 79 | + ).DS.'notification-admin-user_activated', |
|
| 80 | 80 | 'viewVars' => array('user' => $newUser, 'ip' => env('REMOTE_ADDR')), |
| 81 | 81 | |
| 82 | 82 | ]; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | protected function _shouldRecipientReceiveReplyMessage($recipient, $entry) { |
| 90 | 90 | if (Configure::read('debug') === 0 && |
| 91 | 91 | // don't send answer if new entry belongs to the user itself |
| 92 | - (int)$recipient['id'] === (int)$entry['user_id'] |
|
| 92 | + (int) $recipient['id'] === (int) $entry['user_id'] |
|
| 93 | 93 | ) { |
| 94 | 94 | return false; |
| 95 | 95 | } else { |
@@ -46,10 +46,10 @@ discard block |
||
| 46 | 46 | $a['Upload'] = $this->request->data['Upload'][0]; |
| 47 | 47 | $a['Upload']['user_id'] = $this->Session->read('Auth.User.id'); |
| 48 | 48 | $a['Upload']['file']['name'] = Inflector::slug( |
| 49 | - $a['Upload']['user_id'] . '_' . |
|
| 49 | + $a['Upload']['user_id'].'_'. |
|
| 50 | 50 | pathinfo($a['Upload']['file']['name'], PATHINFO_FILENAME) |
| 51 | - ) . |
|
| 52 | - '.' . pathinfo( |
|
| 51 | + ). |
|
| 52 | + '.'.pathinfo( |
|
| 53 | 53 | $a['Upload']['file']['name'], |
| 54 | 54 | PATHINFO_EXTENSION |
| 55 | 55 | ); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $this->Upload->Behaviors->FileUpload->setUp( |
| 61 | 61 | $this->Upload, |
| 62 | 62 | array( |
| 63 | - 'maxFileSize' => (int)Configure::read( |
|
| 63 | + 'maxFileSize' => (int) Configure::read( |
|
| 64 | 64 | 'Saito.Settings.upload_max_img_size' |
| 65 | 65 | ) * 1024 |
| 66 | 66 | ) |
@@ -117,10 +117,10 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | $this->autoRender = false; |
| 119 | 119 | |
| 120 | - $this->Upload->id = (int)$id; |
|
| 120 | + $this->Upload->id = (int) $id; |
|
| 121 | 121 | $file = $this->Upload->read(); |
| 122 | 122 | if ($file && |
| 123 | - (int)$file['Upload']['user_id'] === $this->CurrentUser->getId() |
|
| 123 | + (int) $file['Upload']['user_id'] === $this->CurrentUser->getId() |
|
| 124 | 124 | ) { |
| 125 | 125 | if (!$this->Upload->delete(null, false)) { |
| 126 | 126 | $this->JsData->addAppJsMessage( |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | protected function _init() { |
| 152 | - $this->maxUploadsPerUser = (int)Configure::read( |
|
| 152 | + $this->maxUploadsPerUser = (int) Configure::read( |
|
| 153 | 153 | 'Saito.Settings.upload_max_number_of_uploads' |
| 154 | 154 | ); |
| 155 | 155 | $countCurrent = $this->Upload->countUser($this->CurrentUser->getId()); |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | $this->captcha_result = $numberOne - $numberTwo; |
| 57 | 57 | |
| 58 | 58 | # Session-Way (only one form at a time) - must be a component then |
| 59 | - //$this->Session->write('Captcha.result', $result); |
|
| 59 | + //$this->Session->write('Captcha.result', $result); |
|
| 60 | 60 | |
| 61 | - # DB-Way (several forms possible, high security via IP-Based max limits) |
|
| 62 | - // the following should be done in a component and passed to the view/helper |
|
| 63 | - // $Captcha = ClassRegistry::init('Captcha'); |
|
| 64 | - // $Captcha->new(); $Captcha->update(); etc |
|
| 61 | + # DB-Way (several forms possible, high security via IP-Based max limits) |
|
| 62 | + // the following should be done in a component and passed to the view/helper |
|
| 63 | + // $Captcha = ClassRegistry::init('Captcha'); |
|
| 64 | + // $Captcha->new(); $Captcha->update(); etc |
|
| 65 | 65 | |
| 66 | 66 | # Timestamp-SessionID-Hash-Way (several forms possible, not as secure) |
| 67 | 67 | $this->captcha_hash = SimpleCaptcha::buildHash(array('timestamp' => time(), 'result' => $this->captcha_result), $this->options); |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | # add passive part on active forms as well |
| 95 | 95 | $out = '<div style="display:none">'. |
| 96 | - $this->Form->input($field.'_hash', array('value'=>$this->captcha_hash)). |
|
| 97 | - $this->Form->input($field.'_time', array('value'=>time())). |
|
| 98 | - $this->Form->input((!empty($model)?$model.'.':'').$this->options['dummyField'], array('value'=>'')). |
|
| 99 | - '</div>'; |
|
| 96 | + $this->Form->input($field.'_hash', array('value'=>$this->captcha_hash)). |
|
| 97 | + $this->Form->input($field.'_time', array('value'=>time())). |
|
| 98 | + $this->Form->input((!empty($model)?$model.'.':'').$this->options['dummyField'], array('value'=>'')). |
|
| 99 | + '</div>'; |
|
| 100 | 100 | |
| 101 | 101 | return $out; |
| 102 | 102 | } |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | if ($options['combined'] === true) { |
| 136 | - $options['between'] = $out.' = '; |
|
| 137 | - } |
|
| 136 | + $options['between'] = $out.' = '; |
|
| 137 | + } |
|
| 138 | 138 | unset($options['combined']); |
| 139 | 139 | |
| 140 | 140 | return $this->Form->input($this->__fieldName($model), $options); |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | private $captcha_text = null; |
| 19 | 19 | private $captcha_result = null; |
| 20 | - private $captcha_hash = null; |
|
| 20 | + private $captcha_hash = null; |
|
| 21 | 21 | private $captcha_generated = false; |
| 22 | 22 | |
| 23 | 23 | function __construct(View $View, $settings = array()) { |
| 24 | 24 | $this->options = SimpleCaptcha::$defaults; |
| 25 | 25 | |
| 26 | 26 | # Set up an array with the operators that we want to use. With difficulty=1 it is only subtraction and addition. |
| 27 | - $this->captcha_operator_convert = array( '-' ); |
|
| 27 | + $this->captcha_operator_convert = array('-'); |
|
| 28 | 28 | |
| 29 | - $configs = (array)Configure::read('Captcha'); |
|
| 29 | + $configs = (array) Configure::read('Captcha'); |
|
| 30 | 30 | if (!empty($configs)) { |
| 31 | 31 | $this->options = array_merge($this->options, $configs); |
| 32 | 32 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $captchaOperator = $this->captcha_operator_convert[mt_rand(0, count($this->captcha_operator_convert) - 1)]; |
| 51 | 51 | |
| 52 | 52 | # Get the equation in textual form to show to the user. |
| 53 | - $this->captcha_text = $numberOne . ' ' . $captchaOperator . ' ' . $numberTwo; |
|
| 53 | + $this->captcha_text = $numberOne.' '.$captchaOperator.' '.$numberTwo; |
|
| 54 | 54 | |
| 55 | 55 | # Evaluate the equation and get the result. |
| 56 | 56 | $this->captcha_result = $numberOne - $numberTwo; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @return string |
| 79 | 79 | */ |
| 80 | 80 | public function input($model = null, $options = array()) { |
| 81 | - return $this->active($model, $options) . $this->passive($model, $options); |
|
| 81 | + return $this->active($model, $options).$this->passive($model, $options); |
|
| 82 | 82 | return $out; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $out = '<div style="display:none">'. |
| 96 | 96 | $this->Form->input($field.'_hash', array('value'=>$this->captcha_hash)). |
| 97 | 97 | $this->Form->input($field.'_time', array('value'=>time())). |
| 98 | - $this->Form->input((!empty($model)?$model.'.':'').$this->options['dummyField'], array('value'=>'')). |
|
| 98 | + $this->Form->input((!empty($model) ? $model.'.' : '').$this->options['dummyField'], array('value'=>'')). |
|
| 99 | 99 | '</div>'; |
| 100 | 100 | |
| 101 | 101 | return $out; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | 'class'=>'captcha', |
| 118 | 118 | 'value'=>'', |
| 119 | 119 | 'maxlength'=>3, |
| 120 | - 'label'=>__('Captcha',true), |
|
| 120 | + 'label'=>__('Captcha', true), |
|
| 121 | 121 | 'combined'=>true, 'autocomplete'=>'off' |
| 122 | 122 | ); |
| 123 | 123 | $options = array_merge($defaultOptions, $options); |
@@ -41,7 +41,9 @@ |
||
| 41 | 41 | * @return array |
| 42 | 42 | */ |
| 43 | 43 | protected function _generate() { |
| 44 | - if ($this->captcha_generated === TRUE) return; |
|
| 44 | + if ($this->captcha_generated === TRUE) { |
|
| 45 | + return; |
|
| 46 | + } |
|
| 45 | 47 | # Choose the first number randomly between 6 and 10. This is to stop the answer being negative. |
| 46 | 48 | $numberOne = mt_rand(6, 9); |
| 47 | 49 | # Choose the second number randomly between 0 and 5. |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class SimpleCaptcha extends Object { |
| 4 | - static public $defaults = array ( |
|
| 4 | + static public $defaults = array( |
|
| 5 | 5 | 'dummyField' => 'homepage', |
| 6 | 6 | 'method' => 'hash', |
| 7 | 7 | 'checkSession' => false, |
@@ -284,10 +284,10 @@ discard block |
||
| 284 | 284 | public function testAtLinkKnownUsers() { |
| 285 | 285 | $input = '@Alice @Bob @Bobby Junior @Bobby Tables @Dr. No'; |
| 286 | 286 | $expected = |
| 287 | - "<a href='/at/Alice'>@Alice</a>" . |
|
| 288 | - " @Bob " . |
|
| 289 | - "<a href='/at/Bobby+Junior'>@Bobby Junior</a>" . |
|
| 290 | - " @Bobby Tables " . |
|
| 287 | + "<a href='/at/Alice'>@Alice</a>". |
|
| 288 | + " @Bob ". |
|
| 289 | + "<a href='/at/Bobby+Junior'>@Bobby Junior</a>". |
|
| 290 | + " @Bobby Tables ". |
|
| 291 | 291 | "<a href='/at/Dr.+No'>@Dr. No</a>"; |
| 292 | 292 | |
| 293 | 293 | $result = $this->_Parser->parse($input); |
@@ -580,8 +580,8 @@ discard block |
||
| 580 | 580 | |
| 581 | 581 | public function testIframe() { |
| 582 | 582 | //* test allowed domain |
| 583 | - $input = '[iframe height=349 width=560 ' . |
|
| 584 | - 'src=http://www.youtube.com/embed/HdoW3t_WorU ' . |
|
| 583 | + $input = '[iframe height=349 width=560 '. |
|
| 584 | + 'src=http://www.youtube.com/embed/HdoW3t_WorU '. |
|
| 585 | 585 | 'frameborder=0][/iframe]'; |
| 586 | 586 | $expected = [ |
| 587 | 587 | ['iframe' => [ |
@@ -596,8 +596,8 @@ discard block |
||
| 596 | 596 | $this->assertTags($result, $expected); |
| 597 | 597 | |
| 598 | 598 | //* test forbidden domains |
| 599 | - $input = '[iframe height=349 width=560 ' . |
|
| 600 | - 'src=http://www.youtubescam.com/embed/HdoW3t_WorU ' . |
|
| 599 | + $input = '[iframe height=349 width=560 '. |
|
| 600 | + 'src=http://www.youtubescam.com/embed/HdoW3t_WorU '. |
|
| 601 | 601 | 'frameborder=0][/iframe]'; |
| 602 | 602 | $expected = '/src/i'; |
| 603 | 603 | $result = $this->_Parser->parse($input, ['video_domains_allowed' => 'youtube | vimeo']); |
@@ -605,8 +605,8 @@ discard block |
||
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | public function testIframeAllDomainsAllowed() { |
| 608 | - $input = '[iframe height=349 width=560 ' . |
|
| 609 | - 'src=http://www.youtubescam.com/embed/HdoW3t_WorU ' . |
|
| 608 | + $input = '[iframe height=349 width=560 '. |
|
| 609 | + 'src=http://www.youtubescam.com/embed/HdoW3t_WorU '. |
|
| 610 | 610 | '][/iframe]'; |
| 611 | 611 | $expected = 'src="http://www.youtubescam.com/embed/HdoW3t_WorU'; |
| 612 | 612 | $result = $this->_Parser->parse($input, ['video_domains_allowed' => '*']); |
@@ -614,8 +614,8 @@ discard block |
||
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | public function testIframeNoDomainAllowed() { |
| 617 | - $input = '[iframe height=349 width=560 ' . |
|
| 618 | - 'src=http://www.youtubescam.com/embed/HdoW3t_WorU ' . |
|
| 617 | + $input = '[iframe height=349 width=560 '. |
|
| 618 | + 'src=http://www.youtubescam.com/embed/HdoW3t_WorU '. |
|
| 619 | 619 | '][/iframe]'; |
| 620 | 620 | $expected = '/src/i'; |
| 621 | 621 | $result = $this->_Parser->parse($input, ['video_domains_allowed' => '']); |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | |
| 635 | 635 | // test for URIs without protocol |
| 636 | 636 | $input = '[img]/somewhere/macnemo.png[/img]'; |
| 637 | - $expected = '<img src="' . $this->_Helper->webroot . 'somewhere/macnemo.png" alt=""/>'; |
|
| 637 | + $expected = '<img src="'.$this->_Helper->webroot.'somewhere/macnemo.png" alt=""/>'; |
|
| 638 | 638 | $result = $this->_Parser->parse($input); |
| 639 | 639 | $this->assertEquals($expected, $result); |
| 640 | 640 | |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | public function testCodeNoCitationMark() { |
| 818 | 818 | // [code]<citation mark>[/code] should not be cited |
| 819 | 819 | $input = h( |
| 820 | - "[code]\n" . $this->_Helper->settings['quote_symbol'] . "\n[/code]" |
|
| 820 | + "[code]\n".$this->_Helper->settings['quote_symbol']."\n[/code]" |
|
| 821 | 821 | ); |
| 822 | 822 | $expected = '`span class=.*?richtext-citation`'; |
| 823 | 823 | $result = $this->_Parser->parse($input); |
@@ -832,11 +832,11 @@ discard block |
||
| 832 | 832 | |
| 833 | 833 | public function testQuote() { |
| 834 | 834 | $_qs = h($this->_Helper->settings['quote_symbol']); |
| 835 | - $input = $_qs . ' fo [b]test[/b] ba'; |
|
| 835 | + $input = $_qs.' fo [b]test[/b] ba'; |
|
| 836 | 836 | $result = $this->_Parser->parse($input); |
| 837 | 837 | $expected = [ |
| 838 | 838 | 'span' => ['class' => 'richtext-citation'], |
| 839 | - $_qs . ' fo ', |
|
| 839 | + $_qs.' fo ', |
|
| 840 | 840 | 'strong' => [], |
| 841 | 841 | 'test', |
| 842 | 842 | '/strong', |
@@ -864,7 +864,7 @@ discard block |
||
| 864 | 864 | //* test autoconversion for audio files |
| 865 | 865 | $html5AudioExtensions = array('m4a', 'ogg', 'mp3', 'wav', 'opus'); |
| 866 | 866 | foreach ($html5AudioExtensions as $extension) { |
| 867 | - $url = 'http://example.com/audio.' . $extension; |
|
| 867 | + $url = 'http://example.com/audio.'.$extension; |
|
| 868 | 868 | $input = "[video]{$url}[/video]"; |
| 869 | 869 | $result = $this->_Parser->parse($input); |
| 870 | 870 | $expected = array( |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | $input = "[audio]{$url}[/audio]"; |
| 928 | 928 | $result = $this->_Parser->parse($input); |
| 929 | 929 | $expected = array( |
| 930 | - 'audio' => array( 'src' => $url, 'controls' => 'controls' ), |
|
| 930 | + 'audio' => array('src' => $url, 'controls' => 'controls'), |
|
| 931 | 931 | ); |
| 932 | 932 | $this->assertTags($result, $expected); |
| 933 | 933 | |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $options = array_merge($this->_cSettings, $options); |
| 218 | 218 | |
| 219 | 219 | // serializing complex objects kills PHP |
| 220 | - $serializable = array_filter($options, function ($value) { |
|
| 220 | + $serializable = array_filter($options, function($value) { |
|
| 221 | 221 | return !is_object($value); |
| 222 | 222 | }); |
| 223 | 223 | $parserId = md5(serialize($serializable)); |
@@ -258,8 +258,8 @@ discard block |
||
| 258 | 258 | $this->_Parser->addCodeDefinition($builder->build()); |
| 259 | 259 | break; |
| 260 | 260 | case 'class': |
| 261 | - require_once (\CakePlugin::path('BbcodeParser') . DS . 'Lib' . DS . 'jBBCode' . DS . 'Definitions' . DS . 'JbbCodeDefinitions.php'); |
|
| 262 | - $class = '\Plugin\BbcodeParser\Lib\jBBCode\Definitions\\' . ucfirst($title); |
|
| 261 | + require_once (\CakePlugin::path('BbcodeParser').DS.'Lib'.DS.'jBBCode'.DS.'Definitions'.DS.'JbbCodeDefinitions.php'); |
|
| 262 | + $class = '\Plugin\BbcodeParser\Lib\jBBCode\Definitions\\'.ucfirst($title); |
|
| 263 | 263 | $this->_Parser->addCodeDefinition(new $class($this->_Helper, $options)); |
| 264 | 264 | break; |
| 265 | 265 | default: |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | // use Cakes Validation class to detect valid URL |
| 21 | 21 | \App::uses('Validation', 'Utility'); |
| 22 | 22 | if (\Validation::url($url)) { |
| 23 | - $url = 'http://' . $url; |
|
| 23 | + $url = 'http://'.$url; |
|
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | if (!empty($url) && preg_match('/\<img\s*?src=/', $text) !== 1) { |
| 37 | 37 | $host = DomainParser::domainAndTld($url); |
| 38 | 38 | if ($host !== false && $host !== env('SERVER_NAME')) { |
| 39 | - $out .= ' <span class=\'richtext-linkInfo\'>[' . $host . ']</span>'; |
|
| 39 | + $out .= ' <span class=\'richtext-linkInfo\'>['.$host.']</span>'; |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $_placeholder = ' … '; |
| 67 | - $leftMargin = (int)floor($_textWordMaxLength / 2); |
|
| 68 | - $rightMargin = (int)(-1 * ($_textWordMaxLength - $leftMargin - mb_strlen($_placeholder))); |
|
| 67 | + $leftMargin = (int) floor($_textWordMaxLength / 2); |
|
| 68 | + $rightMargin = (int) (-1 * ($_textWordMaxLength - $leftMargin - mb_strlen($_placeholder))); |
|
| 69 | 69 | |
| 70 | - $string = mb_substr($string, 0, $leftMargin) . $_placeholder . |
|
| 70 | + $string = mb_substr($string, 0, $leftMargin).$_placeholder. |
|
| 71 | 71 | mb_substr($string, $rightMargin); |
| 72 | 72 | return $string; |
| 73 | 73 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @return string |
| 80 | 80 | */ |
| 81 | 81 | protected function _decorateTarget($string) { |
| 82 | - $decorator = function ($matches) { |
|
| 82 | + $decorator = function($matches) { |
|
| 83 | 83 | $out = ''; |
| 84 | 84 | $url = $matches[1]; |
| 85 | 85 | |
@@ -90,11 +90,11 @@ discard block |
||
| 90 | 90 | $parsedUrl = @parse_url($url); |
| 91 | 91 | |
| 92 | 92 | if (isset($parsedUrl['host'])) { |
| 93 | - if ($parsedUrl['host'] !== env('SERVER_NAME') && $parsedUrl['host'] !== "www." . env('SERVER_NAME')) { |
|
| 93 | + if ($parsedUrl['host'] !== env('SERVER_NAME') && $parsedUrl['host'] !== "www.".env('SERVER_NAME')) { |
|
| 94 | 94 | $out = " rel='external' target='_blank'"; |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | - return $matches[0] . $out; |
|
| 97 | + return $matches[0].$out; |
|
| 98 | 98 | }; |
| 99 | 99 | |
| 100 | 100 | return preg_replace_callback('#href=["\'](.*?)["\']#is', |
@@ -60,10 +60,10 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | krsort($names); |
| 63 | - $baseUrl = $this->_sOptions['webroot'] . $this->_sOptions['atBaseUrl']; |
|
| 63 | + $baseUrl = $this->_sOptions['webroot'].$this->_sOptions['atBaseUrl']; |
|
| 64 | 64 | foreach ($names as $name => $v) { |
| 65 | 65 | $title = urlencode($name); |
| 66 | - $link = $this->_url($baseUrl . $title, "@$name", |
|
| 66 | + $link = $this->_url($baseUrl.$title, "@$name", |
|
| 67 | 67 | false); |
| 68 | 68 | $string = str_replace("@$name", $link, $string); |
| 69 | 69 | } |
@@ -72,11 +72,11 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | protected function _autolink($string) { |
| 75 | - $replace = function ($matches) { |
|
| 75 | + $replace = function($matches) { |
|
| 76 | 76 | // exclude punctuation at end of sentence from URLs |
| 77 | 77 | $ignoredEndChars = implode('|', [',', '\?', ',', '\.', '\)', '!']); |
| 78 | 78 | preg_match( |
| 79 | - '/(?P<element>.*?)(?P<suffix>' . $ignoredEndChars . ')?$/', |
|
| 79 | + '/(?P<element>.*?)(?P<suffix>'.$ignoredEndChars.')?$/', |
|
| 80 | 80 | $matches['element'], |
| 81 | 81 | $m |
| 82 | 82 | ); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $matches = $m + $matches; |
| 85 | 85 | |
| 86 | 86 | if (strpos($matches['element'], '://') === false) { |
| 87 | - $matches['element'] = 'http://' . $matches['element']; |
|
| 87 | + $matches['element'] = 'http://'.$matches['element']; |
|
| 88 | 88 | } |
| 89 | 89 | $matches += [ |
| 90 | 90 | 'prefix' => '', |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | $url = $this->_url($matches['element'], $matches['element'], false, |
| 95 | 95 | true); |
| 96 | - return $matches['prefix'] . $url . $matches['suffix']; |
|
| 96 | + return $matches['prefix'].$url.$matches['suffix']; |
|
| 97 | 97 | }; |
| 98 | 98 | |
| 99 | 99 | //# autolink http://urls |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | //# autolink email |
| 114 | 114 | $string = preg_replace_callback( |
| 115 | 115 | "#(?<=^|[\n ])(?P<content>([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+))#i", |
| 116 | - function ($matches) { |
|
| 116 | + function($matches) { |
|
| 117 | 117 | return $this->_email($matches['content']); |
| 118 | 118 | }, $string |
| 119 | 119 | ); |
@@ -122,12 +122,12 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | protected function _hashLink($string) { |
| 125 | - $baseUrl = $this->_sOptions['webroot'] . $this->_sOptions['hashBaseUrl']; |
|
| 125 | + $baseUrl = $this->_sOptions['webroot'].$this->_sOptions['hashBaseUrl']; |
|
| 126 | 126 | $string = preg_replace_callback( |
| 127 | 127 | '/(?<=\s|^|])(?<tag>#)(?<element>\d+)(?!\w)/', |
| 128 | - function ($m) use ($baseUrl) { |
|
| 128 | + function($m) use ($baseUrl) { |
|
| 129 | 129 | $hash = $m['element']; |
| 130 | - return $this->_url($baseUrl . $hash, '#' . $hash); |
|
| 130 | + return $this->_url($baseUrl.$hash, '#'.$hash); |
|
| 131 | 131 | }, |
| 132 | 132 | $string |
| 133 | 133 | ); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | protected function _audio($content) { |
| 20 | 20 | $out = "<audio src='$content' controls='controls'>"; |
| 21 | 21 | $out .= Message::format(__( |
| 22 | - 'Your browser does not support HTML5 audio. Please updgrade to a modern ' . |
|
| 22 | + 'Your browser does not support HTML5 audio. Please updgrade to a modern '. |
|
| 23 | 23 | 'browser. In order to watch this stream you need an HTML5 capable browser.', |
| 24 | 24 | true)); |
| 25 | 25 | $out .= "</audio>"; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | protected function _video($content) { |
| 30 | 30 | // fix audio files mistakenly wrapped into an [video] tag |
| 31 | - if (preg_match('/(' . implode('|', self::$_html5AudioExtensions) . ')$/i', |
|
| 31 | + if (preg_match('/('.implode('|', self::$_html5AudioExtensions).')$/i', |
|
| 32 | 32 | $content) === 1 |
| 33 | 33 | ) { |
| 34 | 34 | return $this->_audio($content); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $out = "<video src='$content' controls='controls' x-webkit-airplay='allow'>"; |
| 38 | 38 | $out .= Message::format(__( |
| 39 | - 'Your browser does not support HTML5 video. Please updgrade to a modern ' . |
|
| 39 | + 'Your browser does not support HTML5 video. Please updgrade to a modern '. |
|
| 40 | 40 | 'browser. In order to watch this stream you need an HTML5 capable browser.', |
| 41 | 41 | true)); |
| 42 | 42 | $out .= '</video>'; |