bugfix check_org_id_exists
parent
2c741dbe25
commit
915fb8729e
|
@ -125,6 +125,23 @@ function bbcode_to_html($text, $settings)
|
|||
'/>>(.*)\r\n/'
|
||||
);
|
||||
|
||||
/*
|
||||
>> 123
|
||||
and
|
||||
|
||||
'<a href="/r/$2/$1">$1 in /s/$2</a>'
|
||||
|
||||
the regex could probably be tweaked to have an actual end (a dot or something), although compromising usability r smthin
|
||||
|
||||
so:
|
||||
'/^>> ([0-9]+) in (?:/)?s/(.+)$/gm' (also, space is a literal character, don't backslash it)
|
||||
|
||||
it checks for '>>' being the start of the string, then captures whatever number is there ('+' captures if there is one or more)
|
||||
'(?:/)?' just makes the initial '/' optional, i am not sure if it gets added to the capture groups but it really shouldn't
|
||||
'(.+)' at the (somewhat) end just takes anything, although it should be limited to the sub char. limit (by '{1,}' (change the '1' with the max))
|
||||
the '$' makes sure it finishes with that, and the '/gm' is regex flags for "global multiline"
|
||||
|
||||
*/
|
||||
$replace = array (
|
||||
'<strong>$2</strong>',
|
||||
'<em>$2</em>',
|
||||
|
@ -826,13 +843,14 @@ function check_org_id_exists($db, $sub, $org_id)
|
|||
FROM threads
|
||||
WHERE sub = '$sub'
|
||||
AND shadow = 'no'
|
||||
AND post_id = '$org_id'");
|
||||
AND org_id = '$org_id'");
|
||||
$result = $statement->execute();
|
||||
|
||||
$counter = 0;
|
||||
|
||||
while ($row = $result->fetchArray(SQLITE3_NUM)) {
|
||||
$counter++;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ($counter < 1) ) {
|
||||
|
|
|
@ -429,13 +429,14 @@ function check_org_id_exists($db, $sub, $org_id)
|
|||
FROM threads
|
||||
WHERE sub = '$sub'
|
||||
AND shadow = 'no'
|
||||
AND post_id = '$org_id'");
|
||||
AND org_id = '$org_id'");
|
||||
$result = $statement->execute();
|
||||
|
||||
$counter = 0;
|
||||
|
||||
while ($row = $result->fetchArray(SQLITE3_NUM)) {
|
||||
$counter++;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ($counter < 1) ) {
|
||||
|
|
Loading…
Reference in New Issue