File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public function effectively_installed()
3434 /** @var \phpbb\textreparser\manager $reparser_manager */
3535 $ reparser_manager = $ this ->container ->get ('text_reparser.manager ' );
3636
37- return !empty ($ reparser_manager ->get_resume_data ('phpbb.ideas.text_reparser.clean_old_ideas ' ));
37+ return !empty ($ reparser_manager ->get_resume_data ('phpbb.ideas.text_reparser.clean_old_ideas ' ) || ! $ this -> bbcode_exists ( ' idea ' ) );
3838 }
3939
4040 /**
@@ -92,4 +92,23 @@ public function reparse($current = 0)
9292
9393 return $ current ;
9494 }
95+
96+ /**
97+ * Check if a bbcode exists
98+ *
99+ * @param string $tag BBCode's tag
100+ * @return bool True if bbcode exists, false if not
101+ */
102+ public function bbcode_exists ($ tag )
103+ {
104+ $ sql = 'SELECT bbcode_id
105+ FROM ' . $ this ->table_prefix . "bbcodes
106+ WHERE LOWER(bbcode_tag) = ' " . $ this ->db ->sql_escape (strtolower ($ tag )) . "'
107+ OR LOWER(bbcode_tag) = ' " . $ this ->db ->sql_escape (strtolower ($ tag )) . "=' " ;
108+ $ result = $ this ->db ->sql_query_limit ($ sql , 1 );
109+ $ bbcode_id = $ this ->db ->sql_fetchfield ('bbcode_id ' );
110+ $ this ->db ->sql_freeresult ($ result );
111+
112+ return $ bbcode_id !== false ;
113+ }
95114}
You can’t perform that action at this time.
0 commit comments