Merge branch 'master' into PHRAS-2815_generate-cterms-multi-db_4.1

This commit is contained in:
Nicolas Maillat
2019-11-08 17:37:17 +01:00
committed by GitHub
5 changed files with 73 additions and 5 deletions

View File

@@ -63,4 +63,26 @@ class StringUtils
return self::$transliterator->transliterate($string);
}
/**
* replace bad chars (ascii 0...31 except 9,10,13)
*
* @param $s
* @param string $replace
* @return mixed
*/
public static function substituteCtrlCharacters($s, $replace = '_')
{
static $bad_chars = null;
if($bad_chars === null) {
$bad_chars = [];
for($i=0; $i<32; $i++) {
if($i != 9 && $i != 10 && $i != 13) {
$bad_chars[] = chr($i);
}
}
}
return str_replace($bad_chars, $replace, $s);
}
}

View File

@@ -32,6 +32,7 @@ class CandidateTerms
public function insert($field, $value)
{
$value = StringUtils::substituteCtrlCharacters($value, '');
$this->ensureVisitorSetup();
if (!$this->visitor->hasTerm($field, $value)) {
$this->new_candidates[$value] = $field;

View File

@@ -65,7 +65,7 @@
"normalize-css": "^2.1.0",
"npm": "^6.0.0",
"npm-modernizr": "^2.8.3",
"phraseanet-production-client": "0.34.75-d",
"phraseanet-production-client": "0.34.76-d",
"requirejs": "^2.3.5",
"tinymce": "^4.0.28",
"underscore": "^1.8.3",

View File

@@ -109,3 +109,48 @@ dd {
float: left;
}
}
/*Help menu*/
.contextMenu.helpcontextmenu {
display: none;
&.shown {
display: block;
position: absolute;
z-index: 101;
}
}
.help-trigger {
display:inline-block;
cursor:pointer;
padding: 0 4px;
border:none;
margin-left: -12px;
margin-right: 94px;
.fa-caret-down:before {
content: "\25BC";
font-size: 11px;
}
}
.context-menu-theme-vista {
background-image: none;
background-color: #414141;
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
.context-menu-item {
transition: 500ms;
&:hover {
background-image: none;
background-color: #75abff;
border: none;
}
.context-menu-item-inner {
padding: 4px 12px;
margin-left: 0;
font-family: Helvetica;
font-size: 12px;
font-weight: 700;
color: #fff;
}
}
}

View File

@@ -7555,10 +7555,10 @@ phraseanet-common@^0.4.1:
js-cookie "^2.1.0"
pym.js "^1.3.1"
phraseanet-production-client@0.34.75-d:
version "0.34.75-d"
resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.34.75-d.tgz#713d19541db612d42aa0111820e5368698aeb4ea"
integrity sha512-w/pC65z8UiMOdkCHQ2RIYkSMYzBQ9N3264Xl+F8QKSqwdFxXfu75h2mPj/UROrwJq/LYAc9oWiYfHFWLCmO0qA==
phraseanet-production-client@0.34.76-d:
version "0.34.76-d"
resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.34.76-d.tgz#641e9bc4379725ee06669c7cefe0bc78996342e0"
integrity sha512-/SYoQrhVHfvtchjwmVm0/QkuWBTcmbPpNlepCKvjTMZBBPLepe+eUNHJh/vcnd+tCZkeYWu16kQvvdjs92dn5Q==
dependencies:
"@mapbox/mapbox-gl-language" "^0.9.2"
"@turf/turf" "^5.1.6"