mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-07 11:40:56 -05:00
refactor: symplify quote escapes
This commit is contained in:
@@ -29,7 +29,7 @@ class ClearCache extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Clears Several Common Cache\'s ...';
|
||||
protected $description = "Clears Several Common Cache's ...";
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
@@ -48,7 +48,7 @@ class ClearCache extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->comment('Clearing several common cache\'s ...');
|
||||
$this->comment("Clearing several common cache's ...");
|
||||
$this->call('view:clear');
|
||||
$this->call('route:clear');
|
||||
$this->call('config:clear');
|
||||
|
||||
@@ -316,7 +316,7 @@ class GitUpdater extends Command
|
||||
private function validatePath($path)
|
||||
{
|
||||
if (! is_file(base_path($path)) && ! is_dir(base_path($path))) {
|
||||
$this->red(sprintf('The path \'%s\' is invalid', $path));
|
||||
$this->red(sprintf("The path '%s' is invalid", $path));
|
||||
//$this->call('up');
|
||||
//die();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class SetCache extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Sets Several Common Cache\'s ...';
|
||||
protected $description = "Sets Several Common Cache's ...";
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
@@ -48,7 +48,7 @@ class SetCache extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->comment('Setting several common cache\'s ...');
|
||||
$this->comment("Setting several common cache's ...");
|
||||
$this->call('view:cache');
|
||||
$this->call('route:cache');
|
||||
$this->call('config:cache');
|
||||
|
||||
@@ -114,7 +114,7 @@ trait ConsoleTools
|
||||
try {
|
||||
$process->checkTimeout();
|
||||
} catch (ProcessTimedOutException $e) {
|
||||
$this->red(sprintf('\'%s\' timed out.!', $command));
|
||||
$this->red(sprintf("'%s' timed out.!", $command));
|
||||
}
|
||||
|
||||
if (! $silent) {
|
||||
|
||||
@@ -68,7 +68,7 @@ class LanguageCensor
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
if ((is_countable($indexes) ? count($indexes) : 0) > 0 && $indexes[0] == $i) {
|
||||
$match = substr($source, $indexes[0], $word_length);
|
||||
$result .= sprintf('<span class=\'censor\'>%s</span>', $match);
|
||||
$result .= sprintf("<span class='censor'>%s</span>", $match);
|
||||
$ignore = $word_length - 1;
|
||||
} elseif ($ignore > 0) {
|
||||
$ignore--;
|
||||
|
||||
@@ -23,7 +23,7 @@ class Linkify
|
||||
public function linky($text)
|
||||
{
|
||||
if (preg_match(self::REG_EX_URL, $text, $url)) {
|
||||
return preg_replace(self::REG_EX_URL, sprintf('<a href=\'%s\'>%s</a> ', $url[0], $url[0]), $text);
|
||||
return preg_replace(self::REG_EX_URL, sprintf("<a href='%s'>%s</a> ", $url[0], $url[0]), $text);
|
||||
}
|
||||
|
||||
return $text;
|
||||
|
||||
@@ -163,9 +163,9 @@ class RegisterController extends Controller
|
||||
$profile_url = href_profile($user);
|
||||
$welcomeArray = [
|
||||
sprintf('[url=%s]%s[/url], Welcome to ', $profile_url, $user->username).config('other.title').'! Hope you enjoy the community :rocket:',
|
||||
sprintf('[url=%s]%s[/url], We\'ve been expecting you :space_invader:', $profile_url, $user->username),
|
||||
sprintf('[url=%s]%s[/url] has arrived. Party\'s over. :cry:', $profile_url, $user->username),
|
||||
sprintf('It\'s a bird! It\'s a plane! Nevermind, it\'s just [url=%s]%s[/url].', $profile_url, $user->username),
|
||||
sprintf("[url=%s]%s[/url], We've been expecting you :space_invader:", $profile_url, $user->username),
|
||||
sprintf("[url=%s]%s[/url] has arrived. Party's over. :cry:", $profile_url, $user->username),
|
||||
sprintf("It's a bird! It's a plane! Nevermind, it's just [url=%s]%s[/url].", $profile_url, $user->username),
|
||||
sprintf('Ready player [url=%s]%s[/url].', $profile_url, $user->username),
|
||||
sprintf('A wild [url=%s]%s[/url] appeared.', $profile_url, $user->username),
|
||||
'Welcome to '.config('other.title').sprintf(' [url=%s]%s[/url]. We were expecting you ( ͡° ͜ʖ ͡°)', $profile_url, $user->username),
|
||||
|
||||
@@ -1993,7 +1993,8 @@ class UserController extends Controller
|
||||
|
||||
if ($zip->open($path.'/'.$zipFileName, ZipArchive::CREATE) === true) {
|
||||
// Match History Results To Torrents
|
||||
$failCSV = "\"Name\",\"URL\",\"ID\",\"info_hash\"\r\n";
|
||||
$failCSV = '"Name","URL","ID","info_hash"
|
||||
';
|
||||
$failCount = 0;
|
||||
foreach ($historyTorrents as $historyTorrent) {
|
||||
// Get Torrent
|
||||
@@ -2004,7 +2005,8 @@ class UserController extends Controller
|
||||
|
||||
// The Torrent File Exist?
|
||||
if (! file_exists(getcwd().'/files/torrents/'.$torrent->file_name)) {
|
||||
$failCSV .= '"'.$torrent->name.'","'.route('torrent', ['id' => $torrent->id]).'","'.$torrent->id.'","'.$historyTorrent."\"\r\n";
|
||||
$failCSV .= '"'.$torrent->name.'","'.route('torrent', ['id' => $torrent->id]).'","'.$torrent->id.'","'.$historyTorrent.'"
|
||||
';
|
||||
$failCount++;
|
||||
} else {
|
||||
// Delete The Last Torrent Tmp File If Exist
|
||||
|
||||
@@ -64,14 +64,14 @@ class HtmlEncrypt
|
||||
$this->addHexValue('%'.$a);
|
||||
});
|
||||
|
||||
$script = sprintf('<script type=\'text/javascript\' nonce=\'%s\'>document.writeln(unescape(\'%s\'));</script>', $nonce, $this->hex);
|
||||
$script = sprintf("<script type='text/javascript' nonce='%s'>document.writeln(unescape('%s'));</script>", $nonce, $this->hex);
|
||||
|
||||
if (config('html-encrypt.disable_right_click')) {
|
||||
$script .= sprintf('<script type=\'text/javascript\' nonce=\'%s\'>let body = document.getElementsByTagName(\'body\')[0];var att = document.createAttribute(\'oncontextmenu\');att.value = \'return false\'\';body.setAttributeNode(att);</script>', $nonce);
|
||||
$script .= sprintf("<script type='text/javascript' nonce='%s'>let body = document.getElementsByTagName('body')[0];var att = document.createAttribute('oncontextmenu');att.value = 'return false'';body.setAttributeNode(att);</script>", $nonce);
|
||||
}
|
||||
|
||||
if (config('html-encrypt.disable_ctrl_and_F12_key')) {
|
||||
$script .= sprintf('<script type=\'text/javascript\' nonce=\'%s\'>document.onkeydown=function(e){if(e.ctrlKey || e.keyCode == 123){return false}}</script>', $nonce);
|
||||
$script .= sprintf("<script type='text/javascript' nonce='%s'>document.onkeydown=function(e){if(e.ctrlKey || e.keyCode == 123){return false}}</script>", $nonce);
|
||||
}
|
||||
|
||||
return $script;
|
||||
|
||||
@@ -376,7 +376,7 @@ class ChatRepository
|
||||
{
|
||||
foreach (config('censor.redact') as $word) {
|
||||
if (preg_match(sprintf('/\b%s(?=[.,]|$|\s)/mi', $word), $message)) {
|
||||
$message = str_replace($word, sprintf('<span class=\'censor\'>%s</span>', $word), $message);
|
||||
$message = str_replace($word, sprintf("<span class='censor'>%s</span>", $word), $message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user