Loading app/Controllers/Admin/EpisodeController.php +19 −7 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ use App\Models\SoundbiteModel; use CodeIgniter\Exceptions\PageNotFoundException; use CodeIgniter\HTTP\RedirectResponse; use CodeIgniter\I18n\Time; use Config\Database; class EpisodeController extends BaseController { Loading Loading @@ -192,10 +191,12 @@ class EpisodeController extends BaseController } // update podcast's episode_description_footer_markdown if changed $podcastModel = new PodcastModel(); $this->podcast->episode_description_footer_markdown = $this->request->getPost( 'description_footer' ) === '' ? null : $this->request->getPost('description_footer'); if ($this->podcast->hasChanged('episode_description_footer_markdown')) { $this->podcast->episode_description_footer_markdown = $this->request->getPost('description_footer'); $podcastModel = new PodcastModel(); if (! $podcastModel->update($this->podcast->id, $this->podcast)) { return redirect() Loading Loading @@ -313,9 +314,14 @@ class EpisodeController extends BaseController $this->episode->chapters_file_remote_url = $chaptersFileRemoteUrl; } $db = db_connect(); $db->transStart(); $episodeModel = new EpisodeModel(); if (! $episodeModel->update($this->episode->id, $this->episode)) { $db->transRollback(); return redirect() ->back() ->withInput() Loading @@ -323,11 +329,15 @@ class EpisodeController extends BaseController } // update podcast's episode_description_footer_markdown if changed $this->podcast->episode_description_footer_markdown = $this->request->getPost('description_footer'); $this->podcast->episode_description_footer_markdown = $this->request->getPost( 'description_footer' ) === '' ? null : $this->request->getPost('description_footer'); if ($this->podcast->hasChanged('episode_description_footer_markdown')) { $podcastModel = new PodcastModel(); if (! $podcastModel->update($this->podcast->id, $this->podcast)) { $db->transRollback(); return redirect() ->back() ->withInput() Loading @@ -335,6 +345,8 @@ class EpisodeController extends BaseController } } $db->transComplete(); return redirect()->route('episode-view', [$this->podcast->id, $this->episode->id]); } Loading Loading @@ -407,7 +419,7 @@ class EpisodeController extends BaseController ->with('errors', $this->validator->getErrors()); } $db = Database::connect(); $db = db_connect(); $db->transStart(); $newNote = new Note([ Loading Loading @@ -503,7 +515,7 @@ class EpisodeController extends BaseController ->with('errors', $this->validator->getErrors()); } $db = Database::connect(); $db = db_connect(); $db->transStart(); $publishMethod = $this->request->getPost('publication_method'); Loading Loading @@ -589,7 +601,7 @@ class EpisodeController extends BaseController ->with('errors', $this->validator->getErrors()); } $db = Database::connect(); $db = db_connect(); $db->transStart(); Loading app/Controllers/Admin/PodcastController.php +2 −3 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ use App\Models\LanguageModel; use App\Models\PodcastModel; use CodeIgniter\Exceptions\PageNotFoundException; use CodeIgniter\HTTP\RedirectResponse; use Config\Database; use Config\Services; class PodcastController extends BaseController Loading Loading @@ -226,7 +225,7 @@ class PodcastController extends BaseController ]); $podcastModel = new PodcastModel(); $db = Database::connect(); $db = db_connect(); $db->transStart(); Loading Loading @@ -334,7 +333,7 @@ class PodcastController extends BaseController $this->podcast->is_locked = $this->request->getPost('lock') === 'yes'; $this->podcast->updated_by = (int) user_id(); $db = Database::connect(); $db = db_connect(); $db->transStart(); $podcastModel = new PodcastModel(); Loading app/Controllers/Admin/PodcastImportController.php +1 −2 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ use App\Models\PlatformModel; use App\Models\PodcastModel; use CodeIgniter\Exceptions\PageNotFoundException; use CodeIgniter\HTTP\RedirectResponse; use Config\Database; use Config\Services; use ErrorException; use League\HTMLToMarkdown\HtmlConverter; Loading Loading @@ -182,7 +181,7 @@ class PodcastImportController extends BaseController } $podcastModel = new PodcastModel(); $db = Database::connect(); $db = db_connect(); $db->transStart(); Loading app/Controllers/InstallController.php +1 −1 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ class InstallController extends Controller // Activate user $user->activate(); $db = Database::connect(); $db = db_connect(); $db->transStart(); if (! ($userId = $userModel->insert($user, true))) { Loading app/Entities/Podcast.php +17 −8 Original line number Diff line number Diff line Loading @@ -299,7 +299,17 @@ class Podcast extends Entity public function setEpisodeDescriptionFooterMarkdown(?string $episodeDescriptionFooterMarkdown = null): static { if ($episodeDescriptionFooterMarkdown) { if ($episodeDescriptionFooterMarkdown === null || $episodeDescriptionFooterMarkdown === '') { $this->attributes[ 'episode_description_footer_markdown' ] = null; $this->attributes[ 'episode_description_footer_html' ] = null; return $this; } $converter = new CommonMarkConverter([ 'html_input' => 'strip', 'allow_unsafe_links' => false, Loading @@ -311,7 +321,6 @@ class Podcast extends Entity $this->attributes[ 'episode_description_footer_html' ] = $converter->convertToHtml($episodeDescriptionFooterMarkdown); } return $this; } Loading Loading
app/Controllers/Admin/EpisodeController.php +19 −7 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ use App\Models\SoundbiteModel; use CodeIgniter\Exceptions\PageNotFoundException; use CodeIgniter\HTTP\RedirectResponse; use CodeIgniter\I18n\Time; use Config\Database; class EpisodeController extends BaseController { Loading Loading @@ -192,10 +191,12 @@ class EpisodeController extends BaseController } // update podcast's episode_description_footer_markdown if changed $podcastModel = new PodcastModel(); $this->podcast->episode_description_footer_markdown = $this->request->getPost( 'description_footer' ) === '' ? null : $this->request->getPost('description_footer'); if ($this->podcast->hasChanged('episode_description_footer_markdown')) { $this->podcast->episode_description_footer_markdown = $this->request->getPost('description_footer'); $podcastModel = new PodcastModel(); if (! $podcastModel->update($this->podcast->id, $this->podcast)) { return redirect() Loading Loading @@ -313,9 +314,14 @@ class EpisodeController extends BaseController $this->episode->chapters_file_remote_url = $chaptersFileRemoteUrl; } $db = db_connect(); $db->transStart(); $episodeModel = new EpisodeModel(); if (! $episodeModel->update($this->episode->id, $this->episode)) { $db->transRollback(); return redirect() ->back() ->withInput() Loading @@ -323,11 +329,15 @@ class EpisodeController extends BaseController } // update podcast's episode_description_footer_markdown if changed $this->podcast->episode_description_footer_markdown = $this->request->getPost('description_footer'); $this->podcast->episode_description_footer_markdown = $this->request->getPost( 'description_footer' ) === '' ? null : $this->request->getPost('description_footer'); if ($this->podcast->hasChanged('episode_description_footer_markdown')) { $podcastModel = new PodcastModel(); if (! $podcastModel->update($this->podcast->id, $this->podcast)) { $db->transRollback(); return redirect() ->back() ->withInput() Loading @@ -335,6 +345,8 @@ class EpisodeController extends BaseController } } $db->transComplete(); return redirect()->route('episode-view', [$this->podcast->id, $this->episode->id]); } Loading Loading @@ -407,7 +419,7 @@ class EpisodeController extends BaseController ->with('errors', $this->validator->getErrors()); } $db = Database::connect(); $db = db_connect(); $db->transStart(); $newNote = new Note([ Loading Loading @@ -503,7 +515,7 @@ class EpisodeController extends BaseController ->with('errors', $this->validator->getErrors()); } $db = Database::connect(); $db = db_connect(); $db->transStart(); $publishMethod = $this->request->getPost('publication_method'); Loading Loading @@ -589,7 +601,7 @@ class EpisodeController extends BaseController ->with('errors', $this->validator->getErrors()); } $db = Database::connect(); $db = db_connect(); $db->transStart(); Loading
app/Controllers/Admin/PodcastController.php +2 −3 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ use App\Models\LanguageModel; use App\Models\PodcastModel; use CodeIgniter\Exceptions\PageNotFoundException; use CodeIgniter\HTTP\RedirectResponse; use Config\Database; use Config\Services; class PodcastController extends BaseController Loading Loading @@ -226,7 +225,7 @@ class PodcastController extends BaseController ]); $podcastModel = new PodcastModel(); $db = Database::connect(); $db = db_connect(); $db->transStart(); Loading Loading @@ -334,7 +333,7 @@ class PodcastController extends BaseController $this->podcast->is_locked = $this->request->getPost('lock') === 'yes'; $this->podcast->updated_by = (int) user_id(); $db = Database::connect(); $db = db_connect(); $db->transStart(); $podcastModel = new PodcastModel(); Loading
app/Controllers/Admin/PodcastImportController.php +1 −2 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ use App\Models\PlatformModel; use App\Models\PodcastModel; use CodeIgniter\Exceptions\PageNotFoundException; use CodeIgniter\HTTP\RedirectResponse; use Config\Database; use Config\Services; use ErrorException; use League\HTMLToMarkdown\HtmlConverter; Loading Loading @@ -182,7 +181,7 @@ class PodcastImportController extends BaseController } $podcastModel = new PodcastModel(); $db = Database::connect(); $db = db_connect(); $db->transStart(); Loading
app/Controllers/InstallController.php +1 −1 Original line number Diff line number Diff line Loading @@ -303,7 +303,7 @@ class InstallController extends Controller // Activate user $user->activate(); $db = Database::connect(); $db = db_connect(); $db->transStart(); if (! ($userId = $userModel->insert($user, true))) { Loading
app/Entities/Podcast.php +17 −8 Original line number Diff line number Diff line Loading @@ -299,7 +299,17 @@ class Podcast extends Entity public function setEpisodeDescriptionFooterMarkdown(?string $episodeDescriptionFooterMarkdown = null): static { if ($episodeDescriptionFooterMarkdown) { if ($episodeDescriptionFooterMarkdown === null || $episodeDescriptionFooterMarkdown === '') { $this->attributes[ 'episode_description_footer_markdown' ] = null; $this->attributes[ 'episode_description_footer_html' ] = null; return $this; } $converter = new CommonMarkConverter([ 'html_input' => 'strip', 'allow_unsafe_links' => false, Loading @@ -311,7 +321,6 @@ class Podcast extends Entity $this->attributes[ 'episode_description_footer_html' ] = $converter->convertToHtml($episodeDescriptionFooterMarkdown); } return $this; } Loading