<commit_before><?php
class Vpc_Basic_Text_Row extends Vps_Db_Table_Row
{
    //für Component und Row
    public function getContentParts($content = null)
    {
        $classes = Vpc_Abstract::getSetting($this->getTable()->getComponentClass(),
                                            'childComponentClasses');

        $usedChildComponentNrs = array();

        $componentId = $this->component_id;
        if (is_null($content)) $content = $this->content;

        $ret = array();
                            //1   2                 3                              4              5
        while (preg_match('#^(.*)(<img.+src=[\n ]*"([^"]*)"[^>]*>|<a.+href=[\n ]*"([^"]*)"[^>]*>)(.*)$#Us', $content, $m)) {

            if ($m[1] != '') {
                $ret[] = $m[1];
            }

            if ($classes['image'] && $m[3] != ''
                && preg_match('#/media/([^/]+)/([^/]+)/([^/]+)/([^/]+)#', $m[3], $m2)) {
                $isInvalid = false;
                $childComponentId = $m2[2];
                if (substr($childComponentId, 0, strlen($componentId)+2)
                            == $componentId.'-i') {
                    $nr = substr($childComponentId, strlen($componentId)+2);
                    if (!in_array('i'.$nr, $usedChildComponentNrs)) {
                        $usedChildComponentNrs[] = 'i'.$nr;
                        $ret[] = array('type'=>'image', 'nr'=>$nr, 'html'=>$m[2]);
                    } else {
                        $isInvalid = true;
                    }
                } else {
                    $isInvalid = true;
                }
                if ($isInvalid) {<commit_msg>bugfix: <a ohne href bug<commit_after><?php
class Vpc_Basic_Text_Row extends Vps_Db_Table_Row
{
    //für Component und Row
    public function getContentParts($content = null)
    {
        $classes = Vpc_Abstract::getSetting($this->getTable()->getComponentClass(),
                                            'childComponentClasses');

        $usedChildComponentNrs = array();

        $componentId = $this->component_id;
        if (is_null($content)) $content = $this->content;

        $ret = array();
                            //1   2                 3                              4              5
        while (preg_match('#^(.*)(<img[^>]+src=[\n ]*"([^"]*)"[^>]*>|<a[^>]+href=[\n ]*"([^"]*)"[^>]*>)(.*)$#Us', $content, $m)) {

            if ($m[1] != '') {
                $ret[] = $m[1];
            }

            if ($classes['image'] && $m[3] != ''
                && preg_match('#/media/([^/]+)/([^/]+)/([^/]+)/([^/]+)#', $m[3], $m2)) {
                $isInvalid = false;
                $childComponentId = $m2[2];
                if (substr($childComponentId, 0, strlen($componentId)+2)
                            == $componentId.'-i') {
                    $nr = substr($childComponentId, strlen($componentId)+2);
                    if (!in_array('i'.$nr, $usedChildComponentNrs)) {
                        $usedChildComponentNrs[] = 'i'.$nr;
                        $ret[] = array('type'=>'image', 'nr'=>$nr, 'html'=>$m[2]);
                    } else {
                        $isInvalid = true;
                    }
                } else {
                    $isInvalid = true;
                }
                if ($isInvalid) {
{'fraction_non_alphanumeric': 0.19557977596124734, 'fraction_numerical': 0.009688162276718135, 'mean_word_length': 1.358315488936474, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1740925', 'n_tokens_mistral': 990, 'n_tokens_neox': 930, 'n_words': 156}