mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Enable "magic" with Hubzilla
This commit is contained in:
parent
5751311e99
commit
dca93a9606
8 changed files with 115 additions and 79 deletions
|
@ -498,7 +498,8 @@ class Strings
|
|||
|
||||
$blocks = [];
|
||||
|
||||
$return = preg_replace_callback($regex,
|
||||
$return = preg_replace_callback(
|
||||
$regex,
|
||||
function ($matches) use ($executionId, &$blocks) {
|
||||
$return = '«block-' . $executionId . '-' . count($blocks) . '»';
|
||||
|
||||
|
@ -516,7 +517,8 @@ class Strings
|
|||
$text = $callback($return ?? $text) ?? '';
|
||||
|
||||
// Restore code blocks
|
||||
$text = preg_replace_callback('/«block-' . $executionId . '-([0-9]+)»/iU',
|
||||
$text = preg_replace_callback(
|
||||
'/«block-' . $executionId . '-([0-9]+)»/iU',
|
||||
function ($matches) use ($blocks) {
|
||||
$return = $matches[0];
|
||||
if (isset($blocks[intval($matches[1])])) {
|
||||
|
@ -545,10 +547,10 @@ class Strings
|
|||
return $shorthand;
|
||||
}
|
||||
|
||||
$last = strtolower($shorthand[strlen($shorthand)-1]);
|
||||
$last = strtolower($shorthand[strlen($shorthand) - 1]);
|
||||
$shorthand = substr($shorthand, 0, -1);
|
||||
|
||||
switch($last) {
|
||||
switch ($last) {
|
||||
case 'g':
|
||||
$shorthand *= 1024;
|
||||
case 'm':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue